diff --git a/caprover_deploy.sh b/caprover_deploy.sh index dd6c138e..34bf3e5b 100755 --- a/caprover_deploy.sh +++ b/caprover_deploy.sh @@ -2,20 +2,22 @@ VERSION=$(git log -1 --pretty=%h) REPO="iterativ/vbv-lernwelt-django" -TAG="$REPO$VERSION" -LATEST="${REPO}latest" +LATEST="${REPO}:latest" BUILD_TIMESTAMP=$( date '+%F_%H:%M:%S' ) +VERSION_TAG="${REPO}:$VERSION" # script should fail when any process returns non zero code set -ev # create client -npm run build +#npm run build + +## Note that images build with buildx do not appear in your docker images list, therefore the push true must be set # 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 +docker buildx build --push=true --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) . + + +#deploy to caprover, explicitly use the version tag... so if there is a mismach you get an error message +caprover deploy -h https://captain.control.iterativ.ch -a vbv-lernwelt -i docker.io/"$VERSION_TAG" -# deploy to caprover -caprover deploy -h https://captain.control.iterativ.ch -a vbv-lernwelt -i docker.io/iterativ/vbv-lernwelt-django diff --git a/server/vbv_lernwelt/core/views.py b/server/vbv_lernwelt/core/views.py index 4e035fd5..8546d91f 100644 --- a/server/vbv_lernwelt/core/views.py +++ b/server/vbv_lernwelt/core/views.py @@ -23,6 +23,8 @@ logger = structlog.get_logger(__name__) @django_view_authentication_exempt @ensure_csrf_cookie + + def vue_home(request): if settings.IT_SERVE_VUE: try: