Skip to content

Commit

Permalink
rc12
Browse files Browse the repository at this point in the history
  • Loading branch information
elrayle committed Jul 11, 2024
1 parent 4e5e63e commit f2eb475
Show file tree
Hide file tree
Showing 7 changed files with 24 additions and 24 deletions.
18 changes: 9 additions & 9 deletions .github/workflows/app-build-and-deploy.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# This workflow will build a docker image, push it to ghcr.io, and deploy it to an Azure WebApp.
# v1.1.1-rc11 - This tag coordinates the other reusable parts of this workflow.
# v1.1.1-rc12 - This tag coordinates the other reusable parts of this workflow.
# * app-build-docker-image.yml
# * app-deploy-to-azure.yml
# * app-is-deployable.yml
Expand Down Expand Up @@ -74,25 +74,25 @@ jobs:
uses: actions/[email protected]
with:
repository: 'clearlydefined/operations'
ref: 'v1.1.1-rc11'
ref: 'v1.1.1-rc12'
path: 'operations'
- name: Get version from package-lock.json
id: get_version
shell: bash
run: |
script_log=$(./operations/scripts/app-workflows/get-version.sh \
${{ inputs.deploy-env }} \
${{ needs.determine-trigger.outputs.is-release }} \
${{ github.event.release.tag_name }} \
${{ github.sha }}) || (echo "$script_log" && exit 1)
"${{ inputs.deploy-env }}" \
"${{ needs.determine-trigger.outputs.is-release }}" \
"${{ github.event.release.tag_name }}" \
"${{ github.sha }}") || (echo "$script_log" && exit 1)
echo -e "---- script log\n$script_log\n----"; \
version=$(echo "$script_log" | tail -n 1)
echo "VERSION=$version" >> $GITHUB_ENV
build-and-publish-image:
name: Build and publish Docker image
needs: get-version
uses: clearlydefined/operations/.github/workflows/[email protected]rc11
uses: clearlydefined/operations/.github/workflows/[email protected]rc12
secrets:
DEPLOY_TOKEN: ${{ secrets.DEPLOY_TOKEN }}
PRODUCTION_DEPLOYERS: ${{ secrets.PRODUCTION_DEPLOYERS }}
Expand All @@ -104,7 +104,7 @@ jobs:
deploy-primary-app-to-azure:
name: Deploy to primary Azure app
needs: [get-version, build-and-publish-image]
uses: clearlydefined/operations/.github/workflows/[email protected]rc11
uses: clearlydefined/operations/.github/workflows/[email protected]rc12
secrets:
AZURE_WEBAPP_PUBLISH_PROFILE: ${{ secrets.AZURE_WEBAPP_PUBLISH_PROFILE }}
AZURE_CREDENTIALS: ${{ secrets.AZURE_CREDENTIALS }}
Expand All @@ -120,7 +120,7 @@ jobs:
name: Deploy to secondary Azure app
if: ${{ inputs.secondary-azure-app-name-postfix != '' }}
needs: [get-version, build-and-publish-image]
uses: clearlydefined/operations/.github/workflows/[email protected]rc11
uses: clearlydefined/operations/.github/workflows/[email protected]rc12
secrets:
AZURE_WEBAPP_PUBLISH_PROFILE: ${{ secrets.AZURE_SECONDARY_WEBAPP_PUBLISH_PROFILE }}
AZURE_CREDENTIALS: ${{ secrets.AZURE_CREDENTIALS }}
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/app-build-docker-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ on:

jobs:
check-deployable:
uses: clearlydefined/operations/.github/workflows/[email protected]rc11
uses: clearlydefined/operations/.github/workflows/[email protected]rc12
with:
deploy-env: ${{ inputs.deploy-env }}
secrets:
Expand All @@ -48,15 +48,15 @@ jobs:
uses: actions/[email protected]
with:
repository: 'clearlydefined/operations'
ref: 'v1.1.1-rc11'
ref: 'v1.1.1-rc12'
path: 'operations'
- name: Determine Docker Image Name
id: determine_image_name
run: |
script_log=$(./operations/scripts/app-workflows/determine-image-name.sh \
${{ github.repository }} \
${{ inputs.deploy-env }} \
${{ inputs.image-tag }}) || (echo "$script_log" && exit 1)
"${{ github.repository }}" \
"${{ inputs.deploy-env }}" \
"${{ inputs.image-tag }}") || (echo "$script_log" && exit 1)
echo -e "---- script log\n$script_log\n----"; \
image_name=$(echo "$script_log" | tail -n 1)
echo "DOCKER_IMAGE_NAME_WITH_TAG=$image_name" >> $GITHUB_ENV
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/app-deploy-to-azure.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ on:

