Skip to content

Commit

Permalink
fix: or-2282 only keep push to devops instead of different environments
Browse files Browse the repository at this point in the history
  • Loading branch information
Jan Lesage committed Aug 5, 2024
1 parent ea729d6 commit 0526baf
Show file tree
Hide file tree
Showing 3 changed files with 117 additions and 112 deletions.
226 changes: 114 additions & 112 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -346,118 +346,118 @@ jobs:
JIRA_PROJECT: OR
JIRA_VERSION: ${{ needs.release.outputs.version }}

push_images_to_staging:
if: needs.release.outputs.version != 'none'
needs: [ release ]
name: Push images to Staging
runs-on: ubuntu-latest
strategy:
matrix:
image: [
'api',
'batch-agentschapzorgengezondheidftpdump',
'batch-vlaanderenbe',
'projections-elasticsearch',
'projections-delegations',
'projections-reporting',
'kbo-mutations',
'ui'
]
steps:
- name: Configure AWS credentials (Staging)
if: needs.release.outputs.version != 'none'
uses: aws-actions/[email protected]
with:
aws-access-key-id: ${{ secrets.VBR_AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.VBR_AWS_SECRET_ACCESS_KEY }}
aws-region: ${{ secrets.VBR_AWS_REGION }}

- name: Login to Amazon ECR
uses: aws-actions/amazon-ecr-login@v2

- name: Download artifact
uses: actions/download-artifact@v4
continue-on-error: false
with:
name: ${{ matrix.image }}
path: ~/artifacts

- name: Debug output
shell: bash
run: |
ls -al
- name: Load artifact
shell: bash
run: |
docker image load -i ~/artifacts/$IMAGE.tar
env:
IMAGE: ${{ matrix.image }}

- name: Push artifacts to ECR
shell: bash
run: |
echo $IMAGE:$SEMVER
docker push $BUILD_DOCKER_REGISTRY/organisation-registry/$IMAGE:$SEMVER
env:
BUILD_DOCKER_REGISTRY: ${{ secrets.VBR_BUILD_DOCKER_REGISTRY }}
IMAGE: ${{ matrix.image }}
SEMVER: ${{ needs.release.outputs.version }}
WORKSPACE: ${{ github.workspace }}

push_images_to_production:
if: needs.release.outputs.version != 'none'
needs: [ release ]
name: Push images to Production
runs-on: ubuntu-latest
strategy:
matrix:
image: [
'api',
'batch-agentschapzorgengezondheidftpdump',
'batch-vlaanderenbe',
'projections-elasticsearch',
'projections-delegations',
'projections-reporting',
'kbo-mutations',
'ui'
]
steps:
- name: Configure AWS credentials (Production)
if: needs.release.outputs.version != 'none'
uses: aws-actions/[email protected]
with:
aws-access-key-id: ${{ secrets.VBR_AWS_ACCESS_KEY_ID_PRD }}
aws-secret-access-key: ${{ secrets.VBR_AWS_SECRET_ACCESS_KEY_PRD }}
aws-region: ${{ secrets.VBR_AWS_REGION_PRD }}

- name: Login to Amazon ECR
uses: aws-actions/amazon-ecr-login@v2

- name: Download artifact
uses: actions/download-artifact@v4
continue-on-error: false
with:
name: ${{ matrix.image }}
path: ~/artifacts

- name: Load artifact
shell: bash
run: |
docker image load -i ~/artifacts/$IMAGE.tar
env:
IMAGE: ${{ matrix.image }}

