Skip to content

Commit

Permalink
Revert "Merge branch 'dev' into LANDGRIF-1562-remove-dangling-context…
Browse files Browse the repository at this point in the history
…ual"

This reverts commit 5f6cb41, reversing
changes made to b509154.
  • Loading branch information
BielStela committed Feb 10, 2025
1 parent 10c3bd9 commit 4fc395d
Show file tree
Hide file tree
Showing 158 changed files with 449,941 additions and 453,176 deletions.
47 changes: 14 additions & 33 deletions .github/workflows/deploy-to-kubernetes.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,9 @@ on:
- 'main'
- 'staging'
- 'test'
- 'expo'
- 'benjerry'
- 'demo'
- 'dev'
- 'pilot'
paths:
- 'api/**'
- 'client/**'
Expand All @@ -18,31 +17,6 @@ on:
workflow_dispatch:

jobs:
set_env_name:
name: Set Environment Name
runs-on: ubuntu-20.04
outputs:
env_name: ${{ steps.set_env.outputs.env_name }}
env_name_upper: ${{ steps.set_env.outputs.env_name_upper }}
steps:
- name: Set environment name
shell: bash
run: |
branch_name=$(echo "${GITHUB_REF#refs/heads/}")
secret_name=$(echo "$branch_name" | tr '[:lower:]' '[:upper:]')
mapped_name=${!secret_name}
if [ -z "$mapped_name" ]; then
echo "Warning: No secret found for branch '$branch_name'. Falling back to branch name."
mapped_name=$branch_name
fi
mapped_name_upper=$(echo "$mapped_name" | tr '[:lower:]' '[:upper:]')
echo "Environment name found matching branch name: Using the environment name"
echo "##[set-output name=env_name;]$mapped_name"
echo "##[set-output name=env_name_upper;]$mapped_name_upper"
id: set_env
env:
PILOT: ${{ vars.PILOT }}

wait_for_image_push:
name: Wait for Docker images to be pushed
runs-on: ubuntu-20.04
Expand All @@ -64,7 +38,7 @@ jobs:
deploy_images_to_kubernetes:
name: Deploy updated Docker image to Kubernetes
runs-on: ubuntu-20.04
needs: [ set_env_name, wait_for_image_push ]
needs: wait_for_image_push
steps:
- name: Check out the repo
uses: actions/checkout@v2
Expand Down Expand Up @@ -113,16 +87,23 @@ jobs:
run: |
ssh -i ~/.ssh/bastion.key -o StrictHostKeyChecking=no -N -L 4433:${{ secrets.EKS_HOST }}:443 ${{ secrets.BASTION_USER }}@${{ secrets.BASTION_HOST }} -T &
- name: Extract branch name
shell: bash
run: |
echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/})"
echo "##[set-output name=branch-upper;]$(echo ${GITHUB_REF#refs/heads/} | tr a-z A-Z )"
id: extract_branch

- name: Redeploy production pods
if: ${{ needs.set_env_name.outputs.env_name == 'main' }}
if: ${{ steps.extract_branch.outputs.branch == 'main' }}
run: |
kubectl rollout restart deployment api -n production
kubectl rollout restart deployment tiler -n production
kubectl rollout restart deployment client -n production
- name: Redeploy pods for other branches
if: ${{ needs.set_env_name.outputs.env_name != 'main' }}
if: ${{ steps.extract_branch.outputs.branch != 'main' }}
run: |
kubectl rollout restart deployment api -n ${{ needs.set_env_name.outputs.env_name }}
kubectl rollout restart deployment tiler -n ${{ needs.set_env_name.outputs.env_name }}
kubectl rollout restart deployment client -n ${{ needs.set_env_name.outputs.env_name }}
kubectl rollout restart deployment api -n ${{ steps.extract_branch.outputs.branch }}
kubectl rollout restart deployment tiler -n ${{ steps.extract_branch.outputs.branch }}
kubectl rollout restart deployment client -n ${{ steps.extract_branch.outputs.branch }}
87 changes: 45 additions & 42 deletions .github/workflows/publish-docker-images.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,10 @@ on:
- 'main'
- 'staging'
- 'test'
- 'expo'
- 'benjerry'
- 'gcp'
- 'dev'
- 'demo'
- 'pilot'
paths:
- 'api/**'
- 'client/**'
Expand All @@ -30,31 +29,6 @@ on:
default: true

jobs:
set_env_name:
name: Set Environment Name
runs-on: ubuntu-20.04
outputs:
env_name: ${{ steps.set_env.outputs.env_name }}
env_name_upper: ${{ steps.set_env.outputs.env_name_upper }}
steps:
- name: Set environment name
shell: bash
run: |
branch_name=$(echo "${GITHUB_REF#refs/heads/}")
secret_name=$(echo "$branch_name" | tr '[:lower:]' '[:upper:]')
mapped_name=${!secret_name}
if [ -z "$mapped_name" ]; then
echo "Warning: No secret found for branch '$branch_name'. Falling back to branch name."
mapped_name=$branch_name
fi
mapped_name_upper=$(echo "$mapped_name" | tr '[:lower:]' '[:upper:]')
echo "Environment name found matching branch name: Using the environment name"
echo "##[set-output name=env_name;]$mapped_name"
echo "##[set-output name=env_name_upper;]$mapped_name_upper"
id: set_env
env:
PILOT: ${{ vars.PILOT }}

