mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-24 20:36:49 +00:00
When fetching ofn commit, if it is not found, return a sentinal value to avoid a wayward git push
This commit is contained in:
@@ -25,7 +25,17 @@ function set_ofn_commit {
|
||||
}
|
||||
|
||||
function get_ofn_commit {
|
||||
echo `buildkite-agent meta-data get "openfoodnetwork:git:commit"`
|
||||
OFN_COMMIT=`buildkite-agent meta-data get "openfoodnetwork:git:commit"`
|
||||
|
||||
# If we don't catch this failure case, push will execute:
|
||||
# git push remote :master --force
|
||||
# Which will delete the master branch on the server
|
||||
|
||||
if [[ `expr length "$OFN_COMMIT"` == 0 ]]; then
|
||||
echo 'OFN_COMMIT_NOT_FOUND'
|
||||
else
|
||||
echo $OFN_COMMIT
|
||||
fi
|
||||
}
|
||||
|
||||
function checkout_ofn_commit {
|
||||
|
||||
Reference in New Issue
Block a user