takelage 0.9.1 → 0.9.2

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 0d4e9f1786e7e4c7d21e9cada3ed8f29b332aba1e9a4c9d6ad9883aad14aa643
4
- data.tar.gz: 73028ac09504b53a127cc8c02d9b7d912e1e24962513955f08fe401f2ab2931f
3
+ metadata.gz: f66a9c3c1c62c23deef953a07c15ec08e90325ea20989461836d5fe9bb3827d7
4
+ data.tar.gz: 312841983390a8fbcd11e8c51ab591d37b44bec0c745a6f83dd10fbed5dbe358
5
5
  SHA512:
6
- metadata.gz: ff27f4263162d199b3aa7f9f54ee01b8eb537e3dc6f9a260689fa499f9fdc6e700483657d5d2b72198d431a3ca454c8a4cbc07e256c354bc538fe7bb5395bf86
7
- data.tar.gz: 49dd92f06b1ad60f87f1af59ac96b6ad3fbc17005de3eaf29c748e396fd88d2232a1db4e0b7bd2e3400e6fb6fae8acba82c49b15ae15aa450a0c823f8840f386
6
+ metadata.gz: e969702e08c786cb712f9f804a16aa612760c8859faaa3e363eb354308351833369eb79bd2f58d3dac1f1f0301bb7eb9e70f9fdf658eb82289ddb448d85e315c
7
+ data.tar.gz: 71f2c1baa7255ae59a0ba15e859db9c04dcde1a33c4f9e90fe58c978f28798b663432ca5018fe17eee1d3b9d44b9f3f3e602be8ece86be6eda018a710d43bd46
@@ -6,10 +6,14 @@ module BitCheckModule
6
6
  def bit_check_workspace
7
7
  log.debug 'Check if this is a bit workspace'
8
8
 
9
- cmd_bit_repo = config.active['bit_repo']
9
+ cmd_bit_repo =
10
+ config.active['cmd_bit_check_workspace_bit_list']
11
+
10
12
  status_repo = try cmd_bit_repo
11
13
 
12
- cmd_pwd = config.active['pwd']
14
+ cmd_pwd =
15
+ config.active['cmd_bit_check_workspace_pwd']
16
+
13
17
  stdout_str_dir = run cmd_pwd
14
18
 
15
19
  dir = stdout_str_dir.strip
@@ -24,13 +24,18 @@ module BitClipboardModule
24
24
 
25
25
  log.debug "Adding the directory \"#{dir}\" as a tagged bit component"
26
26
 
27
- bit_dev = config.active['bit_dev']
27
+ bit_dev =
28
+ config.active['bit_dev_user']
28
29
 
29
30
  # check if scope is a candidate for a bit.dev remote scope
30
31
  if scope.start_with? bit_dev + '.'
31
32
 
32
33
  # check if bit.dev remote scope exists
33
- cmd_bit_list_scope = config.active['bit_list_scope'] % {scope: scope}
34
+ cmd_bit_list_scope =
35
+ config.active['cmd_bit_clipboard_copy_bit_list_scope'] % {
36
+ scope: scope
37
+ }
38
+
34
39
  status = try cmd_bit_list_scope
35
40
 
36
41
  unless status.exitstatus.zero?
@@ -41,7 +46,9 @@ module BitClipboardModule
41
46
  else
42
47
 
43
48
  # check if bit remote scope is added to local workspace
44
- cmd_bit_list_remotes = config.active['bit_list_remotes']
49
+ cmd_bit_list_remotes =
50
+ config.active['cmd_bit_clipboard_copy_bit_list_remotes']
51
+
45
52
  stdout_str = run cmd_bit_list_remotes
46
53
 
47
54
  unless /.*\s+#{scope}\s+.*/m.match? stdout_str
@@ -69,19 +76,32 @@ module BitClipboardModule
69
76
  id = _id(dir)
70
77
 
71
78
  # get bit add dir command from active config
