ci: fix new api dev build meta script

Run the set-api-build-metadata on merge requests for testing

Part-of: <https://dev.funkwhale.audio/funkwhale/funkwhale/-/merge_requests/2351>
environments/review-docs-renam-9oy3ia/deployments/17063
jo 2023-01-31 12:30:59 +01:00 zatwierdzone przez Marge
rodzic 7d96baa3cd
commit a3be49e099
2 zmienionych plików z 6 dodań i 2 usunięć

Wyświetl plik

@ -372,7 +372,7 @@ build_api:
script:
- rm -rf api/tests
- >
if [[ "$CI_COMMIT_REF_NAME" =~ ^develop|stable$ ]]; then
if [[ -z "$CI_COMMIT_TAG" ]]; then
./scripts/set-api-build-metadata.sh $CI_COMMIT_SHORT_SHA;
fi
artifacts:
@ -425,7 +425,7 @@ deploy_docs:
before_script:
- docker login -u $DOCKER_LOGIN -p $DOCKER_PASSWORD
- >
if [[ "$CI_COMMIT_REF_NAME" =~ ^develop|stable$ ]]; then
if [[ -z "$CI_COMMIT_TAG" ]]; then
./scripts/set-api-build-metadata.sh $CI_COMMIT_SHORT_SHA;
fi
cache:

Wyświetl plik

@ -10,8 +10,12 @@ error() {
exit 1
}
command -v git > /dev/null || error "git command not found!"
command -v poetry > /dev/null || error "poetry command not found!"
# We assume this script only runs in a git repository
cd "$(git rev-parse --show-toplevel)/api"
COMMIT_SHA="$1"
CURRENT_VERSION="$(poetry version --short)"