takelage 0.20.1 → 0.20.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +60 -60
- data/lib/takelage/bit/clipboard/copy.rb +2 -0
- data/lib/takelage/bit/clipboard/lib.rb +1 -1
- data/lib/takelage/bit/clipboard/paste.rb +2 -0
- data/lib/takelage/bit/clipboard/pull.rb +2 -0
- data/lib/takelage/bit/clipboard/push.rb +2 -0
- data/lib/takelage/bit/require/export.rb +2 -0
- data/lib/takelage/bit/require/import.rb +5 -1
- data/lib/takelage/lib/config.rb +27 -9
- data/lib/takelage/lib/project.rb +2 -2
- data/lib/takelage/version +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2f755a130345b2343101f6ad38a711d11b8d15413506465534737b09ddd0459f
|
4
|
+
data.tar.gz: 75fd7eb711147a14896a635751e0d544fc57e490b11546d90cb82ce1858aec43
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a8e3e1a324bfeade0a331f89de454de9909b8ad564d16849d56e5dc624dacf69d7c79c46547bee630f6fef9ad89f3275b5811203c93288dcdf5548c975e26ab7
|
7
|
+
data.tar.gz: 5f4bcd4c8f6a688f78add975c78cfcb6995b0777ab73f38beae6f4f2760b70816a39fc9af56952c43c81ba691e9336a51745fe4ddb2745cafc999d084794cb38
|
data/README.md
CHANGED
@@ -42,68 +42,68 @@ You are encouraged to read the cucumber feature files
|
|
42
42
|
for the *tau* commands
|
43
43
|
to get an idea of how the commands work.
|
44
44
|
You can list the *tau* commands by running
|
45
|
-
*tau [self list](features/
|
45
|
+
*tau [self list](features/cucumber/features/self/self.list.feature)*
|
46
46
|
or *tau list*:
|
47
47
|
|
48
48
|
Command | Description
|
49
49
|
------- | -----------
|
50
|
-
tau [bit check workspace](features/
|
51
|
-
tau [bit clipboard copy](features/
|
52
|
-
tau [bit clipboard paste](features/
|
53
|
-
tau [bit clipboard pull](features/
|
54
|
-
tau [bit clipboard push](features/
|
55
|
-
tau [bit require export](features/
|
56
|
-
tau [bit require import](features/
|
57
|
-
tau [bit scope add](features/
|
58
|
-
tau [bit scope inbit](features/
|
59
|
-
tau [bit scope list](features/
|
60
|
-
tau [bit scope new](features/
|
61
|
-
tau [completion bash](features/
|
62
|
-
tau [docker check running](features/
|
63
|
-
tau [docker container check existing](features/
|
64
|
-
tau [docker container check network](features/
|
65
|
-
tau [docker container check orphaned](features/
|
66
|
-
tau [docker container command](features/
|
67
|
-
tau [docker container daemon](features/
|
68
|
-
tau [docker container login](features/
|
69
|
-
tau [docker container clean](features/
|
70
|
-
tau [docker container prune](features/
|
71
|
-
tau [docker image check outdated](features/
|
72
|
-
tau [docker image tag check local](features/
|
73
|
-
tau [docker image tag check remote](features/
|
74
|
-
tau [docker image tag latest local](features/
|
75
|
-
tau [docker image tag latest remote](features/
|
76
|
-
tau [docker image tag list local](features/
|
77
|
-
tau [docker image tag list remote](features/
|
78
|
-
tau [docker image update](features/
|
79
|
-
tau [docker socket host](features/
|
80
|
-
tau [docker socket scheme](features/
|
81
|
-
tau [docker socket start](features/
|
82
|
-
tau [docker socket stop](features/
|
83
|
-
tau [git check clean](features/
|
84
|
-
tau [git check master](features/
|
85
|
-
tau [git check workspace](features/
|
86
|
-
tau [info project active](features/
|
87
|
-
tau [info project main](features/
|
88
|
-
tau [info project private](features/
|
89
|
-
tau [self config active](features/
|
90
|
-
tau [self config default](features/
|
91
|
-
tau [self config home](features/
|
92
|
-
tau [self config project](features/
|
93
|
-
tau [self list](features/
|
94
|
-
tau [self version](features/
|
95
|
-
tau config | Alias for tau [self config active](features/
|
96
|
-
tau copy [DIR] [SCOPE] | Alias for tau [bit clipboard copy](features/
|
97
|
-
tau list | Alias for tau [self list](features/
|
98
|
-
tau login | Alias for tau [docker container login](features/
|
99
|
-
tau clean | Alias for tau [docker container clean](features/
|
100
|
-
tau paste [COMPONENT] [DIR] | Alias for tau [bit clipboard paste](features/
|
101
|
-
tau project | Alias for tau [info project active](features/
|
102
|
-
tau pull | Alias for tau [bit clipboard pull](features/
|
103
|
-
tau prune | Alias for tau [docker container prune](features/
|
104
|
-
tau push | Alias for tau [bit clipboard push](features/
|
105
|
-
tau update | Alias for tau [docker image update](features/
|
106
|
-
tau version | Alias for tau [self version](features/
|
50
|
+
tau [bit check workspace](features/cucumber/features/bit/bit.check.workspace.feature) | Check if a bit workspace exists
|
51
|
+
tau [bit clipboard copy](features/cucumber/features/bit/bit.clipboard.copy.feature) [DIR] [SCOPE] | Copy new [DIR] to [SCOPE]
|
52
|
+
tau [bit clipboard paste](features/cucumber/features/bit/bit.clipboard.paste.feature) [COMPONENT] [DIR] | Paste bit [COMPONENT] into [DIR]
|
53
|
+
tau [bit clipboard pull](features/cucumber/features/bit/bit.clipboard.pull.feature) | Pull all updates for bit components from bit remote scopes
|
54
|
+
tau [bit clipboard push](features/cucumber/features/bit/bit.clipboard.push.feature) | Push all updates of bit components to bit remote scopes
|
55
|
+
tau [bit require export](features/cucumber/features/bit/bit.require.export.feature) | Show requirements file of bit components
|
56
|
+
tau [bit require import](features/cucumber/features/bit/bit.require.import.feature) | Import bit components from requirements file
|
57
|
+
tau [bit scope add](features/cucumber/features/bit/bit.scope.add.feature) [SCOPE] | Add a bit [SCOPE]
|
58
|
+
tau [bit scope inbit](features/cucumber/features/bit/bit.scope.inbit.feature) | Log in to bit remote server
|
59
|
+
tau [bit scope list](features/cucumber/features/bit/bit.scope.list.feature) | List bit remote scopes
|
60
|
+
tau [bit scope new](features/cucumber/features/bit/bit.scope.new.feature) [SCOPE] | Init a new bit [SCOPE]
|
61
|
+
tau [completion bash](features/cucumber/features/completion/completion.bash.feature) | Print bash completion code
|
62
|
+
tau [docker check running](features/cucumber/features/docker/docker.check.running.feature) | Check if docker daemon is running
|
63
|
+
tau [docker container check existing](features/cucumber/features/docker/docker.container.check.existing.feature) [CONTAINER] | Check if docker [CONTAINER] is existing
|
64
|
+
tau [docker container check network](features/cucumber/features/docker/docker.container.check.network.feature) [NETWORK] | Check if docker [NETWORK] is existing
|
65
|
+
tau [docker container check orphaned](features/cucumber/features/docker/docker.container.check.orphaned.feature) [CONTAINER] | Check if docker [CONTAINER] is orphaned
|
66
|
+
tau [docker container command](features/cucumber/features/docker/docker.container.command.feature) [CMD] | Run [CMD] in a docker container
|
67
|
+
tau [docker container daemon](features/cucumber/features/docker/docker.container.daemon.feature) | Run docker container in daemon mode
|
68
|
+
tau [docker container login](features/cucumber/features/docker/docker.container.login.feature) | Log in to latest local docker container
|
69
|
+
tau [docker container clean](features/cucumber/features/docker/docker.container.clean.feature) | Remove all docker containers
|
70
|
+
tau [docker container prune](features/cucumber/features/docker/docker.container.prune.feature) | Remove orphaned docker containers
|
71
|
+
tau [docker image check outdated](features/cucumber/features/docker/docker.image.check.outdated.feature) | Check if a docker image is outdated
|
72
|
+
tau [docker image tag check local](features/cucumber/features/docker/docker.image.tag.check.local.feature) [TAG] | Check if local docker image [TAG] exists
|
73
|
+
tau [docker image tag check remote](features/cucumber/features/docker/docker.image.tag.check.remote.feature) [TAG] | Check if remote docker image [TAG] exists
|
74
|
+
tau [docker image tag latest local](features/cucumber/features/docker/docker.image.tag.latest.local.feature) | Print latest local docker image tag
|
75
|
+
tau [docker image tag latest remote](features/cucumber/features/docker/docker.image.tag.latest.remote.feature) | Print latest remote docker image tag
|
76
|
+
tau [docker image tag list local](features/cucumber/features/docker/docker.image.tag.list.local.feature) | Print local docker image tags
|
77
|
+
tau [docker image tag list remote](features/cucumber/features/docker/docker.image.tag.list.remote.feature) | Print remote docker image tags
|
78
|
+
tau [docker image update](features/cucumber/features/docker/docker.image.update.feature) | Get latest remote docker container
|
79
|
+
tau [docker socket host](features/cucumber/features/docker/docker.socket.host.feature) | Print docker socket host ip address
|
80
|
+
tau [docker socket scheme](features/cucumber/features/docker/docker.socket.scheme.feature) | Print docker socket scheme
|
81
|
+
tau [docker socket start](features/cucumber/features/docker/docker.socket.start.feature) | Start sockets for docker container
|
82
|
+
tau [docker socket stop](features/cucumber/features/docker/docker.socket.stop.feature) | Stop sockets for docker container
|
83
|
+
tau [git check clean](features/cucumber/features/git/git.check.clean.feature) | Check if the git workspace is clean
|
84
|
+
tau [git check master](features/cucumber/features/git/git.check.master.feature) | Check if we are on the git master branch
|
85
|
+
tau [git check workspace](features/cucumber/features/git/git.check.workspace.feature) | Check if a git workspace exists
|
86
|
+
tau [info project active](features/cucumber/features/info/info.project.active.feature) | Print active project info
|
87
|
+
tau [info project main](features/cucumber/features/info/info.project.main.feature) | Print main project info
|
88
|
+
tau [info project private](features/cucumber/features/info/info.project.private.feature) | Print private project info
|
89
|
+
tau [self config active](features/cucumber/features/self/self.config.active.feature) | Print active takelage configuration
|
90
|
+
tau [self config default](features/cucumber/features/self/self.config.default.feature) | Print takelage default configuration
|
91
|
+
tau [self config home](features/cucumber/features/self/self.config.home.feature) | Print takelage home config file configuration
|
92
|
+
tau [self config project](features/cucumber/features/self/self.config.project.feature) | Print takelage project config file configuration
|
93
|
+
tau [self list](features/cucumber/features/self/self.list.feature) | List all commands
|
94
|
+
tau [self version](features/cucumber/features/self/self.version.feature) | Print tau semantic version number
|
95
|
+
tau config | Alias for tau [self config active](features/cucumber/features/self/self.config.active.feature)
|
96
|
+
tau copy [DIR] [SCOPE] | Alias for tau [bit clipboard copy](features/cucumber/features/bit/bit.clipboard.copy.feature)
|
97
|
+
tau list | Alias for tau [self list](features/cucumber/features/self/self.list.feature)
|
98
|
+
tau login | Alias for tau [docker container login](features/cucumber/features/docker/docker.container.login.feature)
|
99
|
+
tau clean | Alias for tau [docker container clean](features/cucumber/features/docker/docker.container.clean.feature)
|
100
|
+
tau paste [COMPONENT] [DIR] | Alias for tau [bit clipboard paste](features/cucumber/features/bit/bit.clipboard.paste.feature)
|
101
|
+
tau project | Alias for tau [info project active](features/cucumber/features/info/info.project.active.feature)
|
102
|
+
tau pull | Alias for tau [bit clipboard pull](features/cucumber/features/bit/bit.clipboard.pull.feature)
|
103
|
+
tau prune | Alias for tau [docker container prune](features/cucumber/features/docker/docker.container.prune.feature)
|
104
|
+
tau push | Alias for tau [bit clipboard push](features/cucumber/features/bit/bit.clipboard.push.feature)
|
105
|
+
tau update | Alias for tau [docker image update](features/cucumber/features/docker/docker.image.update.feature)
|
106
|
+
tau version | Alias for tau [self version](features/cucumber/features/self/self.version.feature)
|
107
107
|
|
108
108
|
**Warning: *tau update* will call *docker image prune* and remove all dangling images!**
|
109
109
|
|
@@ -115,7 +115,7 @@ tau version | Alias for tau [self version](features/takelage/self/self.version.f
|
|
115
115
|
which have different precedences.
|
116
116
|
They are merged to an active configuration during runtime
|
117
117
|
which can be inspected with
|
118
|
-
*tau [self config active](features/
|
118
|
+
*tau [self config active](features/cucumber/features/self/self.config.active.feature)*
|
119
119
|
or *tau config*.
|
120
120
|
|
121
121
|
| Filename | Precedence | Description |
|
@@ -168,7 +168,7 @@ Furthermore, every external command can be reconfigured.
|
|
168
168
|
which have different precedences.
|
169
169
|
They are merged to an active configuration during runtime
|
170
170
|
which can be inspected with
|
171
|
-
*tau [info project active](features/
|
171
|
+
*tau [info project active](features/cucumber/features/info/info.project.active.feature)*
|
172
172
|
or *tau project*.
|
173
173
|
|
174
174
|
| Default filename | Config key | Precedence | Description |
|
@@ -51,7 +51,7 @@ module BitClipboardLib
|
|
51
51
|
def _bit_clipboard_lib_sync_workspace
|
52
52
|
log.debug 'Syncing git workspace'
|
53
53
|
|
54
|
-
|
54
|
+
path = config.active['project_root_dir']
|
55
55
|
file = "#{path}/.bitmap"
|
56
56
|
message = 'Update .bitmap'
|
57
57
|
|
@@ -6,6 +6,8 @@ module BitClipboardPaste
|
|
6
6
|
def bit_clipboard_paste(cid, dir)
|
7
7
|
log.debug "Running bit paste \"#{cid}\" to \"#{dir}\""
|
8
8
|
|
9
|
+
return false unless configured? %w[project_root_dir]
|
10
|
+
|
9
11
|
return false unless _bit_clipboard_lib_prepare_workspace
|
10
12
|
|
11
13
|
return false unless _bit_clipboard_paste_cid_exists? cid
|
@@ -6,6 +6,8 @@ module BitRequireExport
|
|
6
6
|
def bit_require_export
|
7
7
|
log.debug 'Running bit require export'
|
8
8
|
|
9
|
+
return false unless configured? %w[project_root_dir]
|
10
|
+
|
9
11
|
components = _bit_require_lib_get_components
|
10
12
|
bitrequire_yml = _bit_require_export_get_bitrequire_yml components
|
11
13
|
|
@@ -6,6 +6,8 @@ module BitRequireImport
|
|
6
6
|
def bit_require_import
|
7
7
|
log.debug 'Running bit require import'
|
8
8
|
|
9
|
+
return false unless configured? %w[project_root_dir]
|
10
|
+
|
9
11
|
return false unless _bit_clipboard_lib_prepare_workspace
|
10
12
|
|
11
13
|
return false unless _bit_require_import_check_require_file_exists
|
@@ -84,7 +86,9 @@ module BitRequireImport
|
|
84
86
|
|
85
87
|
# Paste bit components.
|
86
88
|
def _bit_require_import_paste_components(components)
|
87
|
-
|
89
|
+
path = config.active['project_root_dir']
|
90
|
+
return false if path.empty?
|
91
|
+
|
88
92
|
components.each do |component|
|
89
93
|
next if _bit_require_import_check_component_exists component, path
|
90
94
|
|
data/lib/takelage/lib/config.rb
CHANGED
@@ -21,12 +21,15 @@ module ConfigModule
|
|
21
21
|
# Initialze config
|
22
22
|
# rubocop:disable Metrics/AbcSize
|
23
23
|
def initialize_config
|
24
|
+
project_root_dir = _get_project_root_dir
|
25
|
+
|
24
26
|
log.debug "takelage version: #{Takelage::VERSION}"
|
25
27
|
log.debug "Current working directory: #{Dir.pwd}"
|
28
|
+
log.debug "Project root directory: #{project_root_dir}" unless project_root_dir.empty?
|
26
29
|
|
27
|
-
TakelageConfig.instance.default = _config_read_default
|
30
|
+
TakelageConfig.instance.default = _config_read_default project_root_dir
|
28
31
|
TakelageConfig.instance.home = _config_read_home
|
29
|
-
TakelageConfig.instance.project = _config_read_project
|
32
|
+
TakelageConfig.instance.project = _config_read_project project_root_dir
|
30
33
|
TakelageConfig.instance.active = _config_merge_active
|
31
34
|
end
|
32
35
|
# rubocop:enable Metrics/AbcSize
|
@@ -62,19 +65,25 @@ module ConfigModule
|
|
62
65
|
takel_config_key = TakelageConfig.instance.active[config_key]
|
63
66
|
return true unless takel_config_key.nil? || takel_config_key.empty?
|
64
67
|
|
65
|
-
|
68
|
+
if config_key == 'project_root_dir'
|
69
|
+
log.error 'Please create a "Rakefile" in the project root directory'
|
70
|
+
else
|
71
|
+
log.error "Unset config key. Please configure \"#{config_key}\""
|
72
|
+
end
|
66
73
|
@configured = false
|
67
74
|
false
|
68
75
|
end
|
69
76
|
|
70
77
|
# Read default config file in lib.
|
71
|
-
def _config_read_default
|
78
|
+
def _config_read_default(project_root_dir)
|
72
79
|
default_file = File.expand_path("#{File.dirname(__FILE__)}/../default.yml")
|
73
80
|
|
74
|
-
return {} unless File.exist? default_file
|
81
|
+
return { project_root_dir: project_root_dir } unless File.exist? default_file
|
75
82
|
|
76
83
|
default_yaml = read_yaml_file(default_file) || {}
|
77
84
|
|
85
|
+
default_yaml['project_root_dir'] = project_root_dir
|
86
|
+
|
78
87
|
default_yaml.sort.to_h
|
79
88
|
end
|
80
89
|
|
@@ -89,10 +98,9 @@ module ConfigModule
|
|
89
98
|
home_yaml.sort.to_h
|
90
99
|
end
|
91
100
|
|
92
|
-
# Read custom config file
|
93
|
-
def _config_read_project
|
94
|
-
|
95
|
-
project_file = "#{path}/takelage.yml"
|
101
|
+
# Read custom config file in project root.
|
102
|
+
def _config_read_project(project_root_dir)
|
103
|
+
project_file = "#{project_root_dir}/takelage.yml"
|
96
104
|
|
97
105
|
return {} unless File.exist? project_file
|
98
106
|
|
@@ -113,4 +121,14 @@ module ConfigModule
|
|
113
121
|
project_over_home = home.merge!(project)
|
114
122
|
default.merge!(project_over_home).sort.to_h
|
115
123
|
end
|
124
|
+
|
125
|
+
# Get project root directory.
|
126
|
+
# @return [String] project root directory
|
127
|
+
def _get_project_root_dir
|
128
|
+
_rakefile, path = Rake.application.find_rakefile_location
|
129
|
+
return path unless path.nil?
|
130
|
+
|
131
|
+
log.debug 'No "Rakefile" found. Cannot determine project root directory.'
|
132
|
+
''
|
133
|
+
end
|
116
134
|
end
|
data/lib/takelage/lib/project.rb
CHANGED
@@ -34,7 +34,7 @@ module ProjectModule
|
|
34
34
|
|
35
35
|
# Read main YAML file.
|
36
36
|
def _project_read_main
|
37
|
-
|
37
|
+
@path = TakelageProject.instance.config.active['project_root_dir']
|
38
38
|
main_file = "#{@path}/" \
|
39
39
|
"#{TakelageProject.instance.config.active['info_project_main']}"
|
40
40
|
|
@@ -45,7 +45,7 @@ module ProjectModule
|
|
45
45
|
|
46
46
|
# Read private YAML file.
|
47
47
|
def _project_read_private
|
48
|
-
|
48
|
+
@path = TakelageProject.instance.config.active['project_root_dir']
|
49
49
|
private_file = "#{@path}/" \
|
50
50
|
"#{TakelageProject.instance.config.active['info_project_private']}"
|
51
51
|
|
data/lib/takelage/version
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.20.
|
1
|
+
0.20.2
|