From 3a9ec7924d1a325ce04cce4ddf6c13545f1139cb Mon Sep 17 00:00:00 2001 From: Rob Kooper Date: Tue, 9 Oct 2018 13:24:27 -0500 Subject: [PATCH 1/3] create duplicate of environment variable This fixes issue #600. --- app/helpers/application_helper.rb | 2 +- hooks/build | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 8a5fdc5f2..8ce9328d1 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -127,7 +127,7 @@ def commit_is_tagged? end def commit_tags - e = ENV['BETY_GIT_TAGS'] + e = ENV['BETY_GIT_TAGS'].dup ref_names = e.nil? || e.empty? ? `git log --pretty=format:"%d" -1` : e if /tag/.match(ref_names).nil? return "" diff --git a/hooks/build b/hooks/build index 0541e4a9d..a4c36df95 100755 --- a/hooks/build +++ b/hooks/build @@ -1,5 +1,9 @@ #!/usr/bin/env sh +# so we can run script outside of docker hub +IMAGE_NAME=${IMAGE_NAME:-"pecan/bety:latest"} + +# build the actual container docker build \ --build-arg BETY_GIT_TAGS="$(git log --pretty=format:%d -1)" \ --build-arg BETY_GIT_BRANCH="$(git rev-parse --abbrev-ref HEAD)" \ From da6c456287f8c808300108badf96682b91208a51 Mon Sep 17 00:00:00 2001 From: Rob Kooper Date: Tue, 9 Oct 2018 13:30:50 -0500 Subject: [PATCH 2/3] make sure variable is not nil --- app/helpers/application_helper.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 8ce9328d1..6b5b7ed90 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -127,8 +127,8 @@ def commit_is_tagged? end def commit_tags - e = ENV['BETY_GIT_TAGS'].dup - ref_names = e.nil? || e.empty? ? `git log --pretty=format:"%d" -1` : e + e = ENV['BETY_GIT_TAGS'] + ref_names = e.nil? || e.empty? ? `git log --pretty=format:"%d" -1` : e.dup if /tag/.match(ref_names).nil? return "" end From 854b06149f0c1a1568b1525c9998bdcdcb139857 Mon Sep 17 00:00:00 2001 From: Rob Kooper Date: Thu, 11 Oct 2018 15:01:17 -0500 Subject: [PATCH 3/3] update CHANGELOG --- CHANGELOG.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index b5c40a653..0f242cda6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,12 @@ section for the next release. For more information about this file see also [Keep a Changelog](http://keepachangelog.com/) . +## [5.0.4] - 2018-10-11 + +### Fixes + +- #600 : Error when starting BETY as docker container due to frozen variable. + ## [5.0.3] - 2018-09-28 ### Fixes