22 lines
734 B
Bash
Executable File
22 lines
734 B
Bash
Executable File
#!/bin/bash
|
|
|
|
VERSION=$(git log -1 --pretty=%h)
|
|
REPO="iterativ/vbv-lernwelt-django"
|
|
TAG="$REPO$VERSION"
|
|
LATEST="${REPO}latest"
|
|
BUILD_TIMESTAMP=$( date '+%F_%H:%M:%S' )
|
|
|
|
# script should fail when any process returns non zero code
|
|
set -ev
|
|
|
|
# create client
|
|
npm run build
|
|
|
|
# create and push new docker container
|
|
# docker buildx build --platform=linux/amd64 -f compose/django/Dockerfile -t "$TAG" -t "$LATEST" --build-arg VERSION="$VERSION" --build-arg BUILD_TIMESTAMP="$BUILD_TIMESTAMP" .
|
|
docker buildx build --platform=linux/amd64 -f compose/django/Dockerfile .
|
|
docker push iterativ/vbv-lernwelt-django
|
|
|
|
# deploy to caprover
|
|
caprover deploy -h https://captain.control.iterativ.ch -a vbv-lernwelt -i docker.io/iterativ/vbv-lernwelt-django
|