- name: Push artifacts to ECR
shell: bash
run: |
echo $IMAGE:$SEMVER
docker push $BUILD_DOCKER_REGISTRY/organisation-registry/$IMAGE:$SEMVER
env:
BUILD_DOCKER_REGISTRY: ${{ secrets.VBR_BUILD_DOCKER_REGISTRY_PRD }}
IMAGE: ${{ matrix.image }}
SEMVER: ${{ needs.release.outputs.version }}
WORKSPACE: ${{ github.workspace }}
# push_images_to_staging:
# if: needs.release.outputs.version != 'none'
# needs: [ release ]
# name: Push images to Staging
# runs-on: ubuntu-latest
# strategy:
# matrix:
# image: [
# 'api',
# 'batch-agentschapzorgengezondheidftpdump',
# 'batch-vlaanderenbe',
# 'projections-elasticsearch',
# 'projections-delegations',
# 'projections-reporting',
# 'kbo-mutations',
# 'ui'
# ]
# steps:
# - name: Configure AWS credentials (Staging)
# if: needs.release.outputs.version != 'none'
# uses: aws-actions/[email protected]
# with:
# aws-access-key-id: ${{ secrets.VBR_AWS_ACCESS_KEY_ID }}
# aws-secret-access-key: ${{ secrets.VBR_AWS_SECRET_ACCESS_KEY }}
# aws-region: ${{ secrets.VBR_AWS_REGION }}
#
# - name: Login to Amazon ECR
# uses: aws-actions/amazon-ecr-login@v2
#
# - name: Download artifact
# uses: actions/download-artifact@v4
# continue-on-error: false
# with:
# name: ${{ matrix.image }}
# path: ~/artifacts
#
# - name: Debug output
# shell: bash
# run: |
# ls -al
#
# - name: Load artifact
# shell: bash
# run: |
# docker image load -i ~/artifacts/$IMAGE.tar
# env:
# IMAGE: ${{ matrix.image }}
#
# - name: Push artifacts to ECR
# shell: bash
# run: |
# echo $IMAGE:$SEMVER
# docker push $BUILD_DOCKER_REGISTRY/organisation-registry/$IMAGE:$SEMVER
# env:
# BUILD_DOCKER_REGISTRY: ${{ secrets.VBR_BUILD_DOCKER_REGISTRY }}
# IMAGE: ${{ matrix.image }}
# SEMVER: ${{ needs.release.outputs.version }}
# WORKSPACE: ${{ github.workspace }}
#
# push_images_to_production:
# if: needs.release.outputs.version != 'none'
# needs: [ release ]
# name: Push images to Production
# runs-on: ubuntu-latest
# strategy:
# matrix:
# image: [
# 'api',
# 'batch-agentschapzorgengezondheidftpdump',
# 'batch-vlaanderenbe',
# 'projections-elasticsearch',
# 'projections-delegations',
# 'projections-reporting',
# 'kbo-mutations',
# 'ui'
# ]
# steps:
# - name: Configure AWS credentials (Production)
# if: needs.release.outputs.version != 'none'
# uses: aws-actions/[email protected]
# with:
# aws-access-key-id: ${{ secrets.VBR_AWS_ACCESS_KEY_ID_PRD }}
# aws-secret-access-key: ${{ secrets.VBR_AWS_SECRET_ACCESS_KEY_PRD }}
# aws-region: ${{ secrets.VBR_AWS_REGION_PRD }}
#
# - name: Login to Amazon ECR
# uses: aws-actions/amazon-ecr-login@v2
#
# - name: Download artifact
# uses: actions/download-artifact@v4
# continue-on-error: false
# with:
# name: ${{ matrix.image }}
# path: ~/artifacts
#
# - name: Load artifact
# shell: bash
# run: |
# docker image load -i ~/artifacts/$IMAGE.tar
# env:
# IMAGE: ${{ matrix.image }}
#
# - name: Push artifacts to ECR
# shell: bash
# run: |
# echo $IMAGE:$SEMVER
# docker push $BUILD_DOCKER_REGISTRY/organisation-registry/$IMAGE:$SEMVER
# env:
# BUILD_DOCKER_REGISTRY: ${{ secrets.VBR_BUILD_DOCKER_REGISTRY_PRD }}
# IMAGE: ${{ matrix.image }}
# SEMVER: ${{ needs.release.outputs.version }}
# WORKSPACE: ${{ github.workspace }}

push_images_to_devops:
if: needs.release.outputs.version != 'none'
Expand Down Expand Up @@ -554,6 +554,7 @@ jobs:
deploy_staging_new:
if: needs.release.outputs.version != 'none'
needs: [ release, push_images_to_devops ]
Expand Down Expand Up @@ -595,6 +596,7 @@ jobs:
echo ${{ steps.awscurl-polling-action.outputs.final-message }}
# - name: Publish to NuGet
# shell: bash
# run: |
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/production-new-manual.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ jobs:
]
steps:
- name: CD
id: awscurl-polling-action
env:
BUILD_URL: ${{ vars.VBR_AWS_BUILD_API_DEVOPS }}/${{matrix.services}}
STATUS_URL: ${{ vars.VBR_AWS_BUILD_STATUS_API_DEVOPS }}/${{matrix.services}}
Expand Down Expand Up @@ -59,6 +60,7 @@ jobs:
]
steps:
- name: CD services
id: awscurl-polling-action
env:
BUILD_URL: ${{ vars.VBR_AWS_BUILD_API_DEVOPS }}/${{matrix.services}}
STATUS_URL: ${{ vars.VBR_AWS_BUILD_STATUS_API_DEVOPS }}/${{matrix.services}}
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/staging-new-manual.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ jobs:
]
steps:
- name: CD
id: awscurl-polling-action
env:
BUILD_URL: ${{ vars.VBR_AWS_BUILD_API_DEVOPS }}/${{matrix.services}}
STATUS_URL: ${{ vars.VBR_AWS_BUILD_STATUS_API_DEVOPS }}/${{matrix.services}}
Expand Down

0 comments on commit 0526baf

Please sign in to comment.