wait_for_tests:
name: Wait for tests to finish running
runs-on: ubuntu-20.04
Expand Down Expand Up @@ -86,7 +60,7 @@ jobs:
push_api_to_registry:
name: Push API Docker image to Docker Hub
runs-on: ubuntu-20.04
needs: [ set_env_name, wait_for_tests ]
needs: wait_for_tests

permissions:
contents: 'read'
Expand Down Expand Up @@ -119,11 +93,18 @@ jobs:
- name: Authorize Docker push
run: gcloud auth configure-docker europe-west1-docker.pkg.dev

- name: Extract branch name
shell: bash
run: |
echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/})"
echo "##[set-output name=branch-upper;]$(echo ${GITHUB_REF#refs/heads/} | tr a-z A-Z )"
id: extract_branch

- name: Build API Docker image
env:
ECR_REGISTRY: ${{ steps.ecr-login.outputs.registry }}
ECR_REPOSITORY: api
IMAGE_TAG: ${{ needs.set_env_name.outputs.env_name }}
IMAGE_TAG: ${{ steps.extract_branch.outputs.branch }}
run: |
docker build -t $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG \
-t europe-west1-docker.pkg.dev/${{ env.PROJECT_ID }}/api/main:${{ github.sha }} \
Expand All @@ -134,7 +115,7 @@ jobs:
env:
ECR_REGISTRY: ${{ steps.ecr-login.outputs.registry }}
ECR_REPOSITORY: api
IMAGE_TAG: ${{ needs.set_env_name.outputs.env_name }}
IMAGE_TAG: ${{ steps.extract_branch.outputs.branch }}
run: |
docker push $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG
docker push europe-west1-docker.pkg.dev/${{ env.PROJECT_ID }}/api/main:${{ github.sha }}
Expand All @@ -143,7 +124,7 @@ jobs:
push_client_to_registry:
name: Push Client Docker image to Docker Hub
runs-on: ubuntu-20.04
needs: [ set_env_name, wait_for_tests ]
needs: wait_for_tests

permissions:
contents: 'read'
Expand Down Expand Up @@ -176,17 +157,24 @@ jobs:
- name: Authorize Docker push
run: gcloud auth configure-docker europe-west1-docker.pkg.dev

- name: Extract branch name
shell: bash
run: |
echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/})"
echo "##[set-output name=branch-upper;]$(echo ${GITHUB_REF#refs/heads/} | tr a-z A-Z )"
id: extract_branch

- name: Build Client Docker image
env:
ECR_REGISTRY: ${{ steps.ecr-login.outputs.registry }}
ECR_REPOSITORY: client
IMAGE_TAG: ${{ needs.set_env_name.outputs.env_name }}
IMAGE_TAG: ${{ steps.extract_branch.outputs.branch }}
run: |
docker build \
--build-arg NEXTAUTH_URL=${{ secrets[format('NEXTAUTH_URL_{0}', needs.set_env_name.outputs.env_name_upper )] }} \
--build-arg NEXTAUTH_SECRET=${{ secrets[format('NEXTAUTH_SECRET_{0}', needs.set_env_name.outputs.env_name_upper )] }} \
--build-arg NEXTAUTH_URL=${{ secrets[format('NEXTAUTH_URL_{0}', steps.extract_branch.outputs.branch-upper )] }} \
--build-arg NEXTAUTH_SECRET=${{ secrets[format('NEXTAUTH_SECRET_{0}', steps.extract_branch.outputs.branch-upper )] }} \
--build-arg NEXT_PUBLIC_MAPBOX_API_TOKEN=${{ secrets.NEXT_PUBLIC_MAPBOX_API_TOKEN }} \
--build-arg NEXT_PUBLIC_API_URL=${{ secrets[format('NEXT_PUBLIC_API_URL_{0}', needs.set_env_name.outputs.env_name_upper )] }} \
--build-arg NEXT_PUBLIC_API_URL=${{ secrets[format('NEXT_PUBLIC_API_URL_{0}', steps.extract_branch.outputs.branch-upper )] }} \
--build-arg CYPRESS_USERNAME=${{ secrets.CYPRESS_USERNAME }} \
--build-arg CYPRESS_PASSWORD=${{ secrets.CYPRESS_PASSWORD }} \
-t $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG \
Expand All @@ -198,16 +186,17 @@ jobs:
env:
ECR_REGISTRY: ${{ steps.ecr-login.outputs.registry }}
ECR_REPOSITORY: client
IMAGE_TAG: ${{ needs.set_env_name.outputs.env_name }}
IMAGE_TAG: ${{ steps.extract_branch.outputs.branch }}
run: |
docker push $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG
docker push europe-west1-docker.pkg.dev/${{ env.PROJECT_ID }}/client/main:${{ github.sha }}
docker push europe-west1-docker.pkg.dev/${{ env.PROJECT_ID }}/client/main:latest
push_data_import_to_registry:
name: Push Data Import Docker image to Docker Hub
runs-on: ubuntu-20.04
needs: [ set_env_name, wait_for_tests ]
needs: wait_for_tests

