takelage 0.29.14 → 0.31.0

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: 28c6d77ae92c40f011ba7aa9773767b57b2a0691e64dd867ee37803223ccfd51
4
- data.tar.gz: ec9f7bc983baff7c6cabc0db84edd8e37e2744b85aa52e522393ff0b9066c7bc
3
+ metadata.gz: 8e474304722d66fb300d61b9802a63887e813d4d6fa15894fc3ed8d7a325e798
4
+ data.tar.gz: 4eb757cb8eb7b441b7d3f2f700b4891201bcba0caf46ec8acaa256cde3ca8add
5
5
  SHA512:
6
- metadata.gz: 66905dbaf0c9628f197680844110986d7d5389bf995fc6de8736e30cc67d0fc4197002daee2264fb4a77e13fbab22e098c2365a7485bb5cd7fd838d665cee81d
7
- data.tar.gz: 21b3dadad5f583a9cc80778217aa2cd8bfce25b2fa6e100508847168fe68c2572d8211e33ca74fab8a767167bb7aa8cfd519c87b8d7839f16a79b3dd5fff2b8c
6
+ metadata.gz: f110bf58872049c6900262fa5eb28a7f58516845fc887917b605fe1eac90098f88073ba39a37e53bbed9e6cd5cdd88f1500afa8b6a5e5dbf4c9e09bc4b2b158c
7
+ data.tar.gz: 0fc82eb52b09b927079b470673b9adde8f4a28d5b8e4126f7ab7ed21dac548999bb993ffcf2d31e55bab2a97978a02f28619f9c11acab807461c9a9956854186
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
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]
@@ -29,6 +29,7 @@ cmd_bit_scope_add_scope: 'bit remote add %{remote}/%{scope}'
29
29
  cmd_bit_scope_list_find_scopes: 'find -L %{root} -name scope.json'
30
30
  cmd_bit_scope_new_bit_init: 'mkdir -p %{root}/%{scope} && cd %{root}/%{scope} && bit init --bare'
31
31
  cmd_bit_scope_remove_scope: 'rm --force --recursive %{root}/%{scope}'
32
+ cmd_docker: 'docker'
32
33
  cmd_docker_check_daemon_docker_info: 'docker info'
33
34
  cmd_docker_container_check_existing_docker_ps: 'docker ps --filter name=^%{container}$ --quiet'
34
35
  cmd_docker_container_check_network_docker_network: 'docker network ls --quiet --filter name=^%{network}$'
@@ -48,7 +49,7 @@ cmd_docker_image_update_docker_remove_dangling: 'docker image prune --force'
48
49
  cmd_git_check_clean_git_unstaged: 'git diff --exit-code'
49
50
  cmd_git_check_clean_git_uncommitted: 'git diff --cached --exit-code'
50
51
  cmd_git_check_clean_git_status: 'git status --porcelain'
51
- cmd_git_check_main_git_branch: 'git symbolic-ref HEAD'
52
+ cmd_git_check_bit_get_git_branch: 'git symbolic-ref HEAD'
52
53
  cmd_git_check_workspace_git_repo: 'git -C %{dir} rev-parse'
53
54
  cmd_git_check_workspace_pwd: 'pwd'
54
55
  cmd_info_status_lib_git_name: 'git -C %{root} config user.name'
@@ -60,6 +61,7 @@ cmd_info_status_gpg_agent: 'gpg-connect-agent /bye'
60
61
  cmd_info_status_gpg_keys: 'gpg --list-keys'
61
62
  cmd_info_status_ssh_keys: 'ssh-add -l'
62
63
  cmd_info_status_ssh_socket: 'gpgconf --list-dirs agent-ssh-socket'
64
+ cmd_mutagen: 'mutagen'
63
65
  cmd_mutagen_check_daemon_host_connection: 'mutagen forward list --label-selector="%{hostlabel}"'
64
66
  cmd_mutagen_check_daemon_version: 'mutagen version'
65
67
  cmd_mutagen_forward_socket_create: 'mutagen forward create --name=%{socketname} --label=%{hostlabel} --label=%{takellabel} docker://%{username}@%{container}:unix:%{containersock} unix:%{hostsock}'
@@ -76,7 +78,7 @@ docker_run_options: '--env GOOGLE_APPLICATION_CREDENTIALS=/hostdir/.google/defau
76
78
  docker_shm_size: '512M'
77
79
  docker_tag: 'latest'
78
80
  docker_user: 'takelage'
79
- git_main_branch: 'main'
81
+ git_bit_branch: 'main'
80
82
  info_project_main: 'project.yml'
81
83
  info_project_private: 'private/project.yml'
82
84
  login_wait_for_sockets: '0'
