Skip to content

Commit

Permalink
Add possibility to make cdk diff
Browse files Browse the repository at this point in the history
  • Loading branch information
MikkoKauhanen committed Dec 12, 2024
1 parent 54ff5f3 commit 7fc45cc
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 6 deletions.
14 changes: 12 additions & 2 deletions .github/workflows/deploy_dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ on:
branch:
description: Branch to deploy
required: true
proceedDeploy:
description: Set to true to skip CDK diff and directly proceed with deployment. Default is false.
required: true
default: 'false'

concurrency: deploy-dev

Expand Down Expand Up @@ -37,6 +41,12 @@ jobs:
role-to-assume: ${{ secrets.AWS_AOE_DEV_ROLE_ARN }}
role-session-name: aoe-runner-deploy-dev
aws-region: eu-west-1
- name: Deploy DEV
run: ./deploy-scripts/04-deploy-dev.sh

- name: Run CDK Diff
if: ${{ github.event.inputs.proceedDeploy == 'false' }}
run: ./deploy-scripts/04-deploy-dev.sh diff

- name: Run CDK Deploy
if: ${{ github.event.inputs.proceedDeploy == 'true' }}
run: ./deploy-scripts/04-deploy-dev.sh deploy

26 changes: 22 additions & 4 deletions deploy-scripts/deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,38 @@ set -o errexit -o nounset -o pipefail
# shellcheck source=../scripts/common-functions.sh
source "$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )/../scripts/common-functions.sh"

ACTION=$1

function main {
start_gh_actions_group "Setup"
parse_env_from_script_name "..-deploy"
use_correct_node_version
end_gh_actions_group

start_gh_actions_group "Deploy $ENV"
deploy
end_gh_actions_group


if [[ "$ACTION" == "diff" ]]; then
start_gh_actions_group "Diff $ENV"
diff
end_gh_actions_group
elif [[ "$ACTION" == "deploy" ]]; then
start_gh_actions_group "Deploy $ENV"
deploy
end_gh_actions_group
fi


}

function deploy {
pushd "$repo"/aoe-infra/infra
"./cdk.sh" diff # deploy --all
"./cdk.sh" deploy --all
popd
}

function diff {
pushd "$repo"/aoe-infra/infra
"./cdk.sh" diff
popd
}

Expand Down

0 comments on commit 7fc45cc

Please sign in to comment.