permissions:
contents: 'read'
Expand Down Expand Up @@ -240,11 +229,18 @@ jobs:
- name: Authorize Docker push
run: gcloud auth configure-docker europe-west1-docker.pkg.dev

- name: Extract branch name
shell: bash
run: |
echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/})"
echo "##[set-output name=branch-upper;]$(echo ${GITHUB_REF#refs/heads/} | tr a-z A-Z )"
id: extract_branch

- name: Build Data Import Docker image
env:
ECR_REGISTRY: ${{ steps.ecr-login.outputs.registry }}
ECR_REPOSITORY: data_import
IMAGE_TAG: ${{ needs.set_env_name.outputs.env_name }}
IMAGE_TAG: ${{ steps.extract_branch.outputs.branch }}
run: |
docker build -t $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG \
-t europe-west1-docker.pkg.dev/${{ env.PROJECT_ID }}/data-import/main:${{ github.sha }} \
Expand All @@ -255,7 +251,7 @@ jobs:
env:
ECR_REGISTRY: ${{ steps.ecr-login.outputs.registry }}
ECR_REPOSITORY: data_import
IMAGE_TAG: ${{ needs.set_env_name.outputs.env_name }}
IMAGE_TAG: ${{ steps.extract_branch.outputs.branch }}
run: |
docker push $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG
docker push europe-west1-docker.pkg.dev/${{ env.PROJECT_ID }}/data-import/main:${{ github.sha }}
Expand All @@ -264,7 +260,7 @@ jobs:
push_tiler_to_registry:
name: Push Tiler Docker image to AWS and GCP
runs-on: ubuntu-20.04
needs: [ set_env_name, wait_for_tests ]
needs: wait_for_tests

permissions:
contents: 'read'
Expand Down Expand Up @@ -297,11 +293,18 @@ jobs:
- name: Authorize Docker push
run: gcloud auth configure-docker europe-west1-docker.pkg.dev

- name: Extract branch name
shell: bash
run: |
echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/})"
echo "##[set-output name=branch-upper;]$(echo ${GITHUB_REF#refs/heads/} | tr a-z A-Z )"
id: extract_branch

- name: Build Tiler Docker image
env:
ECR_REGISTRY: ${{ steps.ecr-login.outputs.registry }}
ECR_REPOSITORY: tiler
IMAGE_TAG: ${{ needs.set_env_name.outputs.env_name }}
IMAGE_TAG: ${{ steps.extract_branch.outputs.branch }}
run: |
docker build -t $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG \
-t europe-west1-docker.pkg.dev/${{ env.PROJECT_ID }}/tiler/main:${{ github.sha }} \
Expand All @@ -312,7 +315,7 @@ jobs:
env:
ECR_REGISTRY: ${{ steps.ecr-login.outputs.registry }}
ECR_REPOSITORY: tiler
IMAGE_TAG: ${{ needs.set_env_name.outputs.env_name }}
IMAGE_TAG: ${{ steps.extract_branch.outputs.branch }}
run: |
docker push $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG
docker push europe-west1-docker.pkg.dev/${{ env.PROJECT_ID }}/tiler/main:${{ github.sha }}
Expand Down
18 changes: 9 additions & 9 deletions .github/workflows/testing-api.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,10 @@ jobs:
- name: Checkout code
uses: actions/checkout@v2

- name: Setup Node
uses: actions/setup-node@v4
- name: Use Node.js 18.16
uses: actions/setup-node@v3
with:
node-version-file: './api/.nvmrc'
node-version: '18.16'

- name: Install API dependencies
working-directory: api
Expand Down Expand Up @@ -88,10 +88,10 @@ jobs:
- name: Checkout code
uses: actions/checkout@v3

- name: Setup Node
uses: actions/setup-node@v4
- name: Use Node.js 18.16
uses: actions/setup-node@v3
with:
node-version-file: './api/.nvmrc'
node-version: '18.16'

- name: Install API dependencies
working-directory: api
Expand All @@ -114,10 +114,10 @@ jobs:
- name: Checkout code
uses: actions/checkout@v3

- name: Setup Node
uses: actions/setup-node@v4
- name: Use Node.js 18.16
uses: actions/setup-node@v3
with:
node-version-file: './api/.nvmrc'
node-version: '18.16'

- name: Install API dependencies
working-directory: api
Expand Down
Loading

0 comments on commit 4fc395d

Please sign in to comment.