bosh-share 0.0.1 → 0.1.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 +4 -4
- data/.gitignore +1 -0
- data/Gemfile.lock +7 -12
- data/README.md +5 -4
- data/bosh-share.gemspec +5 -5
- data/lib/bosh/cli/commands/init_workspace.rb +10 -1
- data/lib/bosh/cli/commands/install_workspace.rb +17 -12
- data/lib/bosh/share/helpers.rb +9 -1
- data/lib/bosh/share/version.rb +1 -1
- data/templates/.gitignore +4 -0
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7eb14ec7256f2e8c52baab5b3f97b012be84359a
|
4
|
+
data.tar.gz: 37612ef92da484b6ad7776ba0f4b7f8886a4f24d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ace94d4ece7e657053170d49df2904dd1833e074374836ac231f2bbe20eaffc31e8a5c348ec5152b4383dd384768c56bf35011d7a43ed3b1a6c38853fa7cd292
|
7
|
+
data.tar.gz: 84c13825f6e32be1fafca088a46bc9fae0d693676cc584f38e77306dd04941274d28c651262b6e64260f2dfe07fd1c0dc1ee3a8772ee0bbbcd3dc2dbab3217b3
|
data/.gitignore
CHANGED
data/Gemfile.lock
CHANGED
@@ -8,17 +8,6 @@ PATH
|
|
8
8
|
git (~> 1.2.6)
|
9
9
|
membrane (~> 1.1.0)
|
10
10
|
|
11
|
-
PATH
|
12
|
-
remote: ../bosh-plugin-pipeline
|
13
|
-
specs:
|
14
|
-
bosh-plugin-pipeline (0.2.1)
|
15
|
-
bosh-versions (~> 0.1.1)
|
16
|
-
bosh_cli (>= 1.3098.0)
|
17
|
-
bosh_common (>= 1.3098.0)
|
18
|
-
erubis (~> 2.7.0)
|
19
|
-
git (~> 1.2.6)
|
20
|
-
membrane (~> 1.1.0)
|
21
|
-
|
22
11
|
GEM
|
23
12
|
remote: https://rubygems.org/
|
24
13
|
specs:
|
@@ -38,6 +27,13 @@ GEM
|
|
38
27
|
fog-aws (~> 0.7.6)
|
39
28
|
httpclient (= 2.4.0)
|
40
29
|
multi_json (~> 1.1)
|
30
|
+
bosh-plugin-pipeline (0.2.1)
|
31
|
+
bosh-versions (~> 0.1.1)
|
32
|
+
bosh_cli (>= 1.3098.0)
|
33
|
+
bosh_common (>= 1.3098.0)
|
34
|
+
erubis (~> 2.7.0)
|
35
|
+
git (~> 1.2.6)
|
36
|
+
membrane (~> 1.1.0)
|
41
37
|
bosh-template (1.3100.0)
|
42
38
|
semi_semantic (~> 1.1.0)
|
43
39
|
bosh-versions (0.1.1)
|
@@ -249,7 +245,6 @@ PLATFORMS
|
|
249
245
|
ruby
|
250
246
|
|
251
247
|
DEPENDENCIES
|
252
|
-
bosh-plugin-pipeline!
|
253
248
|
bosh-share!
|
254
249
|
bundler (~> 1.10)
|
255
250
|
rake (~> 10.4.2)
|
data/README.md
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
#
|
1
|
+
# bosh-share
|
2
2
|
|
3
3
|
BOSH CLI Plugin to share workspaces and your positive experience.
|
4
4
|
|
@@ -15,12 +15,13 @@ gem install bosh-share
|
|
15
15
|
|
16
16
|
## How to use
|
17
17
|
```
|
18
|
-
bosh
|
18
|
+
bosh init workspace
|
19
19
|
```
|
20
20
|
|
21
|
-
|
21
|
+
```
|
22
|
+
bosh install workspace allomov/simple-bosh-workspace
|
23
|
+
```
|
22
24
|
|
23
|
-
See [this notes](http://guides.rubygems.org/publishing/) to know how to publish your gem.
|
24
25
|
|
25
26
|
## Contributing
|
26
27
|
|
data/bosh-share.gemspec
CHANGED
@@ -8,11 +8,11 @@ bosh_version = '1.3100.0'
|
|
8
8
|
Gem::Specification.new do |spec|
|
9
9
|
spec.name = 'bosh-share'
|
10
10
|
spec.version = Bosh::Share::VERSION
|
11
|
-
spec.authors = ['
|
12
|
-
spec.email = ['lomov
|
13
|
-
spec.description = %q{
|
14
|
-
spec.summary = %q{
|
15
|
-
spec.homepage = 'https://github.com/
|
11
|
+
spec.authors = ['Alexander Lomov']
|
12
|
+
spec.email = ['alexander.lomov@altoros.com']
|
13
|
+
spec.description = %q{BOSH CLI Plugin to share workspaces and your positive experience.}
|
14
|
+
spec.summary = %q{BOSH CLI Plugin to share workspaces and your positive experience.}
|
15
|
+
spec.homepage = 'https://github.com/Altoros/bosh-share'
|
16
16
|
|
17
17
|
spec.files = `git ls-files`.split($/)
|
18
18
|
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
@@ -16,9 +16,13 @@ module Bosh::Cli::Command
|
|
16
16
|
if workspace_name.nil?
|
17
17
|
workspace_name = 'bosh-workspace'
|
18
18
|
else
|
19
|
-
self.workspace_dir
|
19
|
+
self.workspace_dir ||= File.join(Dir.pwd, workspace_name)
|
20
20
|
end
|
21
|
+
|
22
|
+
say self.workspace_dir
|
23
|
+
|
21
24
|
FileUtils::mkdir_p(self.workspace_dir) unless File.exist?(self.workspace_dir)
|
25
|
+
|
22
26
|
Dir.chdir(self.workspace_dir) do
|
23
27
|
default_workspace_folders.each do |folder_name|
|
24
28
|
FileUtils::mkdir_p(folder_name)
|
@@ -26,17 +30,22 @@ module Bosh::Cli::Command
|
|
26
30
|
end
|
27
31
|
Git.init
|
28
32
|
end
|
33
|
+
|
29
34
|
context = {
|
30
35
|
workspace_name: workspace_name,
|
31
36
|
workspace_dir: self.workspace_dir,
|
32
37
|
description: options[:description]
|
33
38
|
}
|
39
|
+
|
34
40
|
templates_folder = File.expand_path("../../../../../templates", __FILE__)
|
35
41
|
generator = Bosh::TemplateGenerator::Generator.new(context, source_folder: templates_folder)
|
36
42
|
%w(.direnv .ruby-gemset Gemfile .gitignore .ruby-version README.md).each do |file_name|
|
37
43
|
generator.generate(file_name, File.join(self.workspace_dir, file_name))
|
38
44
|
end
|
39
45
|
|
46
|
+
say "BOSH workspace is initialized to ".make_green + self.workspace_dir
|
47
|
+
say "[NOTE] You can use WORKSPACE_DIR env variable to alter this path."
|
48
|
+
|
40
49
|
end
|
41
50
|
|
42
51
|
end
|
@@ -14,8 +14,8 @@ module Bosh::Cli::Command
|
|
14
14
|
option '--use-mine', 're-write existing files'
|
15
15
|
def install_workspace(workspace)
|
16
16
|
git_repo_regex = /((git|ssh|http(s)?)|(git@[\w\.]+))(:(\/\/)?)(([\w\.@\:\-~]+)\/?)+(\.git)(\/)?/
|
17
|
-
unless workspace.match
|
18
|
-
|
17
|
+
unless workspace.match(git_repo_regex)
|
18
|
+
unless workspace.include?('/')
|
19
19
|
say 'Workspace name should be a git URL or github repo name with folowing format `account/repo-name`'
|
20
20
|
say '[ERROR] Can\'t find git repo'.make_red
|
21
21
|
exit(2)
|
@@ -24,7 +24,7 @@ module Bosh::Cli::Command
|
|
24
24
|
end
|
25
25
|
workspace_repo_name = workspace.match(git_repo_regex)[-3]
|
26
26
|
temp_folder = Dir.mktmpdir
|
27
|
-
external_workspace_dir = File.join(
|
27
|
+
external_workspace_dir = File.join(temp_folder, workspace_repo_name)
|
28
28
|
say "Clonning workaspace from #{workspace}"
|
29
29
|
repo = Git.clone(workspace, workspace_repo_name, path: temp_folder, recursive: true)
|
30
30
|
if options[:branch] && options[:tag]
|
@@ -32,18 +32,23 @@ module Bosh::Cli::Command
|
|
32
32
|
say '[ERROR] Don\'t know what version to checkout.'.make_red
|
33
33
|
exit(2)
|
34
34
|
end
|
35
|
-
repo.checkout(branch:
|
36
|
-
repo.checkout(branch: "tags/#{option[:tag]}") if
|
35
|
+
repo.checkout(branch: options[:branch]) if options[:branch]
|
36
|
+
repo.checkout(branch: "tags/#{option[:tag]}") if options[:tag]
|
37
37
|
|
38
|
-
|
39
|
-
|
38
|
+
unless workspaces_exists?
|
39
|
+
say "Initializing bosh workspace #{workspace_repo_name}"
|
40
|
+
init_workspace(workspace_repo_name)
|
41
|
+
end
|
40
42
|
|
41
|
-
|
42
|
-
|
43
|
-
|
43
|
+
folders_to_update.each do |folder|
|
44
|
+
print "syncing folder #{folder} "
|
45
|
+
source = File.join(external_workspace_dir, folder)
|
46
|
+
target = File.join(workspace_dir, folder, options[:prefix] || options[:namespace] || '')
|
47
|
+
FileUtils.mkdir_p(target) unless File.exist?(target)
|
48
|
+
FileUtils.copy_entry(source, target)
|
49
|
+
say "done".make_green
|
50
|
+
end
|
44
51
|
|
45
|
-
def folders_to_sync(external_workspace_dir)
|
46
|
-
%w(deployments templates scripts)
|
47
52
|
end
|
48
53
|
|
49
54
|
end
|
data/lib/bosh/share/helpers.rb
CHANGED
@@ -4,13 +4,21 @@ module Bosh
|
|
4
4
|
attr_accessor :workspace_dir
|
5
5
|
|
6
6
|
def workspace_dir
|
7
|
-
@workspace_dir ||= ENV['WORKSPACE_DIR'] ||
|
7
|
+
@workspace_dir ||= ENV['WORKSPACE_DIR'] || File.join(ENV['HOME'], "workspace")
|
8
8
|
end
|
9
9
|
|
10
10
|
def default_workspace_folders
|
11
11
|
%w(deployments templates scripts stubs)
|
12
12
|
end
|
13
13
|
|
14
|
+
def folders_to_update
|
15
|
+
default_workspace_folders
|
16
|
+
end
|
17
|
+
|
18
|
+
def workspaces_exists?
|
19
|
+
File.exist?(self.workspace_dir) && default_workspace_folders.map { |f| File.exist?(f) }.all?
|
20
|
+
end
|
21
|
+
|
14
22
|
end
|
15
23
|
end
|
16
24
|
end
|
data/lib/bosh/share/version.rb
CHANGED
data/templates/.gitignore
CHANGED
metadata
CHANGED
@@ -1,10 +1,10 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bosh-share
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0
|
4
|
+
version: 0.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
|
-
-
|
7
|
+
- Alexander Lomov
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
@@ -150,9 +150,9 @@ dependencies:
|
|
150
150
|
- - "~>"
|
151
151
|
- !ruby/object:Gem::Version
|
152
152
|
version: 0.34.2
|
153
|
-
description:
|
153
|
+
description: BOSH CLI Plugin to share workspaces and your positive experience.
|
154
154
|
email:
|
155
|
-
- lomov
|
155
|
+
- alexander.lomov@altoros.com
|
156
156
|
executables: []
|
157
157
|
extensions: []
|
158
158
|
extra_rdoc_files: []
|
@@ -177,7 +177,7 @@ files:
|
|
177
177
|
- templates/.gitignore
|
178
178
|
- templates/Gemfile
|
179
179
|
- templates/README.md
|
180
|
-
homepage: https://github.com/
|
180
|
+
homepage: https://github.com/Altoros/bosh-share
|
181
181
|
licenses: []
|
182
182
|
metadata: {}
|
183
183
|
post_install_message:
|
@@ -199,7 +199,7 @@ rubyforge_project:
|
|
199
199
|
rubygems_version: 2.4.8
|
200
200
|
signing_key:
|
201
201
|
specification_version: 4
|
202
|
-
summary:
|
202
|
+
summary: BOSH CLI Plugin to share workspaces and your positive experience.
|
203
203
|
test_files:
|
204
204
|
- spec/.rspec
|
205
205
|
- spec/command_spec.rb
|