From d9dcc8b517a1c1bac047f24acf0fc58d9de9794a Mon Sep 17 00:00:00 2001 From: Vikram's Mackbook Pro Date: Tue, 2 May 2023 12:41:29 +0530 Subject: [PATCH 1/5] bucket name replaced --- 01api/petstore-api-buildspec.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/01api/petstore-api-buildspec.yml b/01api/petstore-api-buildspec.yml index af9dce14..8c45eceb 100644 --- a/01api/petstore-api-buildspec.yml +++ b/01api/petstore-api-buildspec.yml @@ -4,7 +4,7 @@ phases: commands: - cd 01api - aws cloudformation package --template-file petstore-api.yaml - --s3-bucket + --s3-bucket kodnest-users --s3-prefix api-code --output-template-file petstore-api-output.yaml artifacts: From db9b28f362db719d0c840aa56a573d772e68962e Mon Sep 17 00:00:00 2001 From: Vikram's Mackbook Pro Date: Tue, 2 May 2023 16:31:50 +0530 Subject: [PATCH 2/5] env file updated --- 02postman/PetStoreAPI.postman_collection.json | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/02postman/PetStoreAPI.postman_collection.json b/02postman/PetStoreAPI.postman_collection.json index 6a4f9d1f..86c81ab8 100644 --- a/02postman/PetStoreAPI.postman_collection.json +++ b/02postman/PetStoreAPI.postman_collection.json @@ -52,9 +52,9 @@ "method": "GET", "header": [], "url": { - "raw": "{{apigw-root}}/pets", + "raw": "{{base_url}}/pets", "host": [ - "{{apigw-root}}" + "{{base_url}}" ], "path": [ "pets" @@ -121,9 +121,9 @@ "raw": "{\n\t\"type\":\"Lizzard\",\n\t\"price\": 3.50\n}" }, "url": { - "raw": "{{apigw-root}}/pets", + "raw": "{{base_url}}/pets", "host": [ - "{{apigw-root}}" + "{{base_url}}" ], "path": [ "pets" @@ -180,9 +180,9 @@ "method": "GET", "header": [], "url": { - "raw": "{{apigw-root}}/pets/3", + "raw": "{{base_url}}/pets/3", "host": [ - "{{apigw-root}}" + "{{base_url}}" ], "path": [ "pets", From 07e3e4fdd76e634bfe5624e531d1b78af989462a Mon Sep 17 00:00:00 2001 From: Vikram's Mackbook Pro Date: Tue, 2 May 2023 18:10:06 +0530 Subject: [PATCH 3/5] new yml is added --- 03codebuild/postman-newman-buildspec.yml | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/03codebuild/postman-newman-buildspec.yml b/03codebuild/postman-newman-buildspec.yml index cb7c0af4..61b88999 100644 --- a/03codebuild/postman-newman-buildspec.yml +++ b/03codebuild/postman-newman-buildspec.yml @@ -2,21 +2,22 @@ version: 0.2 env: variables: - key: "S3_BUCKET" + S3_BUCKET: "kodnest-users" phases: install: runtime-versions: nodejs: 10 - commands: #https://learning.getpostman.com/docs/postman/collection-runs/command-line-integration-with-newman/ + commands: - npm install -g newman - yum install -y jq pre_build: commands: - - aws s3 cp "s3://${S3_BUCKET}/postman-env-files/PetStoreAPIEnvironment.postman_environment.json" ./02postman/ - - aws s3 cp "s3://${S3_BUCKET}/postman-env-files/PetStoreAPI.postman_collection.json" ./02postman/ + - aws s3 cp s3://${S3_BUCKET}/postman-env-files/PetStoreAPIEnvironment.postman_environment.json ./02postman/ + - aws s3 cp s3://${S3_BUCKET}/postman-env-files/PetStoreAPI.postman_collection.json ./02postman/ - cd ./02postman + - chmod +x ./update-postman-env-file.sh - ./update-postman-env-file.sh build: @@ -24,8 +25,13 @@ phases: - echo Build started on `date` from dir `pwd` - newman run PetStoreAPI.postman_collection.json --environment PetStoreAPIEnvironment.postman_environment.json -r junit + post_build: + commands: + - echo Tests completed on `date` + - aws s3 cp ./02postman/newman/ s3://${S3_BUCKET}/postman-reports/ --recursive --exclude "*" --include "*.xml" + reports: - JUnitReports: # CodeBuild will create a report group called "SurefireReports". - files: #Store all of the files - - '**/*' - base-directory: '02postman/newman' # Location of the reports + junitreports: + files: + - '**/*.xml' + base-directory: '02postman/newman' From 7fe7665e53bfd58cd32d24bebe28d5bda9dba217 Mon Sep 17 00:00:00 2001 From: Vikram's Mackbook Pro Date: Tue, 2 May 2023 19:11:47 +0530 Subject: [PATCH 4/5] new yml is added --- 03codebuild/postman-newman-buildspec.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/03codebuild/postman-newman-buildspec.yml b/03codebuild/postman-newman-buildspec.yml index 61b88999..0e687fa8 100644 --- a/03codebuild/postman-newman-buildspec.yml +++ b/03codebuild/postman-newman-buildspec.yml @@ -23,7 +23,7 @@ phases: build: commands: - echo Build started on `date` from dir `pwd` - - newman run PetStoreAPI.postman_collection.json --environment PetStoreAPIEnvironment.postman_environment.json -r junit + - newman run "PetStoreAPI.postman_collection.json" --environment "PetStoreAPIEnvironment.postman_environment.json" --reporters "cli,junit" --reporter-junit-export "newman-report.xml" post_build: commands: From 66f3b37b309389b6a504990e35dd60d0f8f46010 Mon Sep 17 00:00:00 2001 From: Vikram's Mackbook Pro Date: Tue, 2 May 2023 19:26:45 +0530 Subject: [PATCH 5/5] new yml is added --- 02postman/PetStoreAPIEnvironment.postman_environment.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/02postman/PetStoreAPIEnvironment.postman_environment.json b/02postman/PetStoreAPIEnvironment.postman_environment.json index f163aa9b..67be7e2f 100644 --- a/02postman/PetStoreAPIEnvironment.postman_environment.json +++ b/02postman/PetStoreAPIEnvironment.postman_environment.json @@ -4,7 +4,7 @@ "values": [ { "key": "apigw-root", - "value": "https://g228ynt8yb.execute-api.us-east-1.amazonaws.com/prod", + "value": "http://petstore-demo-endpoint.execute-api.com", "enabled": true } ],