72
- cmd_bit_add_dir = config.active['bit_add_dir'] % {id: id, dir: dir}
79
+ cmd_bit_add_dir =
80
+ config.active['cmd_bit_clipboard_copy_bit_add_dir'] % {
81
+ id: id, dir: dir
82
+ }
83
+
73
84
  run cmd_bit_add_dir
74
85
 
75
86
  # get bit tag dir command from active config
76
- cmd_bit_tag_id = config.active['bit_tag_id'] % {id: id}
87
+ cmd_bit_tag_id =
88
+ config.active['cmd_bit_clipboard_copy_bit_tag_id'] % {
89
+ id: id
90
+ }
91
+
77
92
  run cmd_bit_tag_id
93
+
78
94
  else
79
95
  log.error "The directory \"#{dir}\" does not exist"
80
96
  return false
81
97
  end
82
98
 
83
99
  # export component to bit remote scope
84
- cmd_bit_export_to_scope = config.active['bit_export_to_scope'] % {scope: scope}
100
+ cmd_bit_export_to_scope =
101
+ config.active['cmd_bit_clipboard_copy_bit_export_to_scope'] % {
102
+ scope: scope
103
+ }
104
+
85
105
  run cmd_bit_export_to_scope
86
106
 
87
107
  _remove_bit_artifacts
@@ -114,7 +134,11 @@ module BitClipboardModule
114
134
  "has contains component id \"#{cid}\""
115
135
 
116
136
  # get components in remote scope
117
- cmd_bit_list_scope = config.active['bit_list_scope'] % {scope: scope}
137
+ cmd_bit_list_scope =
138
+ config.active['cmd_bit_clipboard_paste_bit_list_scope'] % {
139
+ scope: scope
140
+ }
141
+
118
142
  bit_list_scope = run cmd_bit_list_scope
119
143
 
120
144
  unless bit_list_scope.include? '"id": "' + cid + '",'
@@ -123,7 +147,11 @@ module BitClipboardModule
123
147
  end
124
148
 
125
149
  # paste bit component into directory
126
- cmd_bit_import_cid = config.active['bit_import_cid'] % {cid: cid, dir: dir}
150
+ cmd_bit_import_cid =
151
+ config.active['cmd_bit_clipboard_paste_bit_import_cid'] % {
152
+ cid: cid, dir: dir
153
+ }
154
+
127
155
  run cmd_bit_import_cid
128
156
 
129
157
  _handle_bitignore
@@ -151,11 +179,15 @@ module BitClipboardModule
151
179
  end
152
180
 
153
181
  # import components into workspace
154
- cmd_bit_import_all = config.active['bit_import_all']
182
+ cmd_bit_import_all =
183
+ config.active['cmd_bit_clipboard_pull_bit_import_all']
184
+
155
185
  run cmd_bit_import_all
156
186
 
157
187
  # checkout components and merge them
158
- cmd_bit_checkout_all = config.active['bit_checkout_all']
188
+ cmd_bit_checkout_all =
189
+ config.active['cmd_bit_clipboard_pull_bit_checkout_all']
190
+
159
191
  run cmd_bit_checkout_all
160
192
 
161
193
  _handle_bitignore
@@ -182,11 +214,15 @@ module BitClipboardModule
182
214
  end
183
215
 
184
216
  # tag all components
185
- cmd_bit_tag_all = config.active['bit_tag_all']
217
+ cmd_bit_tag_all =
218
+ config.active['cmd_bit_clipboard_push_bit_tag_all']
219
+
186
220
  run cmd_bit_tag_all
187
221
 
188
222
  # export components
189
- cmd_bit_export_all = config.active['bit_export_all']
223
+ cmd_bit_export_all =
224
+ config.active['cmd_bit_clipboard_push_bit_export_all']
225
+
190
226
  run cmd_bit_export_all
191
227
 
192
228
  _remove_bit_artifacts
@@ -28,7 +28,8 @@ module BitScopeModule
28
28
  end
29
29
 
30
30
  # get bit remote from active config
31
- bit_remote = config.active['bit_remote']
31
+ bit_remote =
32
+ config.active['bit_remote']
32
33
 
