Skip to content

Commit

Permalink
Fix postman workflow (#294)
Browse files Browse the repository at this point in the history
  • Loading branch information
jeffreyscarpenter authored Mar 30, 2023
1 parent f23e680 commit ea5f5a1
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 5 deletions.
16 changes: 13 additions & 3 deletions .github/workflows/performance-testing.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,13 @@ jobs:
with:
ref: main

- name: Set up JDK 17
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '17'
cache: maven

# login to ECR to we can pull coord image from there
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v2
Expand All @@ -69,16 +76,19 @@ jobs:

# Use docker-compose to start required stack
# Pull JSON API image from ECR corresponding to latest commit on main branch
# Retag JSON API image to remove repository name since start script does not expect it
# Pull Stargate coordinator image from ECR corresponding to version dependency in project pom
# Retag images to remove repository name since start script does not expect it
# Print version of images used for verification
- name: Start Docker Compose
run: |
JSONTAG=$(git show -s --format="%H")
docker pull ${{ secrets.ECR_REPOSITORY }}/stargateio/${{ matrix.docker-image }}:$JSONTAG
docker image tag ${{ secrets.ECR_REPOSITORY }}/stargateio/${{ matrix.docker-image }}:$JSONTAG stargateio/${{ matrix.docker-image }}:$JSONTAG
SGTAG="$(./mvnw -f . help:evaluate -Dexpression=stargate.int-test.coordinator.image-tag -q -DforceStdout)"
docker pull ${{ secrets.ECR_REPOSITORY }}/stargateio/coordinator-dse-68:$SGTAG
docker image tag ${{ secrets.ECR_REPOSITORY }}/stargateio/coordinator-dse-68:$SGTAG stargateio/coordinator-dse-68:$SGTAG
cd docker-compose
./start_dse_68_dev_mode.sh ${{ matrix.docker-flags }} -j $JSONTAG
docker-compose images
./start_dse_68_dev_mode.sh ${{ matrix.docker-flags }} -j $JSONTAG -t $SGTAG
# Install NB and required library
# See: https://github.com/AppImage/AppImageKit/wiki/FUSE
Expand Down
40 changes: 38 additions & 2 deletions .github/workflows/postman-docker.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,20 +19,56 @@ jobs:
COLLECTION_ID: 25879866-266032b1-1fe9-4abd-aee9-e6e4b335f921
ENVIRONMENT_ID: 12949543-2e78cf27-bd8c-43f2-909f-70a2b87d65fe
steps:
# force checkout of main branch so we get a SHA that will have a corresponding docker image tag in ECR
- uses: actions/checkout@v3
with:
ref: main

- name: Set up JDK 17
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '17'
cache: maven

# login to ECR to we can pull coord image from there
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v2
with:
aws-access-key-id: ${{ secrets.ECR_ACCESS_KEY }}
aws-secret-access-key: ${{ secrets.ECR_SECRET_KEY }}
aws-region: us-east-1

- name: Login to Amazon ECR
id: login-ecr
uses: aws-actions/amazon-ecr-login@v1

- name: Install Postman CLI
run: |
curl -o- "https://dl-cli.pstmn.io/install/linux64.sh" | sh
- name: Login to Postman CLI
run: postman login --with-api-key ${{ secrets.POSTMAN_API_KEY }}
- name: Start Backend

# Run Stargate coordinator in developer mode to save time / resources
# Pull JSON API image from ECR corresponding to latest commit on main branch
# Pull Stargate coordinator image from ECR corresponding to version dependency in project pom
# Retag images to remove repository name since start script does not expect it
- name: Start Backend
run: |
JSONTAG=$(git show -s --format="%H")
docker pull ${{ secrets.ECR_REPOSITORY }}/stargateio/jsonapi:$JSONTAG
docker image tag ${{ secrets.ECR_REPOSITORY }}/stargateio/jsonapi:$JSONTAG stargateio/jsonapi:$JSONTAG
SGTAG="$(./mvnw -f . help:evaluate -Dexpression=stargate.int-test.coordinator.image-tag -q -DforceStdout)"
docker pull ${{ secrets.ECR_REPOSITORY }}/stargateio/coordinator-dse-68:$SGTAG
docker image tag ${{ secrets.ECR_REPOSITORY }}/stargateio/coordinator-dse-68:$SGTAG stargateio/coordinator-dse-68:$SGTAG
cd docker-compose
./start_dse_68_dev_mode.sh
./start_dse_68_dev_mode.sh -j $JSONTAG -t $SGTAG
- name: Run API test
run: |
postman collection run $COLLECTION_ID -e $ENVIRONMENT_ID --verbose
- name: Stop Backend
if: always()
run: |
Expand Down

0 comments on commit ea5f5a1

Please sign in to comment.