@@ -8,7 +8,7 @@ module DockerCheckDaemon
8
8
  def docker_check_daemon
9
9
  return true if @docker_daemon_running
10
10
 
11
- return false unless command_available? 'docker'
11
+ return false unless command_available_else_error? config.active['cmd_docker']
12
12
 
13
13
  log.debug 'Check if the docker daemon is running'
14
14
 
@@ -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
  #
@@ -32,7 +32,7 @@ module InfoStatusBar
32
32
  return unless _file_exists? takelage_version_file
33
33
 
34
34
  _file_read takelage_version_file
35
- @bar_list << "takelage: #{@content_file.chomp.green}"
35
+ @bar_list << "#{config.active['docker_repo']}: #{@content_file.chomp.green}"
36
36
  end
37
37
 
38
38
  # Add tau version info to bar
@@ -7,22 +7,26 @@ require 'yaml'
7
7
  # Interaction with the operating system
8
8
  # rubocop:disable Metrics/ModuleLength
9
9
  module SystemModule
10
- # Check if a command is available
10
+ # Check if a command is available else log error message
11
11
  # @return [Boolean] is the command available?
12
- def command_available?(command)
13
- return true if instance_variable_get("@command_available_#{command}")
14
-
15
- log.debug "Check if the command \"#{command}\" is available"
12
+ def command_available_else_error?(command)
13
+ unless _command_available? command
14
+ log.error "The command \"#{command}\" is not available"
15
+ return false
16
+ end
16
17
 
17
- status = try "which #{command}"
18
+ command_available command
19
+ end
18
20
 
19
- unless status.exitstatus.zero?
20
- log.debug "The command \"#{command}\" is not available"
21
+ # Check if a command is available else log warning message
22
+ # @return [Boolean] is the command available?
23
+ def command_available_else_warn?(command)
24
+ unless _command_available? command
25
+ log.warn "The command \"#{command}\" is not available"
21
26
  return false
22
27
  end
23
28
 
24
- log.debug "The command \"#{command}\" is available"
25
- instance_variable_set("@command_available_#{command}", true)
29
+ command_available command
26
30
  end
27
31
 
28
32
  # Convert hash to yaml.
@@ -118,6 +122,23 @@ module SystemModule
118
122
 
119
123
  private
120
124
 
125
+ # Check if command is available
126
+ def _command_available?(command)
127
+ return true if instance_variable_get("@command_available_#{command}")
128
+
129
+ log.debug "Check if the command \"#{command}\" is available"
130
+ status = try "which #{command}"
131
+ return false unless status.exitstatus.zero?
132
+
133
+ true
134
+ end
135
+
136
+ # Command is available
137
+ def command_available(command)
138
+ log.debug "The command \"#{command}\" is available"
139
+ instance_variable_set("@command_available_#{command}", true)
140
+ end
141
+
121
142
  # Check if file exists.
122
143
  def _file_exists?(file)
123
144
  unless File.exist? File.expand_path(file)
@@ -9,7 +9,7 @@ module MutagenCheckDaemon
9
9
  def mutagen_check_daemon
10
10
  return true if @mutagen_daemon_available
11
11
 
12
- return false unless command_available? 'mutagen'
12
+ return false unless command_available_else_warn? config.active['cmd_mutagen']
13
13
 
14
14
  log.debug 'Check mutagen status'
15
15
 
data/lib/takelage/version CHANGED
@@ -1 +1 @@
1
- 0.29.14
1
+ 0.31.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.14
4
+ version: 0.31.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Geospin
@@ -126,16 +126,16 @@ dependencies:
126
126
  name: bundler
127
127
  requirement: !ruby/object:Gem::Requirement
128
128
  requirements:
129
- - - "~>"
129
+ - - ">="
130
130
  - !ruby/object:Gem::Version
131
- version: '1.17'
131
+ version: 2.2.10
132
132
  type: :development
133
133
  prerelease: false
134
134
  version_requirements: !ruby/object:Gem::Requirement
135
135
  requirements:
136
- - - "~>"
136
+ - - ">="
137
137
  - !ruby/object:Gem::Version
138
- version: '1.17'
138
+ version: 2.2.10
139
139
  - !ruby/object:Gem::Dependency
140
140
  name: cucumber
141
141
  requirement: !ruby/object:Gem::Requirement
@@ -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
@@ -290,7 +290,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
290
290
  requirements:
291
291
  - - ">="
292
292
  - !ruby/object:Gem::Version
293
- version: '2.4'
293
+ version: '2.5'
294
294
  required_rubygems_version: !ruby/object:Gem::Requirement
295
295
  requirements:
296
296
  - - ">="
@@ -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