takeltau 0.34.15 → 0.35.15

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.
Files changed (89) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +8 -27
  3. data/lib/takeltau/completion/cli.rb +1 -1
  4. data/lib/takeltau/default.yml +10 -35
  5. data/lib/takeltau/docker/check/cli.rb +1 -1
  6. data/lib/takeltau/docker/check/daemon.rb +1 -1
  7. data/lib/takeltau/docker/cli.rb +1 -1
  8. data/lib/takeltau/docker/container/check/cli.rb +1 -1
  9. data/lib/takeltau/docker/container/check/existing.rb +1 -1
  10. data/lib/takeltau/docker/container/check/network.rb +1 -1
  11. data/lib/takeltau/docker/container/check/orphaned.rb +1 -1
  12. data/lib/takeltau/docker/container/clean.rb +1 -1
  13. data/lib/takeltau/docker/container/cli.rb +1 -1
  14. data/lib/takeltau/docker/container/command.rb +1 -1
  15. data/lib/takeltau/docker/container/daemon.rb +1 -1
  16. data/lib/takeltau/docker/container/lib.rb +1 -1
  17. data/lib/takeltau/docker/container/login.rb +1 -1
  18. data/lib/takeltau/docker/container/prune.rb +1 -1
  19. data/lib/takeltau/docker/image/cli.rb +1 -1
  20. data/lib/takeltau/docker/image/tag/check.rb +1 -1
  21. data/lib/takeltau/docker/image/tag/cli.rb +1 -1
  22. data/lib/takeltau/docker/image/tag/latest.rb +1 -1
  23. data/lib/takeltau/docker/image/tag/list.rb +1 -1
  24. data/lib/takeltau/docker/image/update.rb +1 -1
  25. data/lib/takeltau/git/check/clean.rb +1 -1
  26. data/lib/takeltau/git/check/cli.rb +14 -14
  27. data/lib/takeltau/git/check/hg.rb +26 -0
  28. data/lib/takeltau/git/check/workspace.rb +1 -1
  29. data/lib/takeltau/git/cli.rb +1 -1
  30. data/lib/takeltau/git/lib.rb +80 -0
  31. data/lib/takeltau/hg/cli.rb +56 -0
  32. data/lib/takeltau/hg/export.rb +18 -0
  33. data/lib/takeltau/hg/pull.rb +43 -0
  34. data/lib/takeltau/hg/push.rb +42 -0
  35. data/lib/takeltau/info/cli.rb +1 -1
  36. data/lib/takeltau/info/project/cli.rb +1 -1
  37. data/lib/takeltau/info/status/bar.rb +1 -1
  38. data/lib/takeltau/info/status/cli.rb +1 -1
  39. data/lib/takeltau/info/status/git.rb +1 -1
  40. data/lib/takeltau/info/status/gopass.rb +1 -1
  41. data/lib/takeltau/info/status/gpg.rb +1 -1
  42. data/lib/takeltau/info/status/lib.rb +1 -1
  43. data/lib/takeltau/info/status/ssh.rb +1 -1
  44. data/lib/takeltau/init/lib.rb +9 -28
  45. data/lib/takeltau/init/packer/cli.rb +4 -14
  46. data/lib/takeltau/init/packer/docker.rb +2 -5
  47. data/lib/takeltau/init/packer/templates/hgclone.tt +8 -0
  48. data/lib/takeltau/init/takelage/cli.rb +4 -14
  49. data/lib/takeltau/init/takelage/rake.rb +2 -5
  50. data/lib/takeltau/init/takelage/templates/hgclone.tt +2 -0
  51. data/lib/takeltau/lib/config.rb +2 -2
  52. data/lib/takeltau/lib/logging.rb +2 -2
  53. data/lib/takeltau/lib/project.rb +2 -2
  54. data/lib/takeltau/mutagen/check/cli.rb +1 -1
  55. data/lib/takeltau/mutagen/check/daemon.rb +1 -1
  56. data/lib/takeltau/mutagen/cli.rb +1 -1
  57. data/lib/takeltau/mutagen/socket/check.rb +1 -1
  58. data/lib/takeltau/mutagen/socket/cli.rb +1 -1
  59. data/lib/takeltau/mutagen/socket/create.rb +1 -1
  60. data/lib/takeltau/mutagen/socket/list.rb +1 -1
  61. data/lib/takeltau/mutagen/socket/terminate.rb +1 -1
  62. data/lib/takeltau/mutagen/socket/tidy.rb +1 -1
  63. data/lib/takeltau/self/cli.rb +1 -1
  64. data/lib/takeltau/self/config/cli.rb +1 -1
  65. data/lib/takeltau/self/list.rb +1 -1
  66. data/lib/takeltau/version +1 -1
  67. data/lib/takeltau.rb +37 -62
  68. metadata +9 -22
  69. data/lib/takeltau/bit/check/cli.rb +0 -23
  70. data/lib/takeltau/bit/check/workspace.rb +0 -37
  71. data/lib/takeltau/bit/cli.rb +0 -18
  72. data/lib/takeltau/bit/clipboard/cli.rb +0 -73
  73. data/lib/takeltau/bit/clipboard/copy.rb +0 -142
  74. data/lib/takeltau/bit/clipboard/lib.rb +0 -143
  75. data/lib/takeltau/bit/clipboard/paste.rb +0 -60
  76. data/lib/takeltau/bit/clipboard/pull.rb +0 -37
  77. data/lib/takeltau/bit/clipboard/push.rb +0 -37
  78. data/lib/takeltau/bit/require/cli.rb +0 -57
  79. data/lib/takeltau/bit/require/export.rb +0 -34
  80. data/lib/takeltau/bit/require/import.rb +0 -133
  81. data/lib/takeltau/bit/require/lib.rb +0 -19
  82. data/lib/takeltau/bit/scope/add.rb +0 -55
  83. data/lib/takeltau/bit/scope/cli.rb +0 -74
  84. data/lib/takeltau/bit/scope/list.rb +0 -41
  85. data/lib/takeltau/bit/scope/new.rb +0 -44
  86. data/lib/takeltau/bit/scope/ssh.rb +0 -13
  87. data/lib/takeltau/git/check/bit.rb +0 -26
  88. data/lib/takeltau/init/packer/templates/bitrequireyml.tt +0 -13
  89. data/lib/takeltau/init/takelage/templates/bitrequireyml.tt +0 -5
