Skip to content

Commit

Permalink
feat: update app config
Browse files Browse the repository at this point in the history
  • Loading branch information
andrwils committed Sep 20, 2024
1 parent a5a9c7b commit 0442753
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 17 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ concurrency:

env:
BROKER_URL: https://broker.io.nrs.gov.bc.ca
BROKER_JWT: ${{ secrets.BROKER_JWT }}
BROKER_JWT: ${{ secrets.BROKER_JWT_0E727E83_F027_426A_A31C_D7C1CCEADDF6 }}
SERVICE_PROJECT: oneteam-example
SERVICE_NAME: java-maven-pipeline-example

Expand Down Expand Up @@ -84,7 +84,7 @@ jobs:
- name: Open intention
uses: bcgov-nr/action-broker-intention-open@v2
with:
broker_jwt: ${{ secrets.BROKER_JWT }}
broker_jwt: ${{ secrets.BROKER_JWT_0E727E83_F027_426A_A31C_D7C1CCEADDF6 }}
intention_path: intention.json
quickstart: true
- name: Set intention ID for deployment job
Expand Down
17 changes: 16 additions & 1 deletion .github/workflows/deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,13 @@ jobs:
-H 'accept: application/json' \
-H 'Authorization: Bearer '"${BROKER_JWT}"'' \
-d '')
if echo "$RESPONSE" | jq -e '.statusCode == 401' > /dev/null; then
echo "Status code is 401. This indicates an authorization error."
echo "Please check if your Broker Token is valid. Teams can generate a new one in Broker if needed."
echo "Link: https://broker.io.nrs.gov.bc.ca/browse/brokerAccount"
echo "Exiting..."
exit 1
fi
echo "project_version=$(echo ${RESPONSE} | jq -r '.data[].actions[].package.version')" >> $GITHUB_OUTPUT
echo "build_guid=$(echo ${RESPONSE} | jq -r '.data[].id')" >> $GITHUB_OUTPUT
echo "build_number=$(echo ${RESPONSE} | jq -r '.data[].actions[].package.buildNumber')" >> $GITHUB_OUTPUT
Expand Down Expand Up @@ -105,6 +112,13 @@ jobs:
-H 'accept: application/json' \
-H 'Authorization: Bearer '"${BROKER_JWT}"'' \
-d '')
if echo "$RESPONSE" | jq -e '.statusCode == 401' > /dev/null; then
echo "Status code is 401. This indicates an authorization error."
echo "Please check if your Broker Token is valid. Teams can generate a new one in Broker if needed."
echo "Link: https://broker.io.nrs.gov.bc.ca/browse/brokerAccount"
echo "Exiting..."
exit 1
fi
echo "project_version=${PROJECT_VERSION}" >> $GITHUB_OUTPUT
echo "build_guid=$(echo ${RESPONSE} | jq -r '.data[].id')" >> $GITHUB_OUTPUT
echo "build_number=$(echo ${RESPONSE} | jq -r '.data[].actions[].package.buildNumber')" >> $GITHUB_OUTPUT
Expand Down Expand Up @@ -173,7 +187,8 @@ jobs:
BUILD_NUMBER: ${{ needs.deploy-build.outputs.build_number || needs.deploy-tag.outputs.build_number }}
ARTIFACT_SHA256: ${{ needs.deploy-build.outputs.artifact_sha256 || needs.deploy-tag.outputs.artifact_sha256 }}
DOWNLOAD_URL: ${{ needs.deploy-build.outputs.download_url || needs.deploy-tag.outputs.download_url }}
# The automatically generated GitHub token will expire when the workflow ends. We need to wait so the job has time to clone the repo.
# The automatically generated GitHub token will expire when the workflow ends. We need to wait so the job has time to clone the repo
# and download the package
- name: Sleep
run: sleep 90s
shell: bash
14 changes: 1 addition & 13 deletions .yo-rc.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,3 @@
{
"generator-nr-repository-composer": {
"promptValues": {
"projectName": "oneteam-example",
"serviceName": "java-maven-pipeline-example",
"artifactoryProject": "cc20",
"pomRoot": "./",
"unitTestsPath": "",
"gitHubPackages": true,
"gitHubOwnerPack": "bcgov/java-maven-pipeline-example",
"deployOnPrem": true,
"playbookPath": "playbooks"
}
}
"generator-nr-repository-composer": {}
}
3 changes: 2 additions & 1 deletion app-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,9 @@ metadata:
playbook.io.nrs.gov.bc.ca/artifactoryPackageType: ""
playbook.io.nrs.gov.bc.ca/deployOnPrem: true
playbook.io.nrs.gov.bc.ca/playbookPath: playbooks
playbook.io.nrs.gov.bc.ca/tomcatContext: ext#oneteam-example
playbook.io.nrs.gov.bc.ca/tomcatContext: pub#oneteam-example
playbook.io.nrs.gov.bc.ca/useAltAppDirName: false
playbook.io.nrs.gov.bc.ca/altAppDirName: ""
playbook.io.nrs.gov.bc.ca/addWebadeConfig: false
github.com/project-slug: ""
playbook.io.nrs.gov.bc.ca/brokerJwtReference: BROKER_JWT_0E727E83_F027_426A_A31C_D7C1CCEADDF6

0 comments on commit 0442753

Please sign in to comment.