33
34
  # prepare scope add command
34
35
  cmd_bit_scope_add = "bit remote add #{bit_remote}/#{scope}"
@@ -43,7 +44,9 @@ module BitScopeModule
43
44
 
44
45
  return false unless configured? %w(bit_ssh)
45
46
 
46
- cmd_bit_scope_login = config.active['bit_ssh']
47
+ cmd_bit_scope_login =
48
+ config.active['bit_ssh']
49
+
47
50
  run_and_exit cmd_bit_scope_login
48
51
  end
49
52
 
@@ -55,11 +58,17 @@ module BitScopeModule
55
58
  return false unless configured? %w(bit_ssh bit_remote)
56
59
 
57
60
  # get ssh command from active config
58
- cmd_bit_ssh = config.active['bit_ssh']
61
+ cmd_bit_ssh =
62
+ config.active['bit_ssh']
59
63
 
60
64
  # prepare scope list command
61
- root = config.active['bit_scope_root']
62
- cmd_bit_scope_list = config.active['bit_scope_list'] % {root: root}
65
+ root =
66
+ config.active['bit_scope_root']
67
+
68
+ cmd_bit_scope_list =
69
+ config.active['cmd_bit_scope_list_find_scopes'] % {
70
+ root: root
71
+ }
63
72
 
64
73
  # run ssh command with scope list command
65
74
  scope_list = run "#{cmd_bit_ssh} '#{cmd_bit_scope_list}'"
@@ -88,11 +97,17 @@ module BitScopeModule
88
97
  end
89
98
 
90
99
  # get ssh command from active config
91
- cmd_bit_ssh = config.active['bit_ssh']
100
+ cmd_bit_ssh =
101
+ config.active['bit_ssh']
92
102
 
93
103
  # prepare scope list command
94
- root = config.active['bit_scope_root']
95
- cmd_bit_scope_new = config.active['bit_scope_new'] % {scope: scope, root: root}
104
+ root =
105
+ config.active['bit_scope_root']
106
+
107
+ cmd_bit_scope_new =
108
+ config.active['cmd_bit_scope_new_bit_init'] % {
109
+ scope: scope, root: root
110
+ }
96
111
 
97
112
  # run ssh command with scope new command
98
113
  run "#{cmd_bit_ssh} '#{cmd_bit_scope_new}'"
@@ -1,56 +1,60 @@
1
1
  ---
2
- bit_add_dir: 'bit add --skip-update --id %{id} --main %{dir}/README.bit %{dir}'
3
- bit_checkout_all: 'bit checkout --ignore-dist --skip-update --all latest'
4
- bit_dev: 'takelage'
5
- bit_export_to_scope: 'bit export --skip-update %{scope}'
6
- bit_export_all: 'bit export --skip-update --all'
7
- bit_import_all: 'bit import --ignore-package-json --ignore-dist --skip-update'
8
- bit_import_cid: 'bit import --ignore-package-json --ignore-dist --skip-update --path %{dir} %{cid}'
9
- bit_list_remotes: 'bit remote --skip-update'
10
- bit_list_scope: 'bit list --skip-update --json %{scope}'
2
+ bit_dev_user: 'takelage'
11
3
  bit_remote: ''
12
- bit_repo: 'bit list'
13
4
  bit_scope_root: '/bit'
14
- bit_scope_list: 'find -L %{root} -name scope.json'
15
- bit_scope_new: 'mkdir -p %{root}/%{scope} && cd %{root}/%{scope} && bit init --bare'
16
- bit_scope_remove: 'rm --force --recursive %{root}/%{scope}'
17
5
  bit_ssh: ''
