Skip to content

Commit

Permalink
fix(ci): updating ci names
Browse files Browse the repository at this point in the history
  • Loading branch information
bassrock committed Aug 15, 2024
1 parent a07bd0b commit 5686e70
Show file tree
Hide file tree
Showing 8 changed files with 21 additions and 38 deletions.
2 changes: 1 addition & 1 deletion .github/actions/cdktf/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ runs:
cd ${{ inputs.stack-output-path }}
if [ "${{ inputs.behavior }}" = "apply" ]; then
echo "Apply behavior specified, applying terraform configuration in ${{ inputs.environment }}."
terraform apply
terraform apply --auto-approve
else
echo "Plan behavior specified, planning terraform configuration in ${{ inputs.environment }}."
tfcmt --var target:${{ inputs.scope }}-${{ inputs.environment }} plan --skip-no-changes --patch -- terraform plan -lock-timeout=10m
Expand Down
3 changes: 1 addition & 2 deletions .github/actions/containerize/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,5 +79,4 @@ runs:
id: get-build-name
shell: bash
run: |
imageName=${{ fromJSON(steps.docker-build-push.outputs.metadata)['image.name'] }}
echo "::set-output name=docker-image-name::$imageName"
echo "docker-image-name=${{inputs.docker-repo-name}}:${{ github.sha }}" >> $GITHUB_OUTPUT
33 changes: 7 additions & 26 deletions .github/actions/ecs-codedeploy/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,32 +10,13 @@ inputs:

runs:
using: 'composite'
steps:
# Pulls out the terraform params needed for CodeDeploy and then re-saves them to be used in the CodeDeploy ORB
# - name: Load CodeDeploy Params from Terraform Output
# shell: bash
# run: |
# TF_OUTPUT=${{inputs.terraform-output}}
# ECS_TASK_ARN=$(echo "$TF_OUTPUT" | jq -r '.["ecs-task-arn"].value')
# ECS_TASK_CONTAINER_NAME=$(echo "$TF_OUTPUT" | jq -r '.["ecs-task-containerName"].value')
# ECS_TASK_CONTAINER_PORT=$(echo "$TF_OUTPUT" | jq -r '.["ecs-task-containerPort"].value')
# ECS_TASK_FAMILY=$(echo "$TF_OUTPUT" | jq -r '.["ecs-task-family"].value')
# ECS_CODEDEPLOY_GROUP=$(echo "$TF_OUTPUT" | jq -r '.["ecs-codedeploy-group"].value')
# ECS_CODEDEPLOY_APP=$(echo "$TF_OUTPUT" | jq -r '.["ecs-codedeploy-app"].value')

# echo "export ECS_TASK_ARN=$ECS_TASK_ARN" >> $GITHUB_ENV
# echo "export ECS_TASK_CONTAINER_NAME=$ECS_TASK_CONTAINER_NAME" >> $GITHUB_ENV
# echo "export ECS_TASK_CONTAINER_PORT=$ECS_TASK_CONTAINER_PORT" >> $GITHUB_ENV
# echo "export ECS_TASK_FAMILY=$ECS_TASK_FAMILY" >> $GITHUB_ENV
# echo "export ECS_CODEDEPLOY_GROUP=$ECS_CODEDEPLOY_GROUP" >> $GITHUB_ENV
# echo "export ECS_CODEDEPLOY_APP=$ECS_CODEDEPLOY_APP" >> $GITHUB_ENV

steps:
- name: Render Amazon ECS task definition
id: task-def
uses: aws-actions/amazon-ecs-render-task-definition@v1
with:
task-definition-family: ${{ fromJSON(inputs.terraform-output).ecs-task-family }}
container-name: ${{ fromJSON(inputs.terraform-output).ecs-task-containerName }}
task-definition-family: ${{ fromJSON(inputs.terraform-output).ecs-task-family.value }}
container-name: ${{ fromJSON(inputs.terraform-output).ecs-task-containerName.value }}
image: ${{ inputs.docker-image-name }}
- name: Render Amazon ECS App Spec
shell: bash
Expand All @@ -50,8 +31,8 @@ runs:
"Properties": {
"TaskDefinition": "",
"LoadBalancerInfo": {
"ContainerName": "${{ fromJSON(inputs.terraform-output).ecs-task-containerName }}",
"ContainerPort": ${{ fromJSON(inputs.terraform-output).ecs-task-containerPort }}
"ContainerName": "${{ fromJSON(inputs.terraform-output).ecs-task-containerName.value }}",
"ContainerPort": ${{ fromJSON(inputs.terraform-output).ecs-task-containerPort.value }}
}
}
}
Expand All @@ -66,5 +47,5 @@ runs:
wait-for-service-stability: true
wait-for-task-stopped: false
codedeploy-appspec: appspec.json
codedeploy-application: ${{ fromJSON(inputs.terraform-output).ecs-codedeploy-app }}
codedeploy-deployment-group: ${{ env.ecs-codedeploy-group }}
codedeploy-application: ${{ fromJSON(inputs.terraform-output).ecs-codedeploy-app.value }}
codedeploy-deployment-group: ${{ env.ecs-codedeploy-group.value }}
2 changes: 1 addition & 1 deletion .github/actions/raw-terraform/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ runs:
cd ${{ inputs.stack-output-path }}
if [ "${{ inputs.behavior }}" = "apply" ]; then
echo "Apply behavior specified, applying terraform configuration in ${{ inputs.environment }}."
terraform apply
terraform apply --auto-approve
else
echo "Plan behavior specified, planning terraform configuration in ${{ inputs.environment }}."
tfcmt --var target:${{ inputs.scope }}-${{ inputs.environment }} plan --skip-no-changes --patch -- terraform plan -lock-timeout=10m
Expand Down
7 changes: 4 additions & 3 deletions .github/workflows/account-data-deleter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ jobs:
secrets: inherit

# Let's try building and conidtionally pushing our docker image to the necessary account.
build-and-push-image:
api:
uses: ./.github/workflows/reuse-build-and-push-image.yml
needs: [infrastructure]
with:
Expand All @@ -49,10 +49,11 @@ jobs:
app-port: 4015
sentry-project: account-data-deleter
docker-repo-name-pattern: accountdatadeleter-{0}-app
terraform-output: ${{needs.infrastructure.outputs.terraform-output}}
# Ensure the re-usable workflow is allowed to access the secrets
secrets: inherit

build-and-push-lambda-events:
events-lambda:
uses: ./.github/workflows/reuse-build-and-push-lambda.yml
needs: [infrastructure]
with:
Expand All @@ -62,7 +63,7 @@ jobs:
# Ensure the re-usable workflow is allowed to access the secrets
secrets: inherit

build-and-push-lambda-batch-delete:
batch-delete-lambda:
uses: ./.github/workflows/reuse-build-and-push-lambda.yml
needs: [infrastructure]
with:
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/list-api.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,15 @@ jobs:
# Ensure the re-usable workflow is allowed to access the secrets
secrets: inherit

build-and-push-image:
api:
uses: ./.github/workflows/reuse-build-and-push-image.yml
needs: [infrastructure]
with:
scope: list-api
app-path: servers/list-api
app-port: 4005
sentry-project: list-api
docker-repo-name-pattern: listapi-{0}-app
terraform-output: ${{needs.infrastructure.outputs.terraform-output}}
# Ensure the re-usable workflow is allowed to access the secrets
secrets: inherit
5 changes: 2 additions & 3 deletions .github/workflows/reuse-infrastructure.yml
Original file line number Diff line number Diff line change
Expand Up @@ -135,11 +135,10 @@ jobs:
pagerduty-token: ${{ secrets.PAGERDUTY_TOKEN }}
terraform-token: ${{ secrets.TERRAFORM_TOKEN }}

- name: Set Output Based on Condition
- name: Set terraform output
id: set_output
run: |
echo "Grabbing Terraform Output"
cd ${{inputs['stack-output-path']}}
echo "terraform-output=$(terraform output -json)" >> $GITHUB_OUTPUT
echo '::set-output name=terraform-output::'
echo "terraform-output=$(terraform output -json | jq -c)" >> $GITHUB_OUTPUT
3 changes: 2 additions & 1 deletion .github/workflows/user-api.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:
secrets: inherit

# Let's try building and conidtionally pushing our docker image to the necessary account.
build-and-push-image:
api:
uses: ./.github/workflows/reuse-build-and-push-image.yml
needs: [infrastructure]
with:
Expand All @@ -47,6 +47,7 @@ jobs:
app-port: 4006
sentry-project: user-api
docker-repo-name-pattern: userapi-{0}-app
terraform-output: ${{needs.infrastructure.outputs.terraform-output}}
# Ensure the re-usable workflow is allowed to access the secrets
secrets: inherit

Expand Down

0 comments on commit 5686e70

Please sign in to comment.