lib/terraspace_bundler/lockfile.rb in terraspace-bundler-0.2.0 vs lib/terraspace_bundler/lockfile.rb in terraspace-bundler-0.3.0
- old
+ new
@@ -6,15 +6,15 @@
include TB::Util::Logging
# {"vpc"=>
# {"sha"=>"52328b2b5197f9b95e3005cfcfb99595040ee45b",
# "source"=>"org/terraform-aws-vpc",
- # "url"=>"git@github.com:org/terraform-aws-vpc"},
+ # "url"=>"https://github.com/org/terraform-aws-vpc"},
# "instance"=>
# {"sha"=>"570cca3ea7b25e3af1961dc57b27ca2c129b934a",
# "source"=>"org/terraform-aws-instance",
- # "url"=>"git@github.com:org/terraform-aws-instance"}}
+ # "url"=>"https://github.com/org/terraform-aws-instance"}}
@@mods = nil
def mods
return @@mods if @@mods
lockfile = TB.config.lockfile
mods = File.exist?(lockfile) ? YAML.load_file(lockfile) : []
@@ -27,13 +27,11 @@
Mod.new(props.merge(name: name))
end
# update (if version mismatch) or create (if missing)
def sync(mod)
- changed = changed?(mod)
- logger.debug "Detecting change for mod #{mod.name} changed #{changed.inspect}"
- replace!(mod) if changed
+ replace!(mod) if changed?(mod)
end
# mod built from Terrafile
def changed?(mod)
# missing module case
@@ -43,10 +41,10 @@
return true
end
comparer = VersionComparer.new(found, mod)
comparer.run
- logger.debug(comparer.reason) if comparer.reason
+ logger.debug("REASON: #{comparer.reason}") if comparer.reason
comparer.changed?
end
def replace!(mod)
# mods are immediately fresh from writing to @@mods directly