don't commit if the bundle update failed
Change-Id: Icaa682e215760e311acf492ad3d50d7d552824f8 Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/325275 Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com> Reviewed-by: Jacob Burroughs <jburroughs@instructure.com> QA-Review: Cody Cutrer <cody@instructure.com> Product-Review: Cody Cutrer <cody@instructure.com>
This commit is contained in:
parent
26b2cdee1c
commit
7c6068acc9
|
@ -15,6 +15,12 @@ base_gems = Gem.loaded_specs.keys.to_set
|
|||
|
||||
require "shellwords"
|
||||
|
||||
output = `git status --porcelain --untracked=no`.strip
|
||||
unless output.empty?
|
||||
warn "git status is not clean; please commit or stash your changes first"
|
||||
exit 1
|
||||
end
|
||||
|
||||
config = YAML.safe_load_file(File.expand_path("bundle_update_config.yml", __dir__))
|
||||
ignored_gems = config["ignored_gems"].to_set
|
||||
cohort_gems = config["cohort_gems"]
|
||||
|
@ -91,6 +97,11 @@ until gems_to_update.empty?
|
|||
|
||||
system("bundle update #{gem} --quiet")
|
||||
|
||||
unless $?.success?
|
||||
system("git reset --hard HEAD > #{IO::NULL}")
|
||||
next
|
||||
end
|
||||
|
||||
output = `git status --porcelain --untracked=no`.strip
|
||||
# couldn't update; should have warned anyway
|
||||
next if output.empty?
|
||||
|
|
Loading…
Reference in New Issue