jobs:
check-deployable:
uses: clearlydefined/operations/.github/workflows/[email protected]rc11
uses: clearlydefined/operations/.github/workflows/[email protected]rc12
with:
deploy-env: ${{ inputs.deploy-env }}
secrets:
Expand All @@ -55,7 +55,7 @@ jobs:
creds: ${{ secrets.AZURE_CREDENTIALS }}

- name: Set DOCKER configs in Azure web app
uses: azure/[email protected]-rc11
uses: azure/[email protected]
with:
app-name: ${{ inputs.azure-webapp-name }}
app-settings-json: |
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/app-is-deployable.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,13 @@ jobs:
uses: actions/[email protected]
with:
repository: 'clearlydefined/operations'
ref: 'v1.1.1-rc11'
ref: 'v1.1.1-rc12'
path: 'operations'
- id: confirm-dev
shell: bash
run: |
script_log=$(./operations/scripts/app-workflows/confirm-dev.sh \
${{ inputs.deploy-env }}) || (echo "$script_log" && exit 1)
"${{ inputs.deploy-env }}") || (echo "$script_log" && exit 1)
echo -e "---- script log\n$script_log\n----"; \
is_dev=$(echo "$script_log" | tail -n 1)
echo "IS_DEV=$is_dev" >> $GITHUB_ENV
Expand All @@ -47,13 +47,13 @@ jobs:
uses: actions/[email protected]
with:
repository: 'clearlydefined/operations'
ref: 'v1.1.1-rc11'
ref: 'v1.1.1-rc12'
path: 'operations'

- name: Get organization ID
run: |
script_log=$(./operations/scripts/app-workflows/get-org-id.sh \
${{ github.repository_owner }}) || (echo "$script_log" && exit 1)
"${{ github.repository_owner }}") || (echo "$script_log" && exit 1)
echo -e "---- script log\n$script_log\n----"; \
org_id=$(echo "$script_log" | tail -n 1)
echo "ORG_ID=$org_id" >> $GITHUB_ENV
Expand Down
2 changes: 1 addition & 1 deletion tests/scripts/app-workflows/test-determine-image-name.bats
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,5 @@ load 'test_helpers'
@test "invalid deploy environment" {
run ./scripts/app-workflows/determine-image-name.sh test-org/test-repo BAD_ENV test-tag
test_value 1 "$status"
test_value "Invalid deploy environment: BAD_ENV. Must be 'dev' or 'prod'" "${lines[0]}"
test_value "ERROR: Invalid deploy environment: BAD_ENV. Must be 'dev' or 'prod'" "${lines[0]}"
}
2 changes: 1 addition & 1 deletion tests/scripts/app-workflows/test-get-org-id.bats
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@ load 'test_helpers'
@test "missing org name" {
run ./scripts/app-workflows/get-org-id.sh ""
test_value 1 "$status"
test_value "Organization not found: " "${lines[0]}"
test_value "ERROR: Organization not found: " "${lines[0]}"
}
4 changes: 2 additions & 2 deletions tests/scripts/app-workflows/test-get-version.bats
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ package_lock_file="$(dirname "$BATS_TEST_DIRNAME")/app-workflows/fixtures/packag
# fail because version in package-lock.json doesn't match the release tag
run ./scripts/app-workflows/get-version.sh prod true v9.2.0 1234567890ABCDEF "$package_lock_file"
test_value 1 "$status"
test_value "Version in package-lock.json (v10.0.1) does not match the release tag (v9.2.0)" "${lines[0]}"
test_value "ERROR: Version in package-lock.json (v10.0.1) does not match the release tag (v9.2.0)" "${lines[0]}"
}

@test "deploy to prod environment triggered by dispatch" {
Expand All @@ -37,5 +37,5 @@ package_lock_file="$(dirname "$BATS_TEST_DIRNAME")/app-workflows/fixtures/packag
@test "invalid deploy environment" {
run ./scripts/app-workflows/get-version.sh BAD_ENV false v9.2.0 1234567890ABCDEF "$package_lock_file"
test_value 1 "$status"
test_value "Invalid deploy environment: BAD_ENV. Must be 'dev' or 'prod'" "${lines[0]}"
test_value "ERROR: Invalid deploy environment: BAD_ENV. Must be 'dev' or 'prod'" "${lines[0]}"
}

0 comments on commit f2eb475

Please sign in to comment.