Move generation of build info to script
This commit is contained in:
parent
d6a50ff864
commit
0ed45f54c6
|
@ -84,6 +84,11 @@ jobs:
|
||||||
run: |
|
run: |
|
||||||
CONFIG=tests/test.env poetry run alembic upgrade head
|
CONFIG=tests/test.env poetry run alembic upgrade head
|
||||||
|
|
||||||
|
- name: Prepare version file
|
||||||
|
run: |
|
||||||
|
scripts/generate-build-info.sh ${{ github.ref }}
|
||||||
|
cat app/build_info.py
|
||||||
|
|
||||||
- name: Test with pytest
|
- name: Test with pytest
|
||||||
run: |
|
run: |
|
||||||
poetry run pytest
|
poetry run pytest
|
||||||
|
@ -120,11 +125,8 @@ jobs:
|
||||||
|
|
||||||
- name: Prepare version file
|
- name: Prepare version file
|
||||||
run: |
|
run: |
|
||||||
BUILD_INFO_FILE=app/build_info.py
|
scripts/generate-build-info.sh ${{ github.ref }}
|
||||||
echo "SHA1 = '${{ github.ref }}'" > $BUILD_INFO_FILE
|
cat app/build_info.py
|
||||||
BUILD_TIME=$(date +%s)
|
|
||||||
echo "BUILD_TIME = '${BUILD_TIME}' >> $BUILD_INFO_FILE
|
|
||||||
cat $BUILD_INFO_FILE
|
|
||||||
|
|
||||||
- name: Build image and publish to Docker Registry
|
- name: Build image and publish to Docker Registry
|
||||||
uses: docker/build-push-action@v3
|
uses: docker/build-push-action@v3
|
||||||
|
|
|
@ -0,0 +1,15 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
SCRIPT_DIR="$(cd "$(dirname "$0")" || exit 1; pwd -P)"
|
||||||
|
REPO_ROOT=$(echo "${SCRIPT_DIR}" | sed 's:scripts::g')
|
||||||
|
BUILD_INFO_FILE="${REPO_ROOT}/app/build_info.py"
|
||||||
|
|
||||||
|
if [[ -z "$1" ]]; then
|
||||||
|
echo "This script needs to be invoked with the version as an argument"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
VERSION="$1"
|
||||||
|
echo "SHA1 = \"${VERSION}\"" > $BUILD_INFO_FILE
|
||||||
|
BUILD_TIME=$(date +%s)
|
||||||
|
echo "BUILD_TIME = \"${BUILD_TIME}\"" >> $BUILD_INFO_FILE
|
Loading…
Reference in New Issue