File tree Expand file tree Collapse file tree 3 files changed +23
-5
lines changed
specification/api/components/x-nhsd-apim Expand file tree Collapse file tree 3 files changed +23
-5
lines changed Original file line number Diff line number Diff line change 2727 then
2828 echo "INSTANCE=$PROXYGEN_API_NAME" >> $GITHUB_ENV
2929 echo "TARGET=https://suppliers.dev.nhsnotify.national.nhs.uk" >> $GITHUB_ENV
30+ echo "SANDBOX_TAG=latest" >> $GITHUB_ENV
3031 else
3132 echo "TARGET=https://pr$PR_NUMBER.suppliers.dev.nhsnotify.national.nhs.uk" >> $GITHUB_ENV
3233 echo "INSTANCE=$PROXYGEN_API_NAME-PR-$PR_NUMBER" >> $GITHUB_ENV
34+ echo "SANDBOX_TAG=pr$PR_NUMBER" >> $GITHUB_ENV
3335 fi
3436
3537
7173 run : |
7274 make build-json-oas-spec APIM_ENV=sandbox
7375
76+ - name : Set docker tag
77+ shell : bash
78+ run : |
79+ jq --arg newtag "$SANDBOX_TAG" '.["x-nhsd-apim"].target.containers[0].image.tag = $newtag' build/notify-supplier.json > build/notify-supplier_target.json && mv build/notify-supplier_target.json build/notify-supplier.json
80+
7481 - name : Deploy to Internal Dev Sandbox
7582 shell : bash
7683 run : |
Original file line number Diff line number Diff line change @@ -47,12 +47,23 @@ runs:
4747 envsubst < ./.github/proxygen-settings.yaml > ${HOME}/.proxygen/settings.yaml
4848 envsubst < ./.github/proxygen-settings.yaml | cat
4949
50+ - name : Setup Proxy Name and target
51+ shell : bash
52+ run : |
53+ if [ -z $PR_NUMBER ]
54+ then
55+ echo "SANDBOX_TAG=latest" >> $GITHUB_ENV
56+ else
57+ echo "SANDBOX_TAG=pr$PR_NUMBER" >> $GITHUB_ENV
58+ fi
59+
5060 - name : Build and publish sandbox Docker image
5161 shell : bash
5262 working-directory : ./sandbox
5363 run : |
5464 proxygen docker get-login | bash
55- docker build -t nhs-notify-supplier:latest .
56- IMAGE_ID=$(docker images -q nhs-notify-supplier:latest)
57- docker tag $IMAGE_ID 958002497996.dkr.ecr.eu-west-2.amazonaws.com/nhs-notify-supplier:latest
58- docker push 958002497996.dkr.ecr.eu-west-2.amazonaws.com/nhs-notify-supplier:latest
65+ docker build -t nhs-notify-supplier:$SANDBOX_TAG .
66+ DOCKER_REGISTRY=$(proxygen docker registry | tail -1)
67+ IMAGE_ID=$(docker images -q nhs-notify-supplier:$SANDBOX_TAG)
68+ docker tag $IMAGE_ID $DOCKER_REGISTRY/nhs-notify-supplier:$SANDBOX_TAG
69+ docker push $DOCKER_REGISTRY/nhs-notify-supplier:$SANDBOX_TAG
Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ containers:
44 - name : nhs-notify-supplier
55 image :
66 name : nhs-notify-supplier
7- tag : latest
7+ tag : pr99
88 environment :
99 LOG_LEVEL : info
1010 NODE_ENV : development
You can’t perform that action at this time.
0 commit comments