docker-manager 0.0.8 → 0.0.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/dockermanager/commands/deploy.rb +9 -5
- data/lib/dockermanager/config.rb +6 -2
- data/lib/dockermanager/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b7e2061cbcba047b1b603894173393b04ab85415daa20c0f77a3fba92502e891
|
4
|
+
data.tar.gz: 3e2f7c11d8951931c6cf11161a285284086a24915841ab4ade89d3872eb2ad75
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a8ac19f076722b81497937c48497717a16ac56a99f5c5b4f2dc4587a9962438e54d94c194e2f5d55db7b5e75664f2717f82b3a6c44e7fa63125654c70c5a541f
|
7
|
+
data.tar.gz: 2c3e3818091f94a8605ac6e49caa37ad7ebea9955e6542b77f98644de0445529cc1a63650d3f309faef52bf693dfaada52ccb131a8843c798b8a5df99e102718
|
@@ -4,21 +4,25 @@ module DockerManager
|
|
4
4
|
def run
|
5
5
|
# to avoid scope issue
|
6
6
|
env = config.env
|
7
|
+
local_git_tmp_path = config.local_git_tmp_path
|
7
8
|
project_root_path = config.project_root_path
|
8
9
|
local_docker_path = config.local_docker_path
|
9
10
|
local_deploy_path = config.local_deploy_path
|
10
11
|
registry_login = config.registry_login
|
11
12
|
registry_password = config.registry_password
|
12
13
|
registry_server = config.registry_server
|
14
|
+
env_git_branch = config.env_git_branch
|
13
15
|
env_remote_directory = config.env_remote_directory
|
14
16
|
containers_to_restart = (config.containers_to_restart || []).join(' ')
|
15
17
|
run_locally do
|
18
|
+
execute("rm -fr #{local_git_tmp_path} && mkdir #{local_git_tmp_path}")
|
19
|
+
execute("git clone -b #{env_git_branch} #{git_repository} #{local_deploy_path}")
|
20
|
+
execute("cp #{local_deploy_path}/#{env}/.env #{local_git_tmp_path}/.env")
|
21
|
+
execute("cp #{local_docker_path}/docker-compose.server.yml #{local_git_tmp_path}")
|
16
22
|
# within doesn't work
|
17
|
-
execute("cd #{
|
18
|
-
execute("cd #{
|
19
|
-
execute("cd #{
|
20
|
-
execute("cd #{project_root_path} && docker login -u #{registry_login} -p '#{registry_password}' #{registry_server}")
|
21
|
-
execute("cd #{project_root_path} && docker-compose -f docker-compose.server.yml push")
|
23
|
+
execute("cd #{local_git_tmp_path} && TAG=#{env_git_branch} docker-compose -f docker-compose.server.yml build")
|
24
|
+
execute("cd #{local_git_tmp_path} && docker login -u #{registry_login} -p '#{registry_password}' #{registry_server}")
|
25
|
+
execute("cd #{local_git_tmp_path} && docker-compose -f docker-compose.server.yml push")
|
22
26
|
end
|
23
27
|
on config.env_host do
|
24
28
|
execute(:mkdir, "-p", "#{env_remote_directory}/data")
|
data/lib/dockermanager/config.rb
CHANGED
@@ -2,13 +2,13 @@ module DockerManager
|
|
2
2
|
class Config
|
3
3
|
KEYS = {
|
4
4
|
env: {
|
5
|
-
required: %i[host docker_user remote_directory remote_postgres_db_container local_postgres_db_container]
|
5
|
+
required: %i[host docker_user remote_directory remote_postgres_db_container local_postgres_db_container git_branch]
|
6
6
|
},
|
7
7
|
registry: {
|
8
8
|
required: %i[login password],
|
9
9
|
optional: %i[server]
|
10
10
|
},
|
11
|
-
required: [],
|
11
|
+
required: %i[git_repository],
|
12
12
|
optional: %i[containers_to_restart]
|
13
13
|
}
|
14
14
|
|
@@ -52,6 +52,10 @@ module DockerManager
|
|
52
52
|
@local_deploy_path
|
53
53
|
end
|
54
54
|
|
55
|
+
def local_git_tmp_path
|
56
|
+
@local_git_tmp_path ||= "#{local_deploy_path}/tmp"
|
57
|
+
end
|
58
|
+
|
55
59
|
KEYS.keys.each do |parent_key|
|
56
60
|
case parent_key
|
57
61
|
when :required, :optional
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: docker-manager
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Julien Biard
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-02-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: sshkit
|