Skip to content

Commit

Permalink
git sha
Browse files Browse the repository at this point in the history
  • Loading branch information
mguikema committed Jan 31, 2024
1 parent 30b50d4 commit 5709f8b
Show file tree
Hide file tree
Showing 8 changed files with 16 additions and 4 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/ci-cd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ jobs:
id: meta_app
uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}-app-develop
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}-app

- name: Build and push app Docker image
uses: docker/build-push-action@v3
Expand All @@ -76,6 +76,8 @@ jobs:
push: true
tags: ${{ steps.meta_app.outputs.tags }}
labels: ${{ steps.meta_app.outputs.labels }}
build-args: |
GIT_SHA=${{ github.sha }}
- name: Start rollout on k8s platform
uses: actions-hub/kubectl@master
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/deploy-prd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
id: meta_app
uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}-app-production
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}-app

- name: Build and push app Docker image
uses: docker/build-push-action@v3
Expand All @@ -42,6 +42,8 @@ jobs:
push: true
tags: ${{ steps.meta_app.outputs.tags }}
labels: ${{ steps.meta_app.outputs.labels }}
build-args: |
GIT_SHA=${{ github.sha }}
- name: Start rollout on k8s platform
uses: actions-hub/kubectl@master
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/deploy-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
id: meta_app
uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}-app-test
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}-app

- name: Build and push app Docker image
uses: docker/build-push-action@v3
Expand All @@ -42,6 +42,8 @@ jobs:
push: true
tags: ${{ steps.meta_app.outputs.tags }}
labels: ${{ steps.meta_app.outputs.labels }}
build-args: |
GIT_SHA=${{ github.sha }}
- name: Start rollout on k8s platform
uses: actions-hub/kubectl@master
Expand Down
3 changes: 3 additions & 0 deletions app/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -63,4 +63,7 @@ RUN mkdir -p /media \

USER $APP_USER

ARG GIT_SHA
ENV GIT_SHA=$GIT_SHA

CMD ["bash", "/app/deploy/docker-entrypoint.sh"]
1 change: 1 addition & 0 deletions app/apps/main/templates/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="git_sha" value="{{ GIT_SHA }}">
<title>{% block title %}Begraven en Cremeren{% endblock %}</title>
<link rel="apple-touch-icon" sizes="180x180" href="{{base_url}}{%webpack_static 'images/apple-touch-icon.png' %}"/>
<link rel="icon" type="image/png" sizes="32x32" href="{{base_url}}{%webpack_static 'images/favicon-32x32.png' %}"/>
Expand Down
1 change: 1 addition & 0 deletions app/config/context_processors.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,5 @@ def general_settings(context):
"SESSION_STATE": token_decoded.get("session_state"),
"LOGOUT_URL": reverse("oidc_logout"),
"LOGIN_URL": f"{reverse('oidc_authentication_init')}?next={absolute(context).get('FULL_URL')}",
"GIT_SHA": settings.GIT_SHA,
}
1 change: 1 addition & 0 deletions app/config/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
"DJANGO_SECRET_KEY", os.environ.get("SECRET_KEY", os.environ.get("APP_SECRET"))
)

GIT_SHA = os.getenv("GIT_SHA")
ENVIRONMENT = os.getenv("ENVIRONMENT")
DEBUG = ENVIRONMENT == "development"

Expand Down
2 changes: 1 addition & 1 deletion app/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ psycopg2-binary==2.9.5
django-webpack-loader==1.7.0
requests
debugpy
django-health-check
django-health-check==3.17.0
django_redis
django-permissions-policy==4.14.0
django-cors-headers==3.13.0
Expand Down

0 comments on commit 5709f8b

Please sign in to comment.