docker-package.sh 626 B

1234567891011121314151617181920
  1. #!/usr/bin/env bash
  2. set -ex
  3. BRANCH=$(git rev-parse --abbrev-ref HEAD)
  4. DIST_VERSION=$(git describe --abbrev=0 --tags)
  5. DIR=$(dirname "$0")
  6. # If the branch comes out as HEAD then we're probably checked out to a tag, so if the thing is *not*
  7. # coming out as HEAD then we're on a branch. When we're on a branch, we want to resolve ourselves to
  8. # a few SHAs rather than a version.
  9. if [[ $BRANCH != HEAD && ! $BRANCH =~ heads/v.+ ]]
  10. then
  11. DIST_VERSION=$("$DIR"/get-version-from-git.sh)
  12. fi
  13. DIST_VERSION=$("$DIR"/normalize-version.sh "$DIST_VERSION")
  14. VERSION=$DIST_VERSION yarn build
  15. echo "$DIST_VERSION" > /src/webapp/version