18
- bit_tag_id: 'bit tag --skip-update --skip-tests %{id}'
19
- bit_tag_all: 'bit tag --skip-update --skip-tests --all'
20
- docker_create: 'docker run --detach --env GEOSPIN_PROJECT_BASE_DIR=%{workdir} --env GOOGLE_APPLICATION_CREDENTIALS=/srv/google/default.json --env TAKELAGE_PROJECT_BASE_DIR=%{workdir} --env TZ=%{timezone} --hostname %{container} --name %{container} --network %{container} --privileged --rm --tty --volume %{dockersock}:/var/run/docker.sock --volume %{homedir}/.config/gcloud:/srv/gcloud --volume %{homedir}/.google:/srv/google --volume %{homedir}:/homedir --volume %{workdir}:/project %{volume_dev} --workdir /project %{image} %{entrypoint} --gid %{gid} --home %{homedir} --uid %{uid} --username %{username}'
21
- docker_create_network: 'docker network create %{network}'
6
+ cmd_bit_check_workspace_bit_list: 'bit list'
7
+ cmd_bit_check_workspace_pwd: 'pwd'
8
+ cmd_bit_clipboard_copy_bit_list_scope: 'bit list --skip-update --json %{scope}'
9
+ cmd_bit_clipboard_copy_bit_list_remotes: 'bit remote --skip-update'
10
+ cmd_bit_clipboard_copy_bit_add_dir: 'bit add --skip-update --id %{id} --main %{dir}/README.bit %{dir}'
11
+ cmd_bit_clipboard_copy_bit_tag_id: 'bit tag --skip-update --skip-tests %{id}'
12
+ cmd_bit_clipboard_copy_bit_export_to_scope: 'bit export --skip-update %{scope}'
13
+ cmd_bit_clipboard_paste_bit_list_scope: 'bit list --skip-update --json %{scope}'
14
+ cmd_bit_clipboard_paste_bit_import_cid: 'bit import --ignore-package-json --ignore-dist --skip-update --path %{dir} %{cid}'
15
+ cmd_bit_clipboard_pull_bit_import_all: 'bit import --ignore-package-json --ignore-dist --skip-update'
16
+ cmd_bit_clipboard_pull_bit_checkout_all: 'bit checkout --ignore-dist --skip-update --all latest'
17
+ cmd_bit_clipboard_push_bit_tag_all: 'bit tag --skip-update --skip-tests --all'
18
+ cmd_bit_clipboard_push_bit_export_all: 'bit export --skip-update --all'
19
+ cmd_bit_scope_list_find_scopes: 'find -L %{root} -name scope.json'
20
+ cmd_bit_scope_new_bit_init: 'mkdir -p %{root}/%{scope} && cd %{root}/%{scope} && bit init --bare'
21
+ cmd_bit_scope_remove_scope: 'rm --force --recursive %{root}/%{scope}'
22
+ cmd_docker_check_running_docker_info: 'docker info'
23
+ cmd_docker_container_check_existing_docker_ps: 'docker ps --filter name=^%{container}$ --quiet'
24
+ cmd_docker_container_check_network_docker_network: 'docker network ls --quiet --filter name=^%{network}$'
25
+ cmd_docker_container_check_orphaned_docker_exec: 'docker exec --interactive %{container} ps a'
26
+ cmd_docker_create_container_docker_run: 'docker run --detach --env GEOSPIN_PROJECT_BASE_DIR=%{workdir} --env GOOGLE_APPLICATION_CREDENTIALS=/srv/google/default.json --env TAKELAGE_DAYNIGHT=%{daynight} --env TAKELAGE_PROJECT_BASE_DIR=%{workdir} --env TZ=%{timezone} --hostname %{container} --name %{container} --network %{container} --privileged --rm --tty --volume %{dockersock}:/var/run/docker.sock --volume %{homedir}/.config/gcloud:/srv/gcloud --volume %{homedir}/.google:/srv/google --volume %{homedir}:/homedir --volume %{workdir}:/project %{volume_dev} --workdir /project %{image} %{entrypoint} --gid %{gid} --home %{homedir} --uid %{uid} --username %{username} %{entrypoint_options}'
27
+ cmd_docker_create_network_docker_network: 'docker network create %{network}'
28
+ cmd_docker_enter_container_docker_exec: 'docker exec --interactive --tty %{container} %{loginpoint} --username %{username}'
29
+ cmd_docker_get_container_name_by_id: 'docker ps --filter id=%{container} --format "{{.Names}}"'
30
+ cmd_docker_get_containers: 'docker ps --all --filter name=^%{docker_repo}_ --quiet'
31
+ cmd_docker_remove_network: 'docker network rm %{network}'
32
+ cmd_docker_run_command_in_container: 'docker exec %{container} su %{username} -c "LANG=en_US.UTF-8 %{command}"'
33
+ cmd_docker_stop_container: 'docker stop %{container}'
34
+ cmd_docker_image_tag_check_local_docker_images: 'docker images --quiet %{image}'
35
+ cmd_docker_image_tag_list_local_docker_images: 'docker images %{docker_user}\/%{docker_repo} --format "{{.Tag}}"'
36
+ cmd_docker_image_update_docker_pull_latest: 'docker pull %{docker_user}/%{docker_repo}:%{tag_latest_remote}'
37
+ cmd_docker_socket_stop_docker_socket_ps: 'sudo ps a -o pid,command'
38
+ cmd_docker_socket_stop_docker_socket_kill: 'sudo kill -SIGTERM %{pid}'
39
+ cmd_docker_get_socket_start_commands_docker_socket_start: 'sudo socat TCP-LISTEN:%{port},bind=%{host},reuseaddr,fork UNIX-CLIENT:%{path}'
40
+ cmd_docker_get_socket_paths_docker_socket_gpgconf: 'gpgconf --list-dirs'
41
+ cmd_docker_socket_start_sudo_true: 'sudo true'
42
+ cmd_git_check_clean_git_unstaged: 'git diff --exit-code'
43
+ cmd_git_check_clean_git_uncommitted: 'git diff --cached --exit-code'
44
+ cmd_git_check_clean_git_status: 'git status --porcelain'
45
+ cmd_git_check_master_git_branch: 'git symbolic-ref HEAD'
46
+ cmd_git_check_workspace_git_repo: 'git -C . rev-parse'
47
+ cmd_git_check_workspace_pwd: 'pwd'
48
+ docker_daynight: 'night'
22
49
  docker_debug: 'ansible/roles/takel-takelage/files/pyscripts'
