terraspace-bundler 0.3.2 → 0.3.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/lib/terraspace_bundler.rb +1 -0
- data/lib/terraspace_bundler/cli/bundle.rb +1 -1
- data/lib/terraspace_bundler/mod.rb +6 -9
- data/lib/terraspace_bundler/mod/props_builder.rb +14 -1
- data/lib/terraspace_bundler/syncer.rb +1 -1
- data/lib/terraspace_bundler/util/git.rb +10 -4
- data/lib/terraspace_bundler/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2837b88a7aebfc3da49d6cd0fb1b620bf83466ea375ff238cb8a854ad98218b8
|
4
|
+
data.tar.gz: d7c0637b9275fc66bc7865fe2fbf87671bb9257092c6de7b616f9238defbadbe
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f0db0f6f68bb6bca532ac9fa6c1eefbcf9620324b39be2a52ae4b915faf2e9c5f5645f72aa96398b9d1624400930351273615d6916c588e8d4b53e25fec66441
|
7
|
+
data.tar.gz: 812d72dc1cfcd4039b08487574e7e4dced650e7ede4f119e43b45968732ea9203291b5823500b8db4b541eb1fff33687f3d82a7d5a92462f58df5d98ce8c0ba4
|
data/CHANGELOG.md
CHANGED
@@ -3,6 +3,10 @@
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
4
4
|
This project *loosely tries* to adhere to [Semantic Versioning](http://semver.org/), even before v1.0.
|
5
5
|
|
6
|
+
## [0.3.3] - 2021-02-24
|
7
|
+
- [#8](https://github.com/boltops-tools/terraspace-bundler/pull/8) fix https sources
|
8
|
+
- [#9](https://github.com/boltops-tools/terraspace-bundler/pull/9) Git checkout retry with v
|
9
|
+
|
6
10
|
## [0.3.2]
|
7
11
|
- #4 only purge and export explicit mods
|
8
12
|
- are you sure prompt for purge_cache
|
data/lib/terraspace_bundler.rb
CHANGED
@@ -12,10 +12,9 @@ module TerraspaceBundler
|
|
12
12
|
@version, @ref, @tag, @branch = @props[:version], @props[:ref], @props[:tag], @props[:branch]
|
13
13
|
end
|
14
14
|
|
15
|
+
# support variety of options, prefer version
|
15
16
|
def checkout_version
|
16
|
-
|
17
|
-
v = "v#{v}" if type == "registry" && @version && !v.starts_with?("v")
|
18
|
-
v
|
17
|
+
@version || @ref || @tag || @branch
|
19
18
|
end
|
20
19
|
|
21
20
|
# use url instead of source because for registry modules, the repo name is different
|
@@ -23,8 +22,11 @@ module TerraspaceBundler
|
|
23
22
|
url_words[-1]
|
24
23
|
end
|
25
24
|
|
25
|
+
# https://github.com/tongueroo/pet - 2nd to last word
|
26
|
+
# git@github.com:tongueroo/pet - 2nd to last word without chars before :
|
26
27
|
def org
|
27
|
-
url_words[-2] # second to last word
|
28
|
+
s = url_words[-2] # second to last word
|
29
|
+
s.split(':').last # in case of git@github.com:tongueroo/pet form
|
28
30
|
end
|
29
31
|
|
30
32
|
def full_repo
|
@@ -38,11 +40,6 @@ module TerraspaceBundler
|
|
38
40
|
end
|
39
41
|
|
40
42
|
private
|
41
|
-
# support variety of options, prefer version
|
42
|
-
def detected_version
|
43
|
-
@version || @ref || @tag || @branch
|
44
|
-
end
|
45
|
-
|
46
43
|
def url_words
|
47
44
|
url.split('/')
|
48
45
|
end
|
@@ -35,7 +35,20 @@ class TerraspaceBundler::Mod
|
|
35
35
|
if registry?
|
36
36
|
registry.github_url
|
37
37
|
else
|
38
|
-
|
38
|
+
git_source_url
|
39
|
+
end
|
40
|
+
end
|
41
|
+
|
42
|
+
def git_source_url
|
43
|
+
if @source.include?('http') || @source.include?(':')
|
44
|
+
# Examples:
|
45
|
+
# mod "pet", source: "https://github.com/tongueroo/pet"
|
46
|
+
# mod "pet", source: "git@github.com:tongueroo/pet"
|
47
|
+
@source
|
48
|
+
else
|
49
|
+
# Examples:
|
50
|
+
# mod "pet", source: "tongueroo/pet"
|
51
|
+
"#{TB.config.base_clone_url}#{source}" # Note: make sure to not use @source, org may not be added
|
39
52
|
end
|
40
53
|
end
|
41
54
|
|
@@ -21,10 +21,16 @@ module TerraspaceBundler::Util
|
|
21
21
|
def git(command)
|
22
22
|
sh("git #{command}")
|
23
23
|
rescue TB::GitError => e
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
24
|
+
action, version = command.split(' ')
|
25
|
+
if action == "checkout" && version !~ /^v/
|
26
|
+
command = "checkout v#{version}"
|
27
|
+
retry
|
28
|
+
else
|
29
|
+
logger.error "ERROR: There was a git error".color(:red)
|
30
|
+
logger.error "Current dir: #{Dir.pwd}"
|
31
|
+
logger.error "The error occur when running:"
|
32
|
+
logger.error e.message
|
33
|
+
end
|
28
34
|
exit 1
|
29
35
|
end
|
30
36
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: terraspace-bundler
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tung Nguyen
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-02-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -250,7 +250,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
250
250
|
- !ruby/object:Gem::Version
|
251
251
|
version: '0'
|
252
252
|
requirements: []
|
253
|
-
rubygems_version: 3.
|
253
|
+
rubygems_version: 3.2.5
|
254
254
|
signing_key:
|
255
255
|
specification_version: 4
|
256
256
|
summary: Bundles terraform modules
|