@@ -0,0 +1,43 @@
1
+ # frozen_string_literal: true
2
+
3
+ # tau hg pull
4
+ module HgPull
5
+ # Backend method for hg pull.
6
+ # rubocop:disable Metrics/MethodLength
7
+ def hg_pull
8
+ log.debug 'Pull hg repos'
9
+
10
+ return false unless configured? %w[project_root_dir]
11
+
12
+ unless git_check_hg
13
+ log.error 'Not on git hg branch'
14
+ return false
15
+ end
16
+
17
+ unless git_check_clean
18
+ log.error 'No clean git workspace'
19
+ return false
20
+ end
21
+
22
+ unless git_lib_pull_workspace
23
+ log.error 'Unable to pull git workspace'
24
+ return false
25
+ end
26
+
27
+ log.info _hg_pull_hg_pull_repos
28
+ true
29
+ end
30
+ # rubocop:enable Metrics/MethodLength
31
+
32
+ private
33
+
34
+ # Pull hg repos.
35
+ def _hg_pull_hg_pull_repos
36
+ cmd_hg_pull_repos = format(
37
+ config.active['cmd_hg_pull_repos'],
38
+ root: config.active['project_root_dir']
39
+ )
40
+
41
+ run cmd_hg_pull_repos
42
+ end
43
+ end
@@ -0,0 +1,42 @@
1
+ # frozen_string_literal: true
2
+
3
+ # tau hg push
4
+ module HgPush
5
+ # Backend method for hg push.
6
+ # rubocop:disable Metrics/MethodLength
7
+ def hg_push
8
+ log.debug 'Push hg repos'
9
+
10
+ return false unless configured? %w[project_root_dir]
11
+
12
+ unless git_check_hg
13
+ log.error 'Not on git hg branch'
14
+ return false
15
+ end
16
+
17
+ unless git_check_clean
18
+ log.error 'No clean git workspace'
19
+ return false
20
+ end
21
+
22
+ log.info _hg_push_hg_push_repos
23
+
24
+ return true if git_lib_push_workspace 'tau hg push'
25
+
26
+ log.error 'Unable to push git workspace'
27
+ false
28
+ end
29
+ # rubocop:enable Metrics/MethodLength
30
+
31
+ private
32
+
33
+ # Push hg repos.
34
+ def _hg_push_hg_push_repos
35
+ cmd_hg_push_repos = format(
36
+ config.active['cmd_hg_push_repos'],
37
+ root: config.active['project_root_dir']
38
+ )
39
+
40
+ run cmd_hg_push_repos
41
+ end
42
+ end
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Takeltau
4
- # takeltau info
4
+ # tau info
5
5
  class Info < SubCommandBase
6
6
  desc 'project [COMMAND]', 'Get project info'