23
- docker_enter: 'docker exec --interactive --tty %{container} %{loginpoint} --username %{username}'
24
- docker_existing: 'docker ps --filter name=^%{container}$ --quiet'
25
- docker_get: 'docker ps --all --filter name=^%{docker_repo}_ --quiet'
26
- docker_get_container_name_by_id: 'docker ps --filter id=%{container} --format "{{.Names}}"'
50
+ docker_entrypoint_options: ''
27
51
  docker_repo: 'takelage'
28
- docker_images: 'docker images --quiet %{image}'
29
- docker_info: 'docker info'
30
- docker_network: 'docker network ls --quiet --filter name=^%{network}$'
31
- docker_orphaned: 'docker exec --interactive %{container} ps a'
32
- docker_pull_latest: 'docker pull %{docker_user}/%{docker_repo}:%{tag_latest_remote}'
33
- docker_remove_network: 'docker network rm %{network}'
34
52
  docker_user: 'takelage'
35
- docker_run_command: 'docker exec %{container} su %{username} -c "LANG=en_US.UTF-8 %{command}"'
36
53
  docker_socket_agent_port: 20000
37
54
  docker_socket_agent_ssh_port: 20001
38
55
  docker_socket_agent_extra_port: 20002
39
56
  docker_socket_agent_browser_port: 20003
40
- docker_socket_ps: 'sudo ps a -o pid,command'
41
- docker_socket_gpgconf: 'gpgconf --list-dirs'
42
- docker_socket_kill: 'sudo kill -SIGTERM %{pid}'
43
- docker_socket_start: 'sudo socat TCP-LISTEN:%{port},bind=%{host},reuseaddr,fork UNIX-CLIENT:%{path}'
44
- docker_stop: 'docker stop %{container}'
45
57
  docker_tag: 'latest'
