diff --git a/.github/workflows/review_pipeline.yml b/.github/workflows/review_pipeline.yml
index dd9544ae4..944396c36 100644
--- a/.github/workflows/review_pipeline.yml
+++ b/.github/workflows/review_pipeline.yml
@@ -15,6 +15,10 @@ defaults:
run:
shell: bash
+env:
+ app_repo_role: arn:aws:iam::815624722760:role/core-application-repo
+ aws_region: eu-west-2
+
jobs:
infra:
name: Deploy review app infrastructure
@@ -41,48 +45,41 @@ jobs:
performance:
needs: [code]
runs-on: ubuntu-latest
+ with:
+ aws_role_prefix: core-dev
+ aws_task_prefix: core-review-${{ github.event.pull_request.number }}
+ environment: review
steps:
- - name: Install Apache Benchmark (ab)
- run: sudo apt-get update && sudo apt-get install -y apache2-utils
+ - 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: Login to Amazon ECR
+ id: ecr-login
+ uses: aws-actions/amazon-ecr-login@v1
+ with:
+ mask-password: "true"
- name: Run Performance Test
+ env:
+ ad_hoc_task_definition: ${{ inputs.aws_task_prefix }}-ad-hoc
+ cluster: ${{ inputs.aws_task_prefix }}-app
+ service: ${{ inputs.aws_task_prefix }}-app
+ email: performance_testing_user@example.com
+ password: password
run: |
- echo "test curl"
- curl https://review.submit-social-housing-data.levellingup.gov.uk/${{ github.event.pull_request.number }}/account/sign-in
-
- echo "Fetching CSRF token..."
- TOKEN=$(curl -c token_cookies.txt -s https://review.submit-social-housing-data.levellingup.gov.uk/${{ github.event.pull_request.number }}/account/sign-in | grep ' :environment do |_task, args|
+ email = Rails.root.join(args[:email])
+ password = Rails.root.join(args[:password])
+
+ system("echo install apache2-utils")
+ system("apt-get update && apt-get install curl && apt-get install -y apache2-utils")
+ system("echo get token")
+ token = `curl -c token_cookies.txt -s https://review.submit-social-housing-data.levellingup.gov.uk/2621/account/sign-in | grep '