Skip to content

Commit

Permalink
FIX CICD: PROJECT_REPO_NAME
Browse files Browse the repository at this point in the history
  • Loading branch information
asim3 committed May 25, 2024
1 parent 1436ac8 commit 5996cde
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 24 deletions.
20 changes: 10 additions & 10 deletions setup/deploy/docker-compose-staging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,10 @@ services:
replicas: 2
labels:
traefik.enable: "true"
traefik.http.routers.my_project_name-stag-static-app.rule: Host(`my_project_name.static.asimt.sa`)
traefik.http.routers.my_project_name-stag-static-app.tls: "true"
traefik.http.routers.my_project_name-stag-static-app.tls.certresolver: prodResolver
traefik.http.services.my_project_name-stag-static-svc.loadbalancer.server.port: 80
traefik.http.routers.${PROJECT_REPO_NAME}-stag-static-app.rule: Host(`my_project_name.static.asimt.sa`)
traefik.http.routers.${PROJECT_REPO_NAME}-stag-static-app.tls: "true"
traefik.http.routers.${PROJECT_REPO_NAME}-stag-static-app.tls.certresolver: prodResolver
traefik.http.services.${PROJECT_REPO_NAME}-stag-static-svc.loadbalancer.server.port: 80
resources:
reservations:
memory: 128M
Expand All @@ -58,7 +58,7 @@ services:
- main-public

app-migrate:
image: ghcr.io/asim3/my_project_name:${PROJECT_IMAGE_TAG}
image: ghcr.io/asim3/${PROJECT_REPO_NAME}:${PROJECT_IMAGE_TAG}
entrypoint:
- "/bin/sh"
- "-c"
Expand All @@ -83,7 +83,7 @@ services:
- main-public

app:
image: ghcr.io/asim3/my_project_name:${PROJECT_IMAGE_TAG}
image: ghcr.io/asim3/${PROJECT_REPO_NAME}:${PROJECT_IMAGE_TAG}
environment:
TZ: Asia/Riyadh
DJANGO_SETTINGS_MODULE: "my_project_name.settings.docker_staging"
Expand All @@ -101,10 +101,10 @@ services:
replicas: 1
labels:
traefik.enable: "true"
traefik.http.routers.my_project_name-stag-app.rule: Host(`my_project_name.asimt.sa`)
traefik.http.routers.my_project_name-stag-app.tls: "true"
traefik.http.routers.my_project_name-stag-app.tls.certresolver: prodResolver
traefik.http.services.my_project_name-stag-svc.loadbalancer.server.port: 8000
traefik.http.routers.${PROJECT_REPO_NAME}-stag-app.rule: Host(`my_project_name.asimt.sa`)
traefik.http.routers.${PROJECT_REPO_NAME}-stag-app.tls: "true"
traefik.http.routers.${PROJECT_REPO_NAME}-stag-app.tls.certresolver: prodResolver
traefik.http.services.${PROJECT_REPO_NAME}-stag-svc.loadbalancer.server.port: 8000
# https://doc.traefik.io/traefik/routing/providers/docker/
resources:
reservations:
Expand Down
20 changes: 10 additions & 10 deletions setup/deploy/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,10 @@ services:
replicas: 2
labels:
traefik.enable: "true"
traefik.http.routers.my_project_name-prod-static-app.rule: Host(`static.my_project_name.sa`)
traefik.http.routers.my_project_name-prod-static-app.tls: "true"
traefik.http.routers.my_project_name-prod-static-app.tls.certresolver: prodResolver
traefik.http.services.my_project_name-prod-static-svc.loadbalancer.server.port: 80
traefik.http.routers.${PROJECT_REPO_NAME}-prod-static-app.rule: Host(`static.my_project_name.sa`)
traefik.http.routers.${PROJECT_REPO_NAME}-prod-static-app.tls: "true"
traefik.http.routers.${PROJECT_REPO_NAME}-prod-static-app.tls.certresolver: prodResolver
traefik.http.services.${PROJECT_REPO_NAME}-prod-static-svc.loadbalancer.server.port: 80
resources:
reservations:
memory: 128M
Expand All @@ -58,7 +58,7 @@ services:
- main-public

app-migrate:
image: ghcr.io/asim3/my_project_name:${PROJECT_IMAGE_TAG}
image: ghcr.io/asim3/${PROJECT_REPO_NAME}:${PROJECT_IMAGE_TAG}
entrypoint:
- "/bin/sh"
- "-c"
Expand All @@ -83,7 +83,7 @@ services:
- main-public

app:
image: ghcr.io/asim3/my_project_name:${PROJECT_IMAGE_TAG}
image: ghcr.io/asim3/${PROJECT_REPO_NAME}:${PROJECT_IMAGE_TAG}
environment:
TZ: Asia/Riyadh
DJANGO_SETTINGS_MODULE: "my_project_name.settings.docker_production"
Expand All @@ -101,10 +101,10 @@ services:
replicas: 1
labels:
traefik.enable: "true"
traefik.http.routers.my_project_name-prod-app.rule: Host(`my_project_name.sa`)
traefik.http.routers.my_project_name-prod-app.tls: "true"
traefik.http.routers.my_project_name-prod-app.tls.certresolver: prodResolver
traefik.http.services.my_project_name-prod-svc.loadbalancer.server.port: 8000
traefik.http.routers.${PROJECT_REPO_NAME}-prod-app.rule: Host(`my_project_name.sa`)
traefik.http.routers.${PROJECT_REPO_NAME}-prod-app.tls: "true"
traefik.http.routers.${PROJECT_REPO_NAME}-prod-app.tls.certresolver: prodResolver
traefik.http.services.${PROJECT_REPO_NAME}-prod-svc.loadbalancer.server.port: 8000
# https://doc.traefik.io/traefik/routing/providers/docker/
resources:
reservations:
Expand Down
4 changes: 2 additions & 2 deletions setup/workflows/prod-ci-cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
- prod/**

env:
PROJECT_NAME: my_project_name
PROJECT_REPO_NAME: ${{ github.event.repository.name }}
PROJECT_IMAGE_NAME: "ghcr.io/asim3/${{ github.event.repository.name }}"


Expand Down Expand Up @@ -80,7 +80,7 @@ jobs:
export PROJECT_IMAGE_TAG=${{ needs.docker_push.outputs.app_version }}
&& eval "$(ssh-agent -s)"
&& ssh-add - <<< $SSH_PRIVATE_KEY
&& docker stack deploy -c ./deploy/docker-compose.yml ${PROJECT_NAME}-prod
&& docker stack deploy -c ./deploy/docker-compose.yml ${PROJECT_REPO_NAME}-prod
- name: Clean Up SSH
if: always()
Expand Down
4 changes: 2 additions & 2 deletions setup/workflows/stag-ci-cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
- stag/**

env:
PROJECT_NAME: my_project_name
PROJECT_REPO_NAME: ${{ github.event.repository.name }}
PROJECT_IMAGE_NAME: "ghcr.io/asim3/${{ github.event.repository.name }}"


Expand Down Expand Up @@ -80,7 +80,7 @@ jobs:
export PROJECT_IMAGE_TAG=${{ needs.docker_push.outputs.app_version }}
&& eval "$(ssh-agent -s)"
&& ssh-add - <<< $SSH_PRIVATE_KEY
&& docker stack deploy -c ./deploy/docker-compose-staging.yml ${PROJECT_NAME}-stag
&& docker stack deploy -c ./deploy/docker-compose-staging.yml ${PROJECT_REPO_NAME}-stag
- name: Clean Up SSH
if: always()
Expand Down

0 comments on commit 5996cde

Please sign in to comment.