7
7
  subcommand 'project', InfoProject
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Takeltau
4
- # takeltau info project
4
+ # tau info project
5
5
  class InfoProject < SubCommandBase
6
6
  include LoggingModule
7
7
  include SystemModule
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- # takeltau info status bar
3
+ # tau info status bar
4
4
  module InfoStatusBar
5
5
  # Backend method for info status bar.
6
6
  # @return [String] status info bar
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Takeltau
4
- # takeltau info status
4
+ # tau info status
5
5
  class InfoStatus < SubCommandBase
6
6
  include LoggingModule
7
7
  include SystemModule
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- # takeltau info status git
3
+ # tau info status git
4
4
  module InfoStatusGit
5
5
  # Backend method for info status git.
6
6
  # @return [Boolean] is the git gpg signing key available?
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- # takeltau info status gopass
3
+ # tau info status gopass
4
4
  module InfoStatusGopass
5
5
  # Backend method for info status gopass.
6
6
  # @return [Boolean] is gopass available?
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- # takeltau info status gpg
3
+ # tau info status gpg
4
4
  module InfoStatusGPG
5
5
  # Backend method for info status gpg.
6
6
  # @return [Boolean] is GPG available?
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- # takeltau info status lib
3
+ # tau info status lib
4
4
  module InfoStatusLib
5
5
  private
6
6
 
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- # takeltau info status ssh
3
+ # tau info status ssh
4
4
  module InfoStatusSSH
5
5
  # Backend method for info status ssh.
6
6
  # @return [Boolean] is ssh available?
@@ -1,36 +1,9 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- # takeltau init takelage lib
3
+ # takeltau init lib
4
4
  module InitLib
5
5
  private
6
6
 
7
- # Import bit components.
8
- def _init_lib_bit_require_import
9
- if config.active['init_bit_require_import'] == 'true'
10
- log.info 'Importing bit components'
11
- return false unless bit_require_import
12
- end
13
-
14
- true
15
- end
16
-
17
- # Check bit.
18
- def _init_lib_bit_check
19
- return false unless command_available_else_error? config.active['cmd_bit']
20
- return true unless bit_check_workspace
21
-
22
- log.error 'bit is already initialized!'
23
- false
24
- end
25
-
26
- # Init bit.
27
- def _init_lib_bit_init
28
- log.info 'Initializing bit workspace'
29
- return false unless try config.active['cmd_init_lib_bit_init']
30
-
31
- true
32
- end
33
-
34
7
  # Check git.
35
8
  def _init_lib_git_check
36
9
  return false unless command_available_else_error? config.active['cmd_git']
@@ -83,4 +56,12 @@ module InitLib
83
56
 
84
57
  true
85
58
  end
59
+
60
+ # Clone hg repos.
61
+ def _init_lib_hg_clone
62
+ log.info 'Cloning hg repos'
63
+ return false unless try config.active['cmd_init_lib_hg_clone']
64
+
65
+ true
66
+ end
86
67
  end
@@ -9,36 +9,22 @@ module Takeltau
9
9
  include ConfigModule
10
10
  include ProjectModule
11
11
  include GitCheckClean
12
- include GitCheckBit
13
12
  include GitCheckWorkspace
14
- include BitCheckWorkspace
15
- include BitClipboardLib
16
- include BitClipboardCopy
17
- include BitClipboardPaste
18
- include BitRequireLib
19
- include BitRequireImport
20
13
  include InitLib
21
14
  include InitPackerDocker
22
15
 
23
16
  argument :name
24
17
 
25
- # Initialize bit require
26
18
  # Define templates
27
19
  # rubocop:disable Metrics/MethodLength
28
20
  def initialize(args = [], local_options = {}, configuration = {})
29
21
  # initialize thor parent class
30
22
  super args, local_options, configuration
31
23
 
32
- @bit_require_file = config.active['bit_require_file']
33
-
34
24
  @ansiblelint = {
35
25
  name: 'ansible/.ansible-lint',
36
26
  template: 'templates/ansiblelint.tt'
37
27
  }
38
- @bitrequireyml = {
39
- name: 'bitrequire.yml',
40
- template: 'templates/bitrequireyml.tt'
41
- }
42
28
  @gitignore = {
43
29
  name: '.gitignore',
44
30
  template: '../templates/gitignore.tt'
@@ -47,6 +33,10 @@ module Takeltau
47
33
  name: 'ansible/group_vars/all/project.yml',
48
34
  template: 'templates/groupvarsprojectyml.tt'
49
35
  }
