Skip to content

Commit

Permalink
Fix the build script to set the correct BUILD and VERSION
Browse files Browse the repository at this point in the history
Replace `/` with `|` as the separator. This way, even when building on a
feature branch containing `/`, `sed` will work
  • Loading branch information
tlex committed Nov 8, 2020
1 parent 9ffc427 commit 2caa218
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions build.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env sh

echo "Setting VERSION"
find . -name .git -type d -prune -o -type f -name constants.py -exec sed -i "s/^VERSION.*/VERSION\ =\ \'${CI_COMMIT_REF_NAME:-None}\'/g" {} + -exec grep VERSION {} +
find . -name .git -type d -prune -o -type f -name constants.py -exec sed -i "s|^VERSION.*|VERSION\ =\ \'${CI_COMMIT_REF_NAME:-None}\'|g" {} + -exec grep VERSION {} +
echo "Setting BUILD"
find . -name .git -type d -prune -o -type f -name constants.py -exec sed -i "s/^BUILD.*/BUILD\ =\ \'${CI_PIPELINE_ID:-None}\'/g" {} + -exec grep BUILD {} +
find . -name .git -type d -prune -o -type f -name constants.py -exec sed -i "s|^BUILD.*|BUILD\ =\ \'${CI_PIPELINE_ID:-None}\'|g" {} + -exec grep BUILD {} +

0 comments on commit 2caa218

Please sign in to comment.