|
|
|
@ -15,11 +15,6 @@ defaults: |
|
|
|
run: |
|
|
|
run: |
|
|
|
shell: bash |
|
|
|
shell: bash |
|
|
|
|
|
|
|
|
|
|
|
env: |
|
|
|
|
|
|
|
app_repo_role: arn:aws:iam::815624722760:role/core-application-repo |
|
|
|
|
|
|
|
aws_region: eu-west-2 |
|
|
|
|
|
|
|
repository: core |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
jobs: |
|
|
|
jobs: |
|
|
|
infra: |
|
|
|
infra: |
|
|
|
name: Deploy review app infrastructure |
|
|
|
name: Deploy review app infrastructure |
|
|
|
@ -43,51 +38,6 @@ jobs: |
|
|
|
permissions: |
|
|
|
permissions: |
|
|
|
id-token: write |
|
|
|
id-token: write |
|
|
|
|
|
|
|
|
|
|
|
performance: |
|
|
|
|
|
|
|
needs: [code] |
|
|
|
|
|
|
|
runs-on: ubuntu-latest |
|
|
|
|
|
|
|
permissions: |
|
|
|
|
|
|
|
id-token: write |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
steps: |
|
|
|
|
|
|
|
- name: Configure AWS credentials |
|
|
|
|
|
|
|
uses: aws-actions/configure-aws-credentials@v3 |
|
|
|
|
|
|
|
with: |
|
|
|
|
|
|
|
aws-region: ${{ env.aws_region }} |
|
|
|
|
|
|
|
role-to-assume: ${{ env.app_repo_role }} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
- name: Configure AWS credentials for the environment |
|
|
|
|
|
|
|
uses: aws-actions/configure-aws-credentials@v3 |
|
|
|
|
|
|
|
with: |
|
|
|
|
|
|
|
aws-region: eu-west-2 |
|
|
|
|
|
|
|
role-to-assume: arn:aws:iam::837698168072:role/core-dev-deployment |
|
|
|
|
|
|
|
role-chaining: true |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
- name: Run Performance Test |
|
|
|
|
|
|
|
env: |
|
|
|
|
|
|
|
ad_hoc_task_definition: core-review-${{ github.event.pull_request.number }}-ad-hoc |
|
|
|
|
|
|
|
cluster: core-review-${{ github.event.pull_request.number }}-app |
|
|
|
|
|
|
|
service: core-review-${{ github.event.pull_request.number }}-app |
|
|
|
|
|
|
|
run: | |
|
|
|
|
|
|
|
echo $cluster |
|
|
|
|
|
|
|
network=$(aws ecs describe-services --cluster $cluster --services $service --query services[0].networkConfiguration) |
|
|
|
|
|
|
|
overrides='{ |
|
|
|
|
|
|
|
"containerOverrides": [{ |
|
|
|
|
|
|
|
"name": "app", |
|
|
|
|
|
|
|
"command": ["bash", "-c", "export email=$STAGING_PERFORMANCE_TEST_EMAIL && export password=$STAGING_PERFORMANCE_TEST_PASSWORD && sh ./lib/tasks/performance_test.sh"] |
|
|
|
|
|
|
|
}] |
|
|
|
|
|
|
|
}' |
|
|
|
|
|
|
|
arn=$(aws ecs run-task --cluster $cluster --task-definition $ad_hoc_task_definition --network-configuration "$network" --overrides "$overrides" --group migrations --launch-type FARGATE --query tasks[0].taskArn) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
echo "Waiting for performance tests to run" |
|
|
|
|
|
|
|
task_id=${arn##*/} |
|
|
|
|
|
|
|
task_id=${task_id%*\"} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
aws ecs wait tasks-stopped --cluster $cluster --tasks $task_id |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
code=$(aws ecs describe-tasks --cluster $cluster --tasks $task_id --query "tasks[0].containers[0].exitCode") |
|
|
|
|
|
|
|
if [ "$code == 0" ]; then exit 0; else exit 1; fi |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
comment: |
|
|
|
comment: |
|
|
|
name: Add link to PR |
|
|
|
name: Add link to PR |
|
|
|
needs: [code] |
|
|
|
needs: [code] |
|
|
|
|