46
- docker_tags: 'docker images %{docker_user}\/%{docker_repo} --format "{{.Tag}}"'
47
58
  docker_tagsurl: 'https://hub.docker.com/v2/repositories/takelage/takelage/tags'
48
- git_branch: 'git symbolic-ref HEAD'
49
- git_repo: 'git -C . rev-parse'
50
- git_status: 'git status --porcelain'
51
- git_unstaged: 'git diff --exit-code'
52
- git_uncommitted: 'git diff --cached --exit-code'
53
59
  info_project_main: 'project.yml'
54
60
  info_project_private: 'private/project.yml'
55
- pwd: 'pwd'
56
- sudo_true: 'sudo true'
@@ -6,7 +6,8 @@ module DockerCheckModule
6
6
  def docker_check_running
7
7
  log.debug "Check if the docker daemon is running"
8
8
 
9
- cmd_docker_info = config.active['docker_info']
9
+ cmd_docker_info =
10
+ config.active['cmd_docker_check_running_docker_info']
10
11
 
11
12
  status = try cmd_docker_info
12
13
 
@@ -9,7 +9,9 @@ module DockerContainerCheckModule
9
9
  return false unless docker_check_running
10
10
 
11
11
  cmd_docker_existing =
12
- config.active['docker_existing'] % {container: container}
12
+ config.active['cmd_docker_container_check_existing_docker_ps'] % {
13
+ container: container
14
+ }
13
15
 
14
16
  stdout_str = run cmd_docker_existing
15
17
 
@@ -30,7 +32,9 @@ module DockerContainerCheckModule
30
32
  return false unless docker_check_running
31
33
 
32
34
  cmd_docker_network =
33
- config.active['docker_network'] % {network: network}
35
+ config.active['cmd_docker_container_check_network_docker_network'] % {
36
+ network: network
37
+ }
34
38
 
35
39
  stdout_str = run cmd_docker_network
36
40
 
@@ -51,7 +55,9 @@ module DockerContainerCheckModule
51
55
  return false unless docker_check_running
52
56
 
53
57
  cmd_docker_orphaned =
54
- config.active['docker_orphaned'] % {container: container}
58
+ config.active['cmd_docker_container_check_orphaned_docker_exec'] % {
59
+ container: container
60
+ }
55
61
 
56
62
  stdout_str = run cmd_docker_orphaned
57
63
 
@@ -26,6 +26,10 @@ module Takelage
26
26
  @docker_repo = config.active['docker_repo']
27
27
  @docker_tag = config.active['docker_tag']
28
28
 
29
+ @entrypoint_options = config.active['docker_entrypoint_options']
30
+
31
+ @daynight = config.active['docker_daynight']
32
+
29
33
  @dockersock = '/var/run/docker.sock'
30
34
 
31
35
  @username = ENV['USER'] ? ENV['USER'] : 'username'
@@ -114,8 +114,9 @@ module DockerContainerModule
114
114
  end
115
115
 
116
116
  cmd_docker_create =
