stack_car 0.3.2 → 0.3.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/stack_car/cli.rb +20 -6
- data/lib/stack_car/version.rb +1 -1
- data/templates/.env.erb +1 -1
- data/templates/Dockerfile.erb +2 -0
- data/templates/docker-compose-ci.yml.erb +1 -1
- data/templates/docker-compose-prod.yml.erb +1 -1
- data/templates/docker-compose.yml.erb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2331786a667cdd1c925669949212b88fc6b9c9a6
|
4
|
+
data.tar.gz: db83a6aa549e9f2dce0b61e9c2cbd0ffc3cc5ee7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c36afa299abfc85fdfaa533fbff3c2a787619d76e369c91b5b10284a94349fc38e8bb8c710759eedba0ffbf3fe4e93c93e3c4ed4d88c9b1b6f2f876676c4245f
|
7
|
+
data.tar.gz: 52f60ba42b4939e897e4382de82bb2dd8b083f9aa749ae1e90089ab8c836f08d8b6c8af52fe8ac971a5c87683059f7921349e6e03223eed7e144b2a8fe03ccc0
|
data/lib/stack_car/cli.rb
CHANGED
@@ -93,23 +93,37 @@ module StackCar
|
|
93
93
|
def release(environment)
|
94
94
|
timestamp = Time.now.strftime("%Y%m%d%I%M%S")
|
95
95
|
registry = "#{ENV['REGISTRY_HOST']}#{ENV['REGISTRY_URI']}"
|
96
|
-
|
97
|
-
|
96
|
+
tag = ENV["TAG"] || 'latest'
|
97
|
+
unless File.exists?("#{ENV['HOME']}/.docker/config.json") && File.readlines("#{ENV['HOME']}/.docker/config.json").grep(/#{ENV['REGISTRY_HOST']}/).size > 0
|
98
|
+
run("docker login #{ENV['REGISTRY_HOST']}")
|
99
|
+
end
|
100
|
+
run("docker tag #{registry}:#{tag} #{registry}:#{environment}-#{timestamp}")
|
98
101
|
run("docker push #{registry}:#{environment}-#{timestamp}")
|
99
|
-
run("docker tag #{registry} #{registry}:#{environment}-latest")
|
102
|
+
run("docker tag #{registry}:#{tag} #{registry}:#{environment}-latest")
|
100
103
|
run("docker push #{registry}:#{environment}-latest")
|
101
|
-
run("docker tag #{registry} #{registry}:latest")
|
104
|
+
run("docker tag #{registry}:#{tag} #{registry}:latest")
|
102
105
|
run("docker push #{registry}:latest")
|
103
106
|
end
|
104
107
|
|
105
108
|
desc "provision ENVIRONMENT", "configure the servers for docker and then deploy an image"
|
106
109
|
def provision(environment)
|
107
|
-
run("
|
110
|
+
run("ansible-playbook -i ops/hosts -l #{environment}:localhost ops/provision.yml")
|
111
|
+
end
|
112
|
+
|
113
|
+
method_option :service, default: 'web', type: :string, aliases: '-s'
|
114
|
+
desc "ssh ENVIRONMENT", "log in to a running instance - requires PRODUCTION_SSH to be set"
|
115
|
+
def ssh(environment)
|
116
|
+
target = ENV["#{environment.upcase}_SSH"]
|
117
|
+
if target
|
118
|
+
run(target)
|
119
|
+
else
|
120
|
+
say "Please set #{environment.upcase}_SSH"
|
121
|
+
end
|
108
122
|
end
|
109
123
|
|
110
124
|
desc "deploy ENVIRONMENT", "deploy an image from the registry"
|
111
125
|
def deploy(environment)
|
112
|
-
run("
|
126
|
+
run("ansible-playbook -i ops/hosts -l #{environment}:localhost ops/deploy.yml")
|
113
127
|
end
|
114
128
|
|
115
129
|
method_option :elasticsearch, default: false, type: :boolean, aliases: '-e'
|
data/lib/stack_car/version.rb
CHANGED
data/templates/.env.erb
CHANGED
data/templates/Dockerfile.erb
CHANGED
@@ -31,6 +31,7 @@ RUN bundle check || bundle install
|
|
31
31
|
RUN touch /var/log/worker.log && chmod 666 /var/log/worker.log
|
32
32
|
RUN mkdir /etc/service/worker
|
33
33
|
ADD ops/worker.sh /etc/service/worker/run
|
34
|
+
RUN chmod +x /etc/service/worker/run
|
34
35
|
<% end %>
|
35
36
|
|
36
37
|
COPY . $APP_HOME
|
@@ -38,6 +39,7 @@ RUN chown -R app $APP_HOME
|
|
38
39
|
|
39
40
|
# Asset complie and migrate if prod, otherwise just start nginx
|
40
41
|
ADD ops/nginx.sh /etc/service/nginx/run
|
42
|
+
RUN chmod +x /etc/service/nginx/run
|
41
43
|
RUN rm -f /etc/service/nginx/down
|
42
44
|
|
43
45
|
CMD ["/sbin/my_init"]
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: stack_car
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Rob Kaufman
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-09-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|