Skip to content

Commit

Permalink
Output credential for docker compose
Browse files Browse the repository at this point in the history
  • Loading branch information
Zharktas committed Sep 29, 2023
1 parent bb2d37d commit a1a7974
Showing 1 changed file with 14 additions and 12 deletions.
26 changes: 14 additions & 12 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,15 @@ jobs:

- run: npm ci

- name: configure AWS credentials for running tests
uses: aws-actions/configure-aws-credentials@v4
id: aws-credentials
with:
role-to-assume: ${{ secrets.AWS_TEST_ROLE }}
role-session-name: github-actions
aws-region: eu-west-1
output-credentials: true

- name: configure environment
shell: bash
run: |
Expand Down Expand Up @@ -232,12 +241,17 @@ jobs:
sed -i.bak -E 's/^(REPOSITORY[[:blank:]]*=[[:blank:]]*).*/\1\"'"${REPOSITORY}"'\"/' docker/.env
sed -i.bak -E 's/^(MATOMO_ENABLED[[:blank:]]*=[[:blank:]]*).*/\1false/' docker/.env
sed -i.bak -E 's/^(CKAN_CLOUDSTORAGE_ENABLED[[:blank:]]*=[[:blank:]]*).*/\1\"'"${CKAN_CLOUDSTORAGE_ENABLED}"'\"/' docker/.env.ckan.local
sed -i.bak -E 's/^(CKAN_CLOUDSTORAGE_DRIVER_OPTIONS[[:blank:]]*=[[:blank:]]*).*/\1\"'"{'key': '${AWS_ACCESS_KEY_ID}', 'secret': '${AWS_SECRET_ACCESS_KEY}', 'token': ''}"'\"/' docker/.env.ckan.local
sed -i.bak -E 's/^(CKAN_CLOUDSTORAGE_CONTAINER_NAME[[:blank:]]*=[[:blank:]]*).*/\1\"'"${CKAN_CLOUDSTORAGE_CONTAINER_NAME}"'\"/' docker/.env.ckan.local
sed -i.bak -E 's/^(AWS_ACCESS_KEY_ID[[:blank:]]*=[[:blank:]]*).*/\1\"'"${AWS_ACCESS_KEY_ID}"'\"/' docker/.env.ckan.local
sed -i.bak -E 's/^(AWS_SECRET_ACCESS_KEY[[:blank:]]*=[[:blank:]]*).*/\1\"'"${AWS_SECRET_ACCESS_KEY}"'\"/' docker/.env.ckan.local
env:
REGISTRY: ${{ secrets.REGISTRY }}
REPOSITORY: ${{ secrets.REPOSITORY }}
CKAN_CLOUDSTORAGE_ENABLED: true
CKAN_CLOUDSTORAGE_CONTAINER_NAME: ${{ secrets.CKAN_CLOUDSTORAGE_CONTAINER_NAME }}
AWS_ACCESS_KEY_ID: ${{ steps.aws-credentials.outputs.aws-access-key-id }}
AWS_SECRET_ACCESS_KEY: ${{ steps.aws-credentials.outputs.aws-secret-access-key }}


- name: configure AWS credentials
Expand Down Expand Up @@ -285,18 +299,6 @@ jobs:
run: |
docker load --input /tmp/nginx/nginx.tar
- name: Pull from registry
working-directory: docker
run: |
docker compose pull
- name: configure AWS credentials for running tests
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: ${{ secrets.AWS_TEST_ROLE }}
role-session-name: github-actions
aws-region: eu-west-1

- name: bring services up
working-directory: docker
run: |
Expand Down

0 comments on commit a1a7974

Please sign in to comment.