117
- config.active['docker_create'] % {
117
+ config.active['cmd_docker_create_container_docker_run'] % {
118
118
  workdir: @workdir,
119
+ daynight: @daynight,
119
120
  timezone: @timezone,
120
121
  container: container,
121
122
  dockersock: @dockersock,
@@ -125,7 +126,8 @@ module DockerContainerModule
125
126
  entrypoint: entrypoint,
126
127
  gid: @gid,
127
128
  uid: @uid,
128
- username: @username
129
+ username: @username,
130
+ entrypoint_options: @entrypoint_options
129
131
  }
130
132
 
131
133
  run cmd_docker_create
@@ -136,7 +138,7 @@ module DockerContainerModule
136
138
  log.debug "Create network \"#{network}\""
137
139
 
138
140
  cmd_create_network =
139
- config.active['docker_create_network'] % {
141
+ config.active['cmd_docker_create_network_docker_network'] % {
140
142
  network: network
141
143
  }
142
144
 
@@ -153,7 +155,7 @@ module DockerContainerModule
153
155
  end
154
156
 
155
157
  cmd_docker_enter =
156
- config.active['docker_enter'] % {
158
+ config.active['cmd_docker_enter_container_docker_exec'] % {
157
159
  container: container,
158
160
  loginpoint: loginpoint,
159
161
  username: @username
@@ -167,7 +169,7 @@ module DockerContainerModule
167
169
  log.debug "Getting name of container \"#{container}\""
168
170
 
169
171
  cmd_get_container_name_by_id =
170
- config.active['docker_get_container_name_by_id'] % {
172
+ config.active['cmd_docker_get_container_name_by_id'] % {
171
173
  container: container
172
174
  }
173
175
 
@@ -186,7 +188,7 @@ module DockerContainerModule
186
188
  log.debug "Getting all containers of image \"#{@docker_repo}\""
187
189
 
188
190
  cmd_docker_get =
189
- config.active['docker_get'] % {
191
+ config.active['cmd_docker_get_containers'] % {
190
192
  docker_repo: @docker_repo
191
193
  }
192
194
 
@@ -201,7 +203,7 @@ module DockerContainerModule
201
203
  log.debug "Remove network \"#{network}\""
202
204
 
203
205
  cmd_remove_network =
204
- config.active['docker_remove_network'] % {
206
+ config.active['cmd_docker_remove_network'] % {
205
207
  network: network
206
208
  }
207
209
 
@@ -213,7 +215,7 @@ module DockerContainerModule
213
215
  log.debug "Running command \"#{command}\" in container \"#{container}\""
214
216
 
215
217
  cmd_docker_run_command =
216
- config.active['docker_run_command'] % {
218
+ config.active['cmd_docker_run_command_in_container'] % {
217
219
  container: container,
218
220
  username: @username,
219
221
  command: command
@@ -227,7 +229,7 @@ module DockerContainerModule
227
229
  log.debug "Stopping container \"#{container}\""
228
230
 
229
231
  cmd_docker_stop =
230
- config.active['docker_stop'] % {
232
+ config.active['cmd_docker_stop_container'] % {
231
233
  container: container
232
234
  }
233
235
 
@@ -26,7 +26,7 @@ module DockerImageModule
26
26
  log.info "Updating to docker image \"#{@docker_user}/#{@docker_repo}:#{tag_latest_remote}\""
27
27
 
28
28
  cmd_docker_pull_latest =
29
- config.active['docker_pull_latest'] % {
29
+ config.active['cmd_docker_image_update_docker_pull_latest'] % {
30
30
  docker_user: @docker_user,
31
31
  docker_repo: @docker_repo,
32
32
  tag_latest_remote: tag_latest_remote
@@ -18,7 +18,7 @@ module DockerImageTagCheckModule
18
18
  image = "#{@docker_user}/#{@docker_repo}:#{tag}"
19
19
 
20
20
  cmd_docker_images =
21
- config.active['docker_images'] % {
21
+ config.active['cmd_docker_image_tag_check_local_docker_images'] % {
22
22
  image: image
23
23
  }
24
24
 
@@ -7,7 +7,7 @@ module DockerImageTagListModule
7
7
  tags = []
8
8
 
9
9
  cmd_docker_tags =
10
- config.active['docker_tags'] % {
10
+ config.active['cmd_docker_image_tag_list_local_docker_images'] % {
11
11
  docker_user: @docker_user,
12
12
  docker_repo: @docker_repo
13
13
  }
@@ -12,7 +12,9 @@ module DockerSocketModule
12
12
  unless cmds_start_socket.empty?
13
13
  log.debug 'Request sudo so that subsequent background tasks run without delay'
14
14
 
15
- cmd_sudo_true = config.active['sudo_true']
15
+ cmd_sudo_true =
16
+ config.active['cmd_docker_socket_start_sudo_true']
17
+
16
18
  run cmd_sudo_true
17
19
  end
18
20
 
@@ -31,7 +33,9 @@ module DockerSocketModule
31
33
 
32
34
  # get process list
33
35
  # assuming format: "pid command"
34
- cmd_ps = config.active['docker_socket_ps']
36
+ cmd_ps =
37
+ config.active['cmd_docker_socket_stop_docker_socket_ps']
38
+
35
39
  stdout_str = run cmd_ps
36
40
 
37
41
  cmds_start_socket = _get_socket_start_commands sockets_up = true
@@ -50,7 +54,11 @@ module DockerSocketModule
50
54
  if command == cmd_start_socket
51
55
  log.debug "Killing PID #{pid}"
52
56
 
53
- cmd_kill = config.active['docker_socket_kill'] % {pid: pid}
57
+ cmd_kill =
58
+ config.active['cmd_docker_socket_stop_docker_socket_kill'] % {
59
+ pid: pid
60
+ }
61
+
54
62
  run cmd_kill
55
63
  end
56
64
  end
@@ -67,7 +75,8 @@ module DockerSocketModule
67
75
 
68
76
  # loop over sockets
69
77
  @sockets.each do |socket, socket_config|
70
- cmd_start_socket = config.active['docker_socket_start'] % {
78
+ cmd_start_socket =
79
+ config.active['cmd_docker_get_socket_start_commands_docker_socket_start'] % {
71
80
  host: socket_config[:host],
72
81
  port: socket_config[:port],
73
82
  path: socket_config[:path],
@@ -89,7 +98,9 @@ module DockerSocketModule
89
98
 
90
99
  # get socket paths
91
100
  def _get_socket_paths
92
- cmd_gpgconf_listdirs = config.active['docker_socket_gpgconf']
101
+ cmd_gpgconf_listdirs =
102
+ config.active['cmd_docker_get_socket_paths_docker_socket_gpgconf']
103
+
93
104
  stdout_str = run cmd_gpgconf_listdirs
94
105
 
95
106
  stdout_str.split(/\n+/).each do |gpg_path|
@@ -8,9 +8,14 @@ module GitCheckModule
8
8
 
9
9
  return false unless git_check_workspace
10
10
 
11
- cmd_git_unstaged = config.active['git_unstaged']
12
- cmd_git_uncommitted = config.active['git_uncommitted']
13
- cmd_git_status = config.active['git_status']
11
+ cmd_git_unstaged =
12
+ config.active['cmd_git_check_clean_git_unstaged']
13
+
14
+ cmd_git_uncommitted =
15
+ config.active['cmd_git_check_clean_git_uncommitted']
16
+
17
+ cmd_git_status =
18
+ config.active['cmd_git_check_clean_git_status']
14
19
 
15
20
  status_unstaged = try cmd_git_unstaged
16
21
  status_uncommitted = try cmd_git_uncommitted
@@ -31,7 +36,9 @@ module GitCheckModule
31
36
 
32
37
  return false unless git_check_workspace
33
38
 
34
- cmd_get_branch = config.active['git_branch']
39
+ cmd_get_branch =
40
+ config.active['cmd_git_check_master_git_branch']
41
+
35
42
  stdout_str = run cmd_get_branch
36
43
 
37
44
  branch = stdout_str.strip.split('/')[-1]
@@ -46,10 +53,14 @@ module GitCheckModule
46
53
  def git_check_workspace
47
54
  log.debug 'Check if this is a git workspace'
48
55
 
49
- cmd_git_repo = config.active['git_repo']
56
+ cmd_git_repo =
57
+ config.active['cmd_git_check_workspace_git_repo']
58
+
50
59
  status_repo = try cmd_git_repo
51
60
 
52
- cmd_pwd = config.active['pwd']
61
+ cmd_pwd =
62
+ config.active['cmd_git_check_workspace_pwd']
63
+
53
64
  stdout_str_dir = run cmd_pwd
54
65
 
55
66
  dir = stdout_str_dir.strip
data/lib/takelage/version CHANGED
@@ -1 +1 @@
1
- 0.9.1
1
+ 0.9.2
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: takelage
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.1
4
+ version: 0.9.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Geospin