36
+ @hgclone = {
37
+ name: 'hgclone',
38
+ template: 'templates/hgclone.tt'
39
+ }
50
40
  @playbooksiteyml = {
51
41
  name: 'ansible/playbook-site.yml',
52
42
  template: 'templates/playbooksiteyml.tt'
@@ -16,7 +16,7 @@ module InitPackerDocker
16
16
  # reinitialize config with newly created files
17
17
  initialize_config
18
18
 
19
- return false unless _init_lib_bit_require_import
19
+ return false unless _init_lib_hg_clone
20
20
 
21
21
  return false unless exit_code
22
22
 
@@ -29,9 +29,9 @@ module InitPackerDocker
29
29
  def _init_packer_docker_files_get
30
30
  [
31
31
  @ansiblelint,
32
- @bitrequireyml,
33
32
  @gitignore,
34
33
  @groupvarsprojectyml,
34
+ @hgclone,
35
35
  @playbooksiteyml,
36
36
  @projectyml,
37
37
  @rakefile
@@ -42,8 +42,6 @@ module InitPackerDocker
42
42
  def _init_packer_docker_check_prerequisites(files)
43
43
  return false unless _init_lib_git_check
44
44
 
45
- return false unless _init_lib_bit_check
46
-
47
45
  return false unless _init_lib_files_check files
48
46
 
49
47
  true
@@ -54,7 +52,6 @@ module InitPackerDocker
54
52
  exit_code = true
55
53
 
56
54
  exit_code &&= _init_lib_git_init
57
- exit_code &&= _init_lib_bit_init
58
55
  exit_code &&= _init_lib_files_create files
59
56
  exit_code &&= _init_lib_git_add_all
60
57
  exit_code &&= _init_lib_git_commit_initial
@@ -0,0 +1,8 @@
1
+ hg clone git@github.com:takelwerk/molecule-default ansible/molecule/default
2
+ hg clone git@github.com:takelwerk/molecule-image ansible/molecule/image
3
+ hg clone git@github.com:takelwerk/takel_cleanup ansible/roles/takel_cleanup
4
+ hg clone git@github.com:takelwerk/packer-takelage-docker packer/templates/takelage/docker
5
+ hg clone git@github.com:takelwerk/rake-ansible.git rake/ansible
6
+ hg clone git@github.com:takelwerk/rake-images.git rake/images
7
+ hg clone git@github.com:takelwerk/rake-meta.git rake/meta
8
+ hg clone git@github.com:takelwerk/rake-rubylint.git rake/rubylint
@@ -9,36 +9,26 @@ module Takeltau
9
9
  include ConfigModule
10
10
  include ProjectModule
11
11
  include GitCheckClean
12
- include GitCheckBit
13
12
  include GitCheckWorkspace
14
- include BitCheckWorkspace
15
- include BitClipboardLib
16
- include BitClipboardCopy
17
- include BitClipboardPaste
18
- include BitRequireLib
19
- include BitRequireImport
20
13
  include InitLib
21
14
  include InitTakelageRake
22
15
 
23
16
  argument :name
24
17
 
25
- # Initialize bit require
26
18
  # Define templates
27
19
  # rubocop:disable Metrics/MethodLength
28
20
  def initialize(args = [], local_options = {}, configuration = {})
29
21
  # initialize thor parent class
30
22
  super args, local_options, configuration
31
23
 
32
- @bit_require_file = config.active['bit_require_file']
33
-
34
- @bitrequireyml = {
35
- name: 'bitrequire.yml',
36
- template: 'templates/bitrequireyml.tt'
37
- }
38
24
  @gitignore = {
39
25
  name: '.gitignore',
40
26
  template: '../templates/gitignore.tt'
41
27
  }
28
+ @hgclone = {
29
+ name: 'hgclone',
30
+ template: 'templates/hgclone.tt'
31
+ }
42
32
  @projectyml = {
43
33
  name: 'project.yml',
44
34
  template: 'templates/projectyml.tt'
@@ -16,7 +16,7 @@ module InitTakelageRake
16
16
  # reinitialize config with newly created files
17
17
  initialize_config
18
18
 
19
- return false unless _init_lib_bit_require_import
19
+ return false unless _init_lib_hg_clone
20
20
 
21
21
  return false unless exit_code
22
22
 
@@ -28,8 +28,8 @@ module InitTakelageRake
28
28
  # Add templates.
29
29
  def _init_takelage_rake_files_get
30
30
  [
31
- @bitrequireyml,
32
31
  @gitignore,
32
+ @hgclone,
33
33
  @projectyml,
34
34
  @rakefile
35
35
  ]
@@ -39,8 +39,6 @@ module InitTakelageRake
39
39
  def _init_takelage_rake_check_prerequisites(files)
40
40
  return false unless _init_lib_git_check
41
41
 
42
- return false unless _init_lib_bit_check
43
-
44
42
  return false unless _init_lib_files_check files
45
43
 
46
44
  true
@@ -51,7 +49,6 @@ module InitTakelageRake
51
49
  exit_code = true
52
50
 
53
51
  exit_code &&= _init_lib_git_init
54
- exit_code &&= _init_lib_bit_init
55
52
  exit_code &&= _init_lib_files_create files
56
53
  exit_code &&= _init_lib_git_add_all
57
54
  exit_code &&= _init_lib_git_commit_initial
@@ -0,0 +1,2 @@
1
+ hg clone git@github.com:takelwerk/rake-meta.git rake/meta
2
+ hg clone git@github.com:takelwerk/rake-rubylint.git rake/rubylint
@@ -1,8 +1,8 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- # takeltau config module
3
+ # tau config module
4
4
  module ConfigModule
5
- # takeltau config class.
5
+ # tau config class.
6
6
  class TakeltauConfig
7
7
  include Singleton
8
8
  include LoggingModule
@@ -1,8 +1,8 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- # takeltau logging module
3
+ # tau logging module
4
4
  module LoggingModule
5
- # takeltau logger
5
+ # tau logger
6
6
  class TakeltauLogger
7
7
  include Singleton
8
8
 
@@ -1,8 +1,8 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- # takeltau project module
3
+ # tau project module
4
4
  module ProjectModule
5
- # takeltau config class.
5
+ # tau config class.
6
6
  class TakeltauProject
7
7
  include Singleton
8
8
  include LoggingModule
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Takeltau
4
- # takeltau mutagen check
4
+ # tau mutagen check
5
5
  class MutagenCheck < SubCommandBase
6
6
  include LoggingModule
7
7
  include SystemModule
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- # takeltau info status mutagen
3
+ # tau info status mutagen
4
4
  module MutagenCheckDaemon
5
5
  # Backend method for mutagen check daemon.
6
6
  # @return [Boolean] is mutagen available?
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Takeltau
4
- # takeltau git
4
+ # tau git
5
5
  class Mutagen < SubCommandBase
6
6
  desc 'check [COMMAND]', 'Check mutagen'
7
7
  subcommand 'check', MutagenCheck
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- # takeltau mutagen socket check
3
+ # tau mutagen socket check
4
4
  module MutagenSocketCheck
5
5
  # Backend method for mutagen socket check.
6
6
  # @return [Boolean] Does a mutagen socket exist?
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Takeltau
4
- # takeltau mutagen socket
4
+ # tau mutagen socket
5
5
  class MutagenSocket < SubCommandBase
6
6
  include LoggingModule
7
7
  include SystemModule
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- # takeltau mutagen socket create
3
+ # tau mutagen socket create
4
4
  module MutagenSocketCreate
5
5
  # Backend method for mutagen socket create.
6
6
  # rubocop:disable Metrics/MethodLength
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- # takeltau mutagen socket list
3
+ # tau mutagen socket list
4
4
  module MutagenSocketList
5
5
  # Backend method for mutagen socket list.
6
6
  # @return [String] List of takelage sockets
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- # takeltau mutagen socket terminate
3
+ # tau mutagen socket terminate
4
4
  module MutagenSocketTerminate
5
5
  # Backend method for mutagen socket terminate.
6
6
  def mutagen_socket_terminate(socket)
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- # takeltau mutagen socket tidy
3
+ # tau mutagen socket tidy
4
4
  module MutagenSocketTidy
5
5
  # Backend method for mutagen socket tidy.
6
6
  def mutagen_socket_tidy
@@ -4,7 +4,7 @@ module Takeltau
4
4
  # semantic version number
5
5
  VERSION = (File.read "#{File.dirname(__FILE__)}/../version").chomp
6
6
 
7
- # takeltau self
7
+ # tau self
8
8
  class Self < SubCommandBase
9
9
  include LoggingModule
10
10
  include SelfList
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Takeltau
4
- # takeltau bit
4
+ # tau self
5
5
  class SelfConfig < SubCommandBase
6
6
  include LoggingModule
7
7
  include SystemModule
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- # takeltau self list
3
+ # tau self list
4
4
  module SelfList
5
5
  # Backend method for config self.
6
6
  def self_list
data/lib/takeltau/version CHANGED
@@ -1 +1 @@
1
- 0.34.15
1
+ 0.35.15