Skip to content

Commit

Permalink
Merge pull request #110 from forza-mor-rotterdam/develop
Browse files Browse the repository at this point in the history
develop -> test
  • Loading branch information
mguikema committed Feb 6, 2024
2 parents b87eb49 + 5aadd87 commit c68cb27
Show file tree
Hide file tree
Showing 11 changed files with 24 additions and 10 deletions.
8 changes: 5 additions & 3 deletions .github/workflows/ci-cd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,16 +30,16 @@ jobs:
uses: actions/checkout@v3

- name: Build Docker test image
run: docker-compose -f docker-compose.test.yaml build
run: docker compose -f docker-compose.test.yaml build

- name: Create Docker network
run: docker network create mbc_network

- name: Start Docker Containers
run: docker-compose -f docker-compose.test.yaml up -d
run: docker compose -f docker-compose.test.yaml up -d

- name: Run Tests
run: docker-compose -f docker-compose.test.yaml run app python manage.py test
run: docker compose -f docker-compose.test.yaml run app python manage.py test

deploy-acc:
name: Acceptance release
Expand Down Expand Up @@ -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
2 changes: 2 additions & 0 deletions .github/workflows/deploy-prd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 2 additions & 0 deletions .github/workflows/deploy-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
8 changes: 4 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Build scripts to run commands within the Docker container or create local environments

# Docker variables
RUN_IN_NEW_WEBCONTEXT = docker-compose run -it mbc_app
EXEC_IN_WEB = docker-compose run mbc_app
RUN_IN_NEW_WEBCONTEXT = docker compose run -it mbc_app
EXEC_IN_WEB = docker compose run mbc_app
EXEC_IN_WEB_CMD = $(EXEC_IN_WEB) python manage.py

# General
Expand All @@ -23,12 +23,12 @@ run_frontend:

stop: ## Stop containers
@echo Stopping containers.
docker-compose down
docker compose down

clear_docker_volumes: ## clear docker volumes
check_clean_db
@echo Stopping and removing containers.
docker-compose down -v
docker compose down -v

create_superuser: ## create superuser for public tenant
@echo Create superuser. You will be prompted for email and password
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"]
2 changes: 1 addition & 1 deletion app/apps/main/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@ def _to_base64(self, file):

def get_onderwerp_urls(self, onderwerp_ids):
return [
c
{"bron_url": c}
for c in Categorie.objects.all()
.filter(pk__in=onderwerp_ids)
.values_list("onderwerp", flat=True)
Expand Down
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
4 changes: 3 additions & 1 deletion app/apps/signalen/managers.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,9 @@ def signaal_aanmaken(self, signaal_data, request, db="default"):
"v1:signaal-detail",
kwargs={"uuid": signaal.uuid},
request=request,
)
),
"bron_id": "B&C Service formulier",
"bron_signaal_id": str(signaal.uuid),
}
)
signaal_response = MeldingenService().signaal_aanmaken(
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 c68cb27

Please sign in to comment.