lucy_dockerunner 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f5e5a03a9ef72ac78d552d8f4961132d292f72bf10e3fe0aa9a0b8e3aca17f5a
4
- data.tar.gz: dd65c50f4cd8f8f44f2f8090c591a307e7e57550bd642319afed5bc2afd46d94
3
+ metadata.gz: 1fb92417b00f7053116d2c318bef90e2b2ca16bf5395ee1d6df9252f9d91d33a
4
+ data.tar.gz: 51b091e08e2348557a4be898dead7854024ec7cfdf5e4411d5b66733e07b028d
5
5
  SHA512:
6
- metadata.gz: 179f532102d570dcbf439046f3bdc19c861fa99919d13ec47f43b8aca8504e417631aed62fad9935aef600abf0e5d3e2f7faf20895237c40f5774981205a2568
7
- data.tar.gz: 6e3487f0144a3ddd385bece9540094cb6d4679868c7f4ee18cfca96b8cd31297a680df8ac82a05161aab3df689584414f4114bdaf3d0ef6cf04589f1e03ce459
6
+ metadata.gz: 87a86932296b65bb8b48afa2ef2bafe1d7e26f20a777ae9c34e04625e674f8993f6697d4d586ee8fcb77f600704fcc9500abd530ccedd1a6f75033c80b849abe
7
+ data.tar.gz: 892d00567b19499290e800765ede4fc9ec12b317cc762024abc5af3908301be094033536a27dad6c00112ef215b995bad2b0eacb460684424378e2b1d1236a9b
data/Gemfile.lock CHANGED
@@ -1,15 +1,15 @@
1
1
  GIT
2
2
  remote: https://github.com/JesusGautamah/rake-hooks.git
3
- revision: 4ee50e368c9cbc0ecb087df0ffdfdf1c647739c8
3
+ revision: eb7fb883a2718523ba55f41ae2ab6ba1df1e8e80
4
4
  branch: master
5
5
  specs:
6
- rake-hooks (1.2.5)
6
+ rake-hooks (1.2.6)
7
7
  rake
8
8
 
9
9
  PATH
10
10
  remote: .
11
11
  specs:
12
- lucy_dockerunner (0.1.8)
12
+ lucy_dockerunner (0.1.1)
13
13
  rake-hooks
14
14
 
15
15
  GEM
data/LICENSE.md ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2023 Igor Lima de Jesus
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
data/README.md CHANGED
@@ -2,6 +2,12 @@
2
2
 
3
3
  Lucy Dockerunner is a Ruby gem that provides a simple wrapper around the Docker Compose CLI to make it easier to run Docker Compose commands from Ruby.
4
4
 
