-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
709ca4b
commit 85764e9
Showing
2 changed files
with
40 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -47,7 +47,7 @@ jobs: | |
- name: Bundle Assets Into Cotar | ||
run: | | ||
./scripts/bmc.sh bundle-assets --assets $PWD/assets/ --output $PWD/assets.tar.co | ||
./scripts/bmc.sh ./index.cjs bundle-assets --assets $PWD/assets/ --output $PWD/assets.tar.co | ||
ASSETS_HASH=$(ls assets*.tar.co) | ||
echo "ASSETS_HASH=${ASSETS_HASH}" >> $GITHUB_ENV | ||
echo "ASSETS_LOCATION_STAGING=s3://linz-basemaps-staging/assets/${ASSETS_HASH}" >> $GITHUB_ENV | ||
|
@@ -61,7 +61,7 @@ jobs: | |
|
||
- name: Bundle Config File | ||
run: | | ||
./scripts/bmc.sh bundle --config $PWD/config --output $PWD/config-staging.json --assets ${ASSETS_LOCATION_STAGING} --cache s3://linz-basemaps-staging/basemaps-config/cache/ | ||
./scripts/bmc.sh ./index.cjs bundle --config $PWD/config --output $PWD/config-staging.json --assets ${ASSETS_LOCATION_STAGING} --cache s3://linz-basemaps-staging/basemaps-config/cache/ | ||
CONFIG_HASH_STAGING=$(cat config-staging.json | jq .hash -r) | ||
echo "CONFIG_LOCATION_STAGING=s3://linz-basemaps-staging/config/config-${CONFIG_HASH_STAGING}.json.gz" >> $GITHUB_ENV | ||
|
@@ -82,7 +82,7 @@ jobs: | |
- name: Compare To Production | ||
run: | | ||
aws s3 cp s3://linz-basemaps/config/config-latest.json.gz . | ||
./scripts/bmc.sh import --config ${CONFIG_LOCATION_STAGING} --output $PWD/changes.md --target $PWD/config-latest.json.gz | ||
./scripts/bmc.sh ./index.cjs import --config ${CONFIG_LOCATION_STAGING} --output $PWD/changes.md --target $PWD/config-latest.json.gz | ||
- name: (Pull Request) Update Description | ||
if: github.ref != 'refs/heads/master' && github.event_name == 'pull_request' | ||
|
@@ -123,7 +123,7 @@ jobs: | |
|
||
- name: Import config | ||
run: | | ||
./scripts/bmc.sh import --config ${CONFIG_PATH} --commit | ||
./scripts/bmc.sh ./index.cjs import --config ${CONFIG_PATH} --commit | ||
# Compare and deploy to prod | ||
deploy-prod: | ||
|
@@ -169,7 +169,7 @@ jobs: | |
aws s3 cp assets-current.tar.co ${ASSETS_LOCATION_PROD} | ||
./scripts/bmc.sh bundle --config $PWD/config-current.json.gz --output $PWD/config-prod.json --assets ${ASSETS_LOCATION_PROD} --cache s3://linz-basemaps-staging/basemaps-config/cache/ | ||
./scripts/bmc.sh ./index.cjs bundle --config $PWD/config-current.json.gz --output $PWD/config-prod.json --assets ${ASSETS_LOCATION_PROD} --cache s3://linz-basemaps-staging/basemaps-config/cache/ | ||
CONFIG_HASH_PROD=$(cat config-prod.json | jq .hash -r) | ||
echo "CONFIG_LOCATION_PROD=s3://linz-basemaps/config/config-${CONFIG_HASH_PROD}.json.gz" >> $GITHUB_ENV | ||
|
@@ -183,7 +183,37 @@ jobs: | |
- name: Import config | ||
run: | | ||
./scripts/bmc.sh import --config ${CONFIG_LOCATION_PROD} --commit | ||
./scripts/bmc.sh ./index.cjs mport --config ${CONFIG_LOCATION_PROD} --commit | ||
smoke: | ||
permissions: | ||
id-token: write | ||
contents: read | ||
needs: [build] | ||
runs-on: ubuntu-latest | ||
env: | ||
DOCKER_AWS_ENV: -e AWS_ACCESS_KEY_ID -e AWS_SECRET_ACCESS_KEY -e AWS_SESSION_TOKEN -e AWS_REGION -e AWS_DEFAULT_REGION | ||
CONFIG_PATH: ${{ needs.build.outputs.config_path }} | ||
BASEMAPS_HOST: http://localhost:5001 | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: (Smoke) AWS Configure | ||
uses: aws-actions/[email protected] | ||
with: | ||
aws-region: ap-southeast-2 | ||
mask-aws-account-id: true | ||
role-to-assume: ${{ secrets.AWS_ROLE_SCREENSHOT }} | ||
|
||
- name: (Smoke) Start Local Server | ||
run: | | ||
./scripts/bmc.sh ./index.cjs serve --config ${CONFIG_PATH} --port 5001 & | ||
# Wait for the server to start | ||
timeout 30 bash -c 'while [[ "$(curl -s -o /dev/null -w ''%{http_code}'' http://localhost:5001/v1/version)" != "200" ]]; do sleep 0.5; done' || false | ||
- name: (Smoke) Run Smoke test | ||
run: ./scripts/bmc.sh --test ./node_modules/@basemaps/smoke/build/ | ||
|
||
screenshot: | ||
permissions: | ||
|
@@ -209,7 +239,7 @@ jobs: | |
|
||
- name: (Screenshot) Screenshot Pull Request Changes | ||
run: | | ||
./scripts/bmc.sh serve --config ${CONFIG_PATH} & | ||
./scripts/bmc.sh ./index.cjs serve --config ${CONFIG_PATH} --port 5000 & | ||
# Wait for the server to start | ||
timeout 30 bash -c 'while [[ "$(curl -s -o /dev/null -w ''%{http_code}'' http://localhost:5000/v1/version)" != "200" ]]; do sleep 0.5; done' || false | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters