Merge azure_deploy.sh into caprover_deploy.sh

This commit is contained in:
Daniel Egger 2023-05-30 12:04:54 +02:00
parent b967147ff5
commit df9b608d6e
1 changed files with 29 additions and 29 deletions

View File

@ -44,6 +44,11 @@ fi
npm run build
python server/manage.py collectstatic --no-input
if [[ "$APP_NAME" == "prod-azure" ]]; then
# build and push azure docker container
docker build --platform linux/amd64 -f compose/django/Dockerfile -t iterativ/vbv-lernwelt-django:azure .
docker image push iterativ/vbv-lernwelt-django:azure
else
# create and push new docker container
VERSION=$(git log -1 --pretty=%h)
REPO="iterativ/vbv-lernwelt-django"
@ -53,12 +58,6 @@ VERSION_TAG="${REPO}:$VERSION"
docker build --platform=linux/amd64 -f compose/django/Dockerfile -t "$REPO" -t "$LATEST" -t "$VERSION_TAG" --build-arg VERSION="$VERSION" --build-arg BUILD_TIMESTAMP="$BUILD_TIMESTAMP" --build-arg GIT_COMMIT="$(git log -1 --format=%h)" .
docker push "$VERSION_TAG"
if [[ "$APP_NAME" == "vbv-azure" ]]; then
# build and push azure docker container
docker build --platform linux/amd64 -f compose/django/Dockerfile -t iterativ/vbv-lernwelt-django:azure .
docker image push iterativ/vbv-lernwelt-django:azure
fi
# caprover specific deployment
APP_URL="$APP_NAME.control.iterativ.ch"
@ -77,3 +76,4 @@ if [ -n "$CI" ]; then
export CAPROVER_APP_URL="$APP_URL"
echo "https://$CAPROVER_APP_URL" >/tmp/caprover_app_url.txt
fi
fi