5
+ [![Gem Version](https://badge.fury.io/rb/lucy_dockerunner.svg)](https://badge.fury.io/rb/lucy_dockerunner)
6
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
7
+ [![Ruby Version](https://img.shields.io/badge/Ruby-2.6.0%2B-blue.svg)](https://www.ruby-lang.org/en/)
8
+
9
+ Ruby version: >= 2.6.0
10
+
5
11
  ## Installation
6
12
 
7
13
  You can install the gem by executing:
@@ -17,11 +23,17 @@ Or add it to your Gemfile:
17
23
  * `rake compose:build` - build docker compose services
18
24
  * `rake compose:up` - start the docker compose services
19
25
  * `rake compose:down` - stop the docker compose services
26
+ * `rake compose:status` - show the status of the docker compose services
27
+ * `rake compose:shell` - open a shell in the web service
20
28
  * `rake compose:db_detach` - detach the database from the docker compose services
21
29
  * `rake compose:redis_detach` - detach the redis from the docker compose services
22
30
  * `rake compose:back_detach` - detach the backend(redis, sidekiq, db) from the docker compose services
23
31
  * `rake compose:restart` - restart the docker compose services
24
32
  * `rake compose:clean_all` - clean all docker compose services
33
+ * `rake compose:clean_images` - clean all docker compose images
34
+ * `rake compose:clean_volumes` - clean all docker compose volumes
35
+ * `rake compose:clean_orphans` - clean all docker compose orphans
36
+ * `rake compose:clean_containers` - clean all docker compose containers
25
37
  #### Database actions
26
38
  * `rake compose_db:migrate` - migrate the database
27
39
  * `rake compose_db:reset` - reset the database
@@ -56,21 +68,16 @@ Or add it to your Gemfile:
56
68
  * `rake compose_logs:tail_redis` - tail redis logs
57
69
  * `rake compose_logs:tail_sidekiq` - tail sidekiq logs
58
70
  * `rake compose_logs:tail_all` - tail all logs
59
- * `rake compose_logs:follow_web` - follow web logs
60
- * `rake compose_logs:follow_db` - follow db logs
61
- * `rake compose_logs:follow_redis` - follow redis logs
62
- * `rake compose_logs:follow_sidekiq` - follow sidekiq logs
63
- * `rake compose_logs:follow_all` - follow all logs
64
71
 
65
- ## Start the blockchain
72
+ ## Start the docker compose services
66
73
  ````bash
67
74
  $ rake compose:up
68
75
  ````
69
- ### Access the blockchain web interface
76
+ ### Access the web service
70
77
  http://localhost
71
78
  ## Contributing
72
79
 
73
- Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/lucy_dockerunner. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://github.com/[USERNAME]/lucy_dockerunner/blob/master/CODE_OF_CONDUCT.md).
80
+ Bug reports and pull requests are welcome on GitHub at https://github.com/JesusGautamah/lucy_dockerunner. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://github.com/JesusGautamah/lucy_dockerunner/blob/master/CODE_OF_CONDUCT.md).
74
81
 
75
82
  ## License
76
83
 
@@ -78,4 +85,4 @@ The gem is available as open source under the terms of the [MIT License](https:/
78
85
 
79
86
  ## Code of Conduct
80
87
 
81
- Everyone interacting in the LucyDockerunner project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/[USERNAME]/lucy_dockerunner/blob/master/CODE_OF_CONDUCT.md).
88
+ Everyone interacting in the LucyDockerunner project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/JesusGautamah/lucy_dockerunner/blob/master/CODE_OF_CONDUCT.md).
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module LucyDockerunner
4
- VERSION = "0.1.0"
4
+ VERSION = "0.1.1"
5
5
  end
@@ -99,6 +99,18 @@ namespace :compose do
99
99
  puts "Restarting Compose... Done!"
100
100
  end
101
101
 
102
+ task :status do
103
+ puts "Status Compose..."
104
+ system "sudo #{compose_command} ps"
105
+ puts "Status Compose... Done!"
106
+ end
107
+
108
+ task :shell do
109
+ puts "Running Shell..."
110
+ system "sudo #{compose_command} run --rm web bash"
111
+ puts "Running Shell... Done!"
112
+ end
113
+
102
114
  task :clean_all do
103
115
  puts "Cleaning Compose..."
104
116
  puts "Stopping Compose..."
@@ -46,19 +46,19 @@ namespace :compose_db do
46
46
  end
47
47
 
48
48
  task :migrate do
49
- puts "Running Migration..."
49
+ puts "Migrating Database..."
50
50
  system "sudo #{compose_command} run --rm web rake db:migrate"
51
- puts "Running Migration... Done!"
51
+ puts "Migrating Database... Done!"
52
52
  end
53
53
 
54
54
  task :seed do
55
- puts "Running Seed..."
55
+ puts "Seeding Database..."
56
56
  system "sudo #{compose_command} run --rm web rake db:seed"
57
- puts "Running Seed... Done!"
57
+ puts "Seeding Database... Done!"
58
58
  end
59
59
 
60
60
  task :reset_setup do
61
- puts "Resettting Database..."
61
+ puts "Resetting Database..."
62
62
  system "sudo #{compose_command} run --rm web rake db:drop"
63
63
  system "sudo #{compose_command} run --rm web rake db:setup"
64
64
  puts "Resetting up Database... Done!"
@@ -74,8 +74,9 @@ namespace :compose_db do
74
74
  end
75
75
 
76
76
  task :force_reset do
77
- puts "Running Compose Down"
77
+ puts "Force Resetting Database..."
78
78
  system "rake compose:down"
79
79
  system "rake compose_db:reset"
80
+ puts "Force Resetting Database... Done!"
80
81
  end
81
82
  end
@@ -72,34 +72,4 @@ namespace :compose_logs do
72
72
  system "sudo #{compose_command} logs -f"
73
73
  puts "Tailing All Logs... Done!"
74
74
  end
75
-
76
- task :follow_web do
77
- puts "Following Web Logs..."
78
- system "sudo #{compose_command} logs -f web"
79
- puts "Following Web Logs... Done!"
80
- end
81
-
82
- task :follow_db do
83
- puts "Following Database Logs..."
84
- system "sudo #{compose_command} logs -f db"
85
- puts "Following Database Logs... Done!"
86
- end
87
-
88
- task :follow_redis do
89
- puts "Following Redis Logs..."
90
- system "sudo #{compose_command} logs -f redis"
91
- puts "Following Redis Logs... Done!"
92
- end
93
-
94
- task :follow_sidekiq do
95
- puts "Following Sidekiq Logs..."
96
- system "sudo #{compose_command} logs -f sidekiq"
97
- puts "Following Sidekiq Logs... Done!"
98
- end
99
-
100
- task :follow_all do
101
- puts "Following All Logs..."
102
- system "sudo #{compose_command} logs -f"
103
- puts "Following All Logs... Done!"
104
- end
105
75
  end
@@ -128,6 +128,34 @@ namespace :compose_prod do
128
128
  puts '-----------------------------------------------------------------------------------'
129
129
  end
130
130
 
131
+ task :status do
132
+ puts 'Status of Compose... WARNING: you are running this in production'
133
+ # ask in terminal if you want to continue
134
+ choice = ask('Are you sure you want to continue? (y/n)')
135
+ if choice == 'y'
136
+ puts 'Status of Compose...'
137
+ system "sudo #{compose_command} -f docker-compose.prod.yml ps"
138
+ puts 'Status of Compose... Done!'
139
+ else
140
+ puts 'Status cancelled'
141
+ end
142
+ puts '-----------------------------------------------------------------------------------'
143
+ end
144
+
145
+ task :shell do
146
+ puts 'Opening shell in Compose... WARNING: you are running this in production'
147
+ # ask in terminal if you want to continue
148
+ choice = ask('Are you sure you want to continue? (y/n)')
149
+ if choice == 'y'
150
+ puts 'Opening shell in Compose...'
151
+ system "sudo #{compose_command} -f docker-compose.prod.yml exec web bash"
152
+ puts 'Opening shell in Compose... Done!'
153
+ else
154
+ puts 'Opening shell cancelled'
155
+ end
156
+ puts '-----------------------------------------------------------------------------------'
157
+ end
158
+
131
159
  task :clean_all do
132
160
  puts 'Cleaning Compose... WARNING: you are running this in production'
133
161
  # ask in terminal if you want to continue
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lucy_dockerunner
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - JesusGautamah
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-02-12 00:00:00.000000000 Z
11
+ date: 2023-02-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake-hooks
@@ -39,6 +39,7 @@ files:
39
39
  - CODE_OF_CONDUCT.md
40
40
  - Gemfile
41
41
  - Gemfile.lock
42
+ - LICENSE.md
42
43
  - LICENSE.txt
43
44
  - README.md
44
45
  - Rakefile