takelage 0.29.8 → 0.30.0

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: e8837b042456b6e1babf826a7b04a1a3156c77c0bae985987c4653d1edf844bb
4
- data.tar.gz: cd60992104d7730dd7688189142ef2567aa86ddcebf59aec2370e2adc0782154
3
+ metadata.gz: 2df3a519d6d5690b6dd1c9758d720bfff1ebd6afc8a3c116db5651bb223b0266
4
+ data.tar.gz: d924838d82f60a4d1bab01e151896f0875552726b8a9d8bdb0a6a672f12def91
5
5
  SHA512:
6
- metadata.gz: fb2c0d378aeb648f070c29d28697f8345e38f1fa3e973b1694d121eb2a28ffde56f7441c7d3110bd27eabc8c9bf6a11e636428ae37d266eb6eb874e1792543ae
7
- data.tar.gz: a0783056a1011839f7779debd94782479364f5a28294ca97c3b951c18023bc1c945bcfa0e8840a760d7712cebb92251bb2d47a957ab033b524e08291ce478ccd
6
+ metadata.gz: 8cceb1a7e8200a7217b4bb5b068d8c51b40e7c425921c7150c346964a1d31fbe103dcc1b2f9b90870f3388f5fbe1bb62e3a54f664d564f33b083916288920784
7
+ data.tar.gz: 40fd4ac0c4782ae56a26a76c3fbe3503252147b78e1ca66cd8ccde97f3e909acd6f084ba177ac31de6d61dc01632f828a448c91d8abb56e59b0cfc31bc3b8863
data/README.md CHANGED
@@ -26,7 +26,6 @@ command line script using the
26
26
  | *[takelage-bit](https://github.com/geospin-takelage/takelage-bit)* | [![hub.docker.com](https://img.shields.io/docker/v/takelage/bitboard/latest?label=hub.docker.com&sort=semver&color=blue)](https://hub.docker.com/r/takelage/bitboard) |
27
27
  | *[takelage-img-takelslim](https://github.com/geospin-takelage/takelage-img-takelslim)* | [![hub.docker.com](https://img.shields.io/docker/v/takelage/takelslim/latest?label=hub.docker.com&color=blue)](https://hub.docker.com/r/takelage/takelslim) |
28
28
  | *[takelage-img-takelbase](https://github.com/geospin-takelage/takelage-img-takelbase)* | [![hub.docker.com](https://img.shields.io/docker/v/takelage/takelbase/latest?label=hub.docker.com&color=blue)](https://hub.docker.com/r/takelage/takelbase) |
29
- | *[takelage-img-multipostgres](https://github.com/geospin-takelage/takelage-img-multipostgres)* | [![hub.docker.com](https://img.shields.io/docker/v/takelage/multipostgres/latest?label=hub.docker.com&color=blue)](https://hub.docker.com/r/takelage/multipostgres) |
30
29
 
31
30
  ## Framework Status
32
31
 
@@ -38,7 +37,6 @@ command line script using the
38
37
  | *[takelage-bit](https://github.com/geospin-takelage/takelage-bit)* | [![deploy project](https://img.shields.io/github/workflow/status/geospin-takelage/takelage-bit/Build,%20test%20and%20deploy%20project?label=deploy%20project)](https://github.com/geospin-takelage/takelage-bit/actions/workflows/build_test_deploy_project_on_push.yml) | [![test project](https://img.shields.io/github/workflow/status/geospin-takelage/takelage-bit/Build%20and%20test%20project?label=test%20project)](https://github.com/geospin-takelage/takelage-bit/actions/workflows/build_test_project_nightly.yml) | [![test roles](https://img.shields.io/github/workflow/status/geospin-takelage/takelage-bit/Test%20roles?label=test%20roles)](https://github.com/geospin-takelage/takelage-bit/actions/workflows/build_test_roles_nightly.yml) |
39
38
  | *[takelage-img-takelslim](https://github.com/geospin-takelage/takelage-img-takelslim)* | [![deploy project](https://img.shields.io/github/workflow/status/geospin-takelage/takelage-img-takelslim/Build%20and%20deploy%20takelslim?label=deploy%20project)](https://github.com/geospin-takelage/takelage-img-takelslim/actions/workflows/build_deploy_takelslim_nightly.yml) |
40
39
  | *[takelage-img-takelbase](https://github.com/geospin-takelage/takelage-img-takelbase)* | [![deploy project](https://img.shields.io/github/workflow/status/geospin-takelage/takelage-img-takelbase/Build%20and%20deploy%20takelbase?label=deploy%20project)](https://github.com/geospin-takelage/takelage-img-takelbase/actions/workflows/build_deploy_takelbase_nightly.yml) |
41
- | *[takelage-img-multipostgres](https://github.com/geospin-takelage/takelage-img-multipostgres)* | [![deploy project](https://img.shields.io/github/workflow/status/geospin-takelage/takelage-img-multipostgres/Build%20and%20deploy%20multipostgres?label=deploy%20project)](https://github.com/geospin-takelage/takelage-img-multipostgres/actions/workflows/build_deploy_multipostgres_nightly.yml) |
42
40
 
43
41
  ## Installation
44
42
 
@@ -73,7 +71,7 @@ tau [bit clipboard push](features/cucumber/features/bit/bit.clipboard.push.featu
73
71
  tau [bit require export](features/cucumber/features/bit/bit.require.export.feature) | Show requirements file of bit components
74
72
  tau [bit require import](features/cucumber/features/bit/bit.require.import.feature) | Import bit components from requirements file
75
73
  tau [bit scope add](features/cucumber/features/bit/bit.scope.add.feature) [SCOPE] | Add a bit [SCOPE]
76
- tau [bit scope inbit](features/cucumber/features/bit/bit.scope.inbit.feature) | Log in to bit remote server
74
+ tau [bit scope ssh](features/cucumber/features/bit/bit.scope.ssh.feature) | Log in to bit remote server
77
75
  tau [bit scope list](features/cucumber/features/bit/bit.scope.list.feature) | List bit remote scopes
78
76
  tau [bit scope new](features/cucumber/features/bit/bit.scope.new.feature) [SCOPE] | Init a new bit [SCOPE]
79
77
  tau [completion bash](features/cucumber/features/completion/completion.bash.feature) | Print bash completion code
@@ -91,7 +89,7 @@ tau [docker image tag latest](features/cucumber/features/docker/docker.image.tag
91
89
  tau [docker image tag list](features/cucumber/features/docker/docker.image.tag.list.feature) | Print local docker image tags
92
90
  tau [docker image update](features/cucumber/features/docker/docker.image.update.feature) | Get latest remote docker container
93
91
  tau [git check clean](features/cucumber/features/git/git.check.clean.feature) | Check if the git workspace is clean
94
- tau [git check main](features/cucumber/features/git/git.check.main.feature) | Check if we are on the git main branch
92
+ tau [git check bit](features/cucumber/features/git/git.check.bit.feature) | Check if we are on the git bit branch
95
93
  tau [git check workspace](features/cucumber/features/git/git.check.workspace.feature) | Check if a git workspace exists
96
94
  tau [info project active](features/cucumber/features/info/info.project.active.feature) | Print active project info
97
95
  tau [info project dir](features/cucumber/features/info/info.project.dir.feature) | Print project root directory
@@ -108,7 +106,7 @@ tau [mutagen socket check](features/cucumber/features/mutagen/mutagen.socket.che
108
106
  tau [mutagen socket create](features/cucumber/features/mutagen/mutagen.socket.create.feature) [NAME] [IN] [OUT] | Create a mutagen socket [NAME] from [IN] to [OUT] of the container
109
107
  tau [mutagen socket list](features/cucumber/features/mutagen/mutagen.socket.list.feature) | List mutagen sockets
110
108
  tau [mutagen socket tidy](features/cucumber/features/mutagen/mutagen.socket.tidy.feature) | Remove mutagen daemon files
111
- tau [mutagen socket terminate](features/cucumber/features/mutagen/mutagen.socket.terminate.feature) | Terminate a mutagen socket
109
+ tau [mutagen socket terminate](features/cucumber/features/mutagen/mutagen.socket.terminate.feature) [SOCKET] | Terminate a mutagen [SOCKET]
112
110
  tau [self config active](features/cucumber/features/self/self.config.active.feature) | Print active takelage configuration
113
111
  tau [self config default](features/cucumber/features/self/self.config.default.feature) | Print takelage default configuration
114
112
  tau [self config home](features/cucumber/features/self/self.config.home.feature) | Print takelage home config file configuration
data/lib/takelage.rb CHANGED
@@ -21,14 +21,14 @@ require_relative 'takelage/lib/config'
21
21
  require_relative 'takelage/lib/project'
22
22
 
23
23
  require_relative 'takelage/git/check/clean'
24
- require_relative 'takelage/git/check/main'
24
+ require_relative 'takelage/git/check/bit'
25
25
  require_relative 'takelage/git/check/workspace'
26
26
  require_relative 'takelage/git/check/cli'
27
27
  require_relative 'takelage/git/cli'
28
28
  require_relative 'takelage/bit/check/workspace'
29
29
  require_relative 'takelage/bit/check/cli'
30
30
  require_relative 'takelage/bit/scope/add'
31
- require_relative 'takelage/bit/scope/inbit'
31
+ require_relative 'takelage/bit/scope/ssh'
32
32
  require_relative 'takelage/bit/scope/list'
33
33
  require_relative 'takelage/bit/scope/new'
34
34
  require_relative 'takelage/bit/scope/cli'
@@ -7,7 +7,7 @@ module Takelage
7
7
  include ConfigModule
8
8
  include SystemModule
9
9
  include GitCheckClean
10
- include GitCheckMain
10
+ include GitCheckBit
11
11
  include GitCheckWorkspace
12
12
  include BitCheckWorkspace
13
13
  include BitClipboardLib
@@ -26,7 +26,7 @@ module BitClipboardLib
26
26
 
27
27
  # Prepare git workspace for bit clipboard.
28
28
  def _bit_clipboard_lib_prepare_git_workspace
29
- unless git_check_main
29
+ unless git_check_bit
30
30
  log.error 'Not on git main branch'
31
31
  return false
32
32
  end
@@ -97,7 +97,7 @@ module BitClipboardLib
97
97
 
98
98
  cmd_bit_clipboard_git_push = format(
99
99
  config.active['cmd_bit_clipboard_git_push'],
100
- main: config.active['git_main_branch']
100
+ main: config.active['git_bit_branch']
101
101
  )
102
102
 
103
103
  run cmd_bit_clipboard_git_push
@@ -108,7 +108,7 @@ module BitClipboardLib
108
108
  log.debug 'Updating git workspace'
109
109
  cmd_bit_clipboard_git_pull = format(
110
110
  config.active['cmd_bit_clipboard_git_pull'],
111
- main: config.active['git_main_branch']
111
+ main: config.active['git_bit_branch']
112
112
  )
113
113
 
114
114
  return true if try cmd_bit_clipboard_git_pull
@@ -7,7 +7,7 @@ module Takelage
7
7
  include ConfigModule
8
8
  include SystemModule
9
9
  include GitCheckClean
10
- include GitCheckMain
10
+ include GitCheckBit
11
11
  include GitCheckWorkspace
12
12
  include BitCheckWorkspace
13
13
  include BitScopeList
@@ -28,7 +28,7 @@ module BitScopeAdd
28
28
 
29
29
  return true unless git_check_workspace
30
30
 
31
- return true if git_check_main
31
+ return true if git_check_bit
32
32
 
33
33
  log.error 'Not on git main branch'
34
34
  false
@@ -6,11 +6,11 @@ module Takelage
6
6
  include LoggingModule
7
7
  include SystemModule
8
8
  include ConfigModule
9
- include GitCheckMain
9
+ include GitCheckBit
10
10
  include GitCheckWorkspace
11
11
  include BitCheckWorkspace
12
12
  include BitScopeAdd
13
- include BitScopeInbit
13
+ include BitScopeSSH
14
14
  include BitScopeList
15
15
  include BitScopeNew
16
16
 
@@ -60,15 +60,15 @@ module Takelage
60
60
  end
61
61
 
62
62
  #
63
- # bit scope inbit
63
+ # bit scope ssh
64
64
  #
65
- desc 'inbit', 'Log in to bit remote server'
65
+ desc 'ssh', 'Log in to bit remote server'
66
66
  long_desc <<-LONGDESC.gsub("\n", "\x5")
67
67
  Log in to bit remote server
68
68
  LONGDESC
69
69
  # Log in to bit remote server.
70
- def inbit
71
- exit bit_scope_inbit
70
+ def ssh
71
+ exit bit_scope_ssh
72
72
  end
73
73
  end
74
74
  end
@@ -1,9 +1,9 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- # takelage bit scope inbit
4
- module BitScopeInbit
5
- # Backend method for bit scope inbit.
6
- def bit_scope_inbit
3
+ # takelage bit scope ssh
4
+ module BitScopeSSH
5
+ # Backend method for bit scope ssh.
6
+ def bit_scope_ssh
7
7
  log.debug 'Logging in to bit remote server'
8
8
 
9
9
  return false unless configured? %w[bit_ssh]
@@ -48,7 +48,7 @@ cmd_docker_image_update_docker_remove_dangling: 'docker image prune --force'
48
48
  cmd_git_check_clean_git_unstaged: 'git diff --exit-code'
49
49
  cmd_git_check_clean_git_uncommitted: 'git diff --cached --exit-code'
50
50
  cmd_git_check_clean_git_status: 'git status --porcelain'
51
- cmd_git_check_main_git_branch: 'git symbolic-ref HEAD'
51
+ cmd_git_check_bit_get_git_branch: 'git symbolic-ref HEAD'
52
52
  cmd_git_check_workspace_git_repo: 'git -C %{dir} rev-parse'
53
53
  cmd_git_check_workspace_pwd: 'pwd'
54
54
  cmd_info_status_lib_git_name: 'git -C %{root} config user.name'
@@ -76,11 +76,11 @@ docker_run_options: '--env GOOGLE_APPLICATION_CREDENTIALS=/hostdir/.google/defau
76
76
  docker_shm_size: '512M'
77
77
  docker_tag: 'latest'
78
78
  docker_user: 'takelage'
79
- git_main_branch: 'main'
79
+ git_bit_branch: 'main'
80
80
  info_project_main: 'project.yml'
81
81
  info_project_private: 'private/project.yml'
82
- login_wait_for_sockets: '1'
82
+ login_wait_for_sockets: '0'
83
83
  mutagen_socket_path_mutagen: '~/.mutagen/daemon/daemon.sock'
84
84
  mutagen_socket_path_gpg: '~/.gnupg/S.gpg-agent'
85
85
  mutagen_socket_path_ssh: '~/.gnupg/S.gpg-agent.ssh'
86
- mutagen_socket_takelage_label: 'type=takelage-socket'
86
+ mutagen_socket_takelage_label: 'type=takelage'
@@ -8,9 +8,13 @@ module DockerContainerCommand
8
8
 
9
9
  return false unless docker_check_daemon
10
10
 
11
- return false unless _docker_container_lib_create_net_and_ctr @hostname
11
+ # no matrjoschka test here
12
12
 
13
- _docker_container_lib_start_sockets
13
+ unless docker_container_check_existing @hostname
14
+ return false unless _docker_container_lib_create_net_and_ctr @hostname
15
+
16
+ _docker_container_lib_start_sockets
17
+ end
14
18
 
15
19
  _docker_container_command_run_command @hostname, command
16
20
  end
@@ -25,17 +25,12 @@ module DockerContainerLib
25
25
 
26
26
  # Create docker container and network.
27
27
  def _docker_container_lib_create_net_and_ctr(name)
28
- if _docker_container_lib_check_matrjoschka
29
- log.error 'You cannot log in to takelage from within takelage'
30
- return false
31
- end
28
+ return true if docker_container_check_existing name
32
29
 
33
30
  unless docker_container_check_network name
34
31
  _docker_container_lib_create_network name
35
32
  end
36
33
 
37
- return true if docker_container_check_existing name
38
-
39
34
  _docker_container_lib_create_container name
40
35
  end
41
36
 
@@ -121,12 +116,12 @@ module DockerContainerLib
121
116
  def _docker_container_lib_check_matrjoschka
122
117
  log.debug 'Checking if we are already inside a takelage container'
123
118
 
124
- return false unless ENV.keys.include? 'TAKELAGE_PROJECT_BASE_DIR'
125
-
126
- log.debug 'We are already inside a takelage container'
119
+ unless ENV.keys.include? 'TAKELAGE_PROJECT_BASE_DIR'
120
+ log.debug 'We are not inside a takelage container'
121
+ return false
122
+ end
127
123
 
128
- # wait or the github workflow will fail
129
- sleep 1
124
+ log.debug 'We are inside a takelage container'
130
125
 
131
126
  true
132
127
  end
@@ -8,17 +8,30 @@ module DockerContainerLogin
8
8
 
9
9
  return false unless docker_check_daemon
10
10
 
11
- return false unless _docker_container_lib_create_net_and_ctr @hostname
11
+ if _docker_container_lib_check_matrjoschka
12
+ log.error 'You cannot log in to takelage from within takelage'
13
+ return false
14
+ end
12
15
 
13
- _docker_container_lib_start_sockets
14
-
15
- _docker_container_wait_for_sockets
16
+ # rubocop:disable Style/IfUnlessModifier
17
+ unless docker_container_check_existing @hostname
18
+ _docker_container_login_create_container @hostname
19
+ end
20
+ # rubocop:enable Style/IfUnlessModifier
16
21
 
17
22
  run_and_exit _docker_container_login_enter_container @hostname
18
23
  end
19
24
 
20
25
  private
21
26
 
27
+ # Create container, network and forward sockets
28
+ def _docker_container_login_create_container(container)
29
+ return false unless _docker_container_lib_create_net_and_ctr container
30
+
31
+ _docker_container_lib_start_sockets
32
+ _docker_container_wait_for_sockets
33
+ end
34
+
22
35
  # Prepare enter existing container command.
23
36
  def _docker_container_login_enter_container(container)
24
37
  log.debug "Entering container \"#{container}\""
@@ -0,0 +1,26 @@
1
+ # frozen_string_literal: true
2
+
3
+ # takelage git check bit
4
+ module GitCheckBit
5
+ # Backend method for git check bit.
6
+ # @return [Boolean] are we on the git bit branch?
7
+ def git_check_bit
8
+ log.debug 'Check if we are on the git bit branch'
9
+
10
+ return false unless git_check_workspace
11
+
12
+ branch = _git_check_bit_get_branch
13
+ log.debug "We are on git branch \"#{branch}\""
14
+
15
+ branch == config.active['git_bit_branch']
16
+ end
17
+
18
+ private
19
+
20
+ # Get git branch.
21
+ def _git_check_bit_get_branch
22
+ cmd_get_branch =
23
+ config.active['cmd_git_check_bit_get_git_branch']
24
+ (run cmd_get_branch).chomp.split('/')[-1]
25
+ end
26
+ end
@@ -7,31 +7,31 @@ module Takelage
7
7
  include SystemModule
8
8
  include ConfigModule
9
9
  include GitCheckClean
10
- include GitCheckMain
10
+ include GitCheckBit
11
11
  include GitCheckWorkspace
12
12
 
13
13
  #
14
- # git check clean
14
+ # git check bit
15
15
  #
16
- desc 'clean', 'Check if the git workspace is clean'
16
+ desc 'bit', 'Check if we are on the git bit branch'
17
17
  long_desc <<-LONGDESC.gsub("\n", "\x5")
18
- Check if the git workspace is clean
18
+ Check if we are on the git bit branch
19
19
  LONGDESC
20
- # Check if the git workspace is clean.
21
- def clean
22
- exit git_check_clean
20
+ # Check if we are on the git bit branch.
21
+ def bit
22
+ exit git_check_bit
23
23
  end
24
24
 
25
25
  #
26
- # git check main
26
+ # git check clean
27
27
  #
28
- desc 'main', 'Check if we are on the git main branch'
28
+ desc 'clean', 'Check if the git workspace is clean'
29
29
  long_desc <<-LONGDESC.gsub("\n", "\x5")
30
- Check if we are on the git main branch
30
+ Check if the git workspace is clean
31
31
  LONGDESC
32
- # Check if we are on the git main branch.
33
- def main
34
- exit git_check_main
32
+ # Check if the git workspace is clean.
33
+ def clean
34
+ exit git_check_clean
35
35
  end
36
36
 
37
37
  #
@@ -79,11 +79,11 @@ module Takelage
79
79
  #
80
80
  # mutagen socket terminate
81
81
  #
82
- desc 'terminate', 'Terminate a mutagen socket'
82
+ desc 'terminate [SOCKET]', 'Terminate a mutagen [SOCKET]'
83
83
  long_desc <<-LONGDESC.gsub("\n", "\x5")
84
- Terminate a mutagen socket
84
+ Terminate a mutagen [SOCKET]
85
85
  LONGDESC
86
- # Terminate a mutagen socket.
86
+ # Terminate a mutagen [SOCKET].
87
87
  def terminate(socket)
88
88
  exit mutagen_socket_terminate socket
89
89
  end
data/lib/takelage/version CHANGED
@@ -1 +1 @@
1
- 0.29.8
1
+ 0.30.0
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.29.8
4
+ version: 0.30.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Geospin
@@ -220,9 +220,9 @@ files:
220
220
  - lib/takelage/bit/require/lib.rb
221
221
  - lib/takelage/bit/scope/add.rb
222
222
  - lib/takelage/bit/scope/cli.rb
223
- - lib/takelage/bit/scope/inbit.rb
224
223
  - lib/takelage/bit/scope/list.rb
225
224
  - lib/takelage/bit/scope/new.rb
225
+ - lib/takelage/bit/scope/ssh.rb
226
226
  - lib/takelage/completion/cli.rb
227
227
  - lib/takelage/default.yml
228
228
  - lib/takelage/docker/check/cli.rb
@@ -245,9 +245,9 @@ files:
245
245
  - lib/takelage/docker/image/tag/latest.rb
246
246
  - lib/takelage/docker/image/tag/list.rb
247
247
  - lib/takelage/docker/image/update.rb
248
+ - lib/takelage/git/check/bit.rb
248
249
  - lib/takelage/git/check/clean.rb
249
250
  - lib/takelage/git/check/cli.rb
250
- - lib/takelage/git/check/main.rb
251
251
  - lib/takelage/git/check/workspace.rb
252
252
  - lib/takelage/git/cli.rb
253
253
  - lib/takelage/info/cli.rb
@@ -1,26 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- # takelage git check main
4
- module GitCheckMain
5
- # Backend method for git check main.
6
- # @return [Boolean] are we on the git main branch?
7
- def git_check_main
8
- log.debug 'Check if we are on the git main branch'
9
-
10
- return false unless git_check_workspace
11
-
12
- branch = _git_check_main_get_branch
13
- log.debug "We are on git branch \"#{branch}\""
14
-
15
- branch == config.active['git_main_branch']
16
- end
17
-
18
- private
19
-
20
- # Get git branch.
21
- def _git_check_main_get_branch
22
- cmd_get_branch =
23
- config.active['cmd_git_check_main_git_branch']
24
- (run cmd_get_branch).chomp.split('/')[-1]
25
- end
26
- end