Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
93 changes: 46 additions & 47 deletions .github/workflows/dev_sandbox_publish_deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,50 +23,49 @@ jobs:
echo "Deploying to: DEV & Sandbox"
echo "VERSION=${{ steps.variables.outputs.version }}"

# internal-dev:
# name: "Publish spec & deploy to dev"
# needs: metadata
# runs-on: ubuntu-latest
# if: false # Skip this job
# steps:
# - name: Checkout repository
# uses: actions/checkout@v6
#
# - name: Set up Python 3.11
# uses: actions/setup-python@v6
# with:
# python-version: '3.11'
#
# - name: Set up Node.js
# uses: actions/setup-node@v6
# with:
# node-version: '20'
#
# - name: Install Poetry
# run: curl -sSL https://install.python-poetry.org | python3 -
#
# - name: Install Python and Node dependencies
# run: |
# make install
#
# - name: Install proxygen-cli
# run: |
# pip install proxygen-cli
#
# - name: Set up Proxygen credentials
# env:
# PROXYGEN_PRIVATE_KEY: ${{ secrets.PROXYGEN_PRIVATE_KEY_PTL }}
# run: |
# mkdir -p ~/.proxygen
# echo "$PROXYGEN_PRIVATE_KEY" > ~/.proxygen/eligibility-signposting-api.pem
# make setup-proxygen-credentials ENV=ptl
# - name: Generate specification
# run: |
# make construct-spec APIM_ENV=internal-dev
#
# - name: Deploy internal-dev spec to Proxygen
# run: |
# proxygen instance deploy internal-dev eligibility-signposting-api build/specification/internal-dev/eligibility-signposting-api.yaml --no-confirm
internal-dev:
name: "Publish spec & deploy to dev"
needs: metadata
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v6

- name: Set up Python 3.11
uses: actions/setup-python@v6
with:
python-version: '3.11'

- name: Set up Node.js
uses: actions/setup-node@v6
with:
node-version: '20'

- name: Install Poetry
run: curl -sSL https://install.python-poetry.org | python3 -

- name: Install Python and Node dependencies
run: |
make install

- name: Install proxygen-cli
run: |
pip install proxygen-cli

- name: Set up Proxygen credentials
env:
PROXYGEN_PRIVATE_KEY: ${{ secrets.PROXYGEN_PRIVATE_KEY_PROD }}
run: |
mkdir -p ~/.proxygen
echo "$PROXYGEN_PRIVATE_KEY" > ~/.proxygen/eligibility-signposting-api.pem
make setup-proxygen-credentials
- name: Generate specification
run: |
make construct-spec APIM_ENV=internal-dev

- name: Deploy internal-dev spec to Proxygen
run: |
proxygen instance deploy internal-dev eligibility-signposting-api build/specification/internal-dev/eligibility-signposting-api.yaml --no-confirm

sandbox:
name: "Publish spec & deploy to sandbox"
Expand Down Expand Up @@ -102,8 +101,8 @@ jobs:
PROXYGEN_PRIVATE_KEY: ${{ secrets.PROXYGEN_PRIVATE_KEY_PROD }}
run: |
mkdir -p ~/.proxygen
echo "$PROXYGEN_PRIVATE_KEY" > ~/.proxygen/eligibility-signposting-api-prod.pem
make setup-proxygen-credentials ENV=prod
echo "$PROXYGEN_PRIVATE_KEY" > ~/.proxygen/eligibility-signposting-api.pem
make setup-proxygen-credentials

- name: Generate specification
run: |
Expand Down Expand Up @@ -159,7 +158,7 @@ jobs:

tag_deployment:
name: "Tag Dev & Sandbox deployment"
needs: [metadata, publish_postman]
needs: [ metadata, publish_postman ]
runs-on: ubuntu-latest
steps:
- name: Checkout repository
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/preprod_publish_deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ jobs:
run: |
mkdir -p ~/.proxygen
echo "$PROXYGEN_PRIVATE_KEY" > ~/.proxygen/eligibility-signposting-api.pem
make setup-proxygen-credentials ENV=prod
make setup-proxygen-credentials
- name: Generate specification
run: |
make construct-spec APIM_ENV=preprod
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/prod_publish_deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ jobs:
run: |
mkdir -p ~/.proxygen
echo "$PROXYGEN_PRIVATE_KEY" > ~/.proxygen/eligibility-signposting-api.pem
make setup-proxygen-credentials ENV=prod
make setup-proxygen-credentials
- name: Generate specification
run: |
make construct-spec APIM_ENV=prod
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish-specification.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ jobs:
run: |
mkdir -p ~/.proxygen
echo "$PROXYGEN_PRIVATE_KEY" > ~/.proxygen/eligibility-signposting-api.pem
make setup-proxygen-credentials ENV=prod
make setup-proxygen-credentials

- name: Generate specification
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish_sandbox.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ jobs:
run: |
mkdir -p ~/.proxygen
echo "$PROXYGEN_PRIVATE_KEY" > ~/.proxygen/eligibility-signposting-api.pem
make setup-proxygen-credentials ENV=prod
make setup-proxygen-credentials

- name: Generate sandbox specification
run: |
Expand Down
27 changes: 12 additions & 15 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -55,44 +55,41 @@ config:: # Configure development environment (main) @Configuration

# Verify current AWS account login and retrieve the proxygen key
# from AWS SSM Parameter Store
retrieve-proxygen-key: guard-ENV
retrieve-proxygen-key:
@ ./scripts/check-aws-account.sh
mkdir -p ~/.proxygen
aws ssm get-parameter --name /$$ENV/proxygen/private_key --with-decryption \
aws ssm get-parameter --name /prod/proxygen/private_key --with-decryption \
| jq -r ".Parameter.Value" \
> ~/.proxygen/eligibility-signposting-api-$(ENV).pem && \
echo "Retrieved proxygen key for APIM '$(ENV)' environment"
> ~/.proxygen/eligibility-signposting-api.pem && \
echo "Retrieved proxygen key for APIM 'Prod' environment"

# Copy proxygen credentials for the specified environment to `~/.proxygen/`
# This location required location for local proxygen usage
setup-proxygen-credentials: guard-ENV
@ cd specification && \
cp .proxygen/credentials-$(ENV).yaml ~/.proxygen/credentials.yaml && \
cp .proxygen/settings-$(ENV).yaml ~/.proxygen/settings.yaml && \
echo "Set up proxygen credentials for the APIM '$(ENV)' environment"
setup-proxygen-credentials:
@ cd specification && cp -r .proxygen ~

get-spec: # Get the most recent specification live in proxygen
$(MAKE) setup-proxygen-credentials ENV=prod
$(MAKE) setup-proxygen-credentials
proxygen spec get

get-spec-uat: # Get the most recent specification live in proxygen
$(MAKE) setup-proxygen-credentials ENV=prod
$(MAKE) setup-proxygen-credentials
proxygen spec get --uat

publish-spec: # Publish the specification to proxygen
$(MAKE) setup-proxygen-credentials ENV=prod
$(MAKE) setup-proxygen-credentials
proxygen spec publish build/specification/prod/eligibility-signposting-api.yaml

publish-spec-uat: # Publish the specification to proxygen
$(MAKE) setup-proxygen-credentials ENV=prod
$(MAKE) setup-proxygen-credentials
proxygen spec publish build/specification/preprod/eligibility-signposting-api.yaml --uat

delete-spec: # Delete the specification from proxygen
$(MAKE) setup-proxygen-credentials ENV=prod
$(MAKE) setup-proxygen-credentials
proxygen spec delete

delete-spec-uat: # Delete the specification from proxygen
$(MAKE) setup-proxygen-credentials ENV=prod
$(MAKE) setup-proxygen-credentials
proxygen spec delete --uat

#####################
Expand Down
4 changes: 2 additions & 2 deletions sandbox/Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
SHELL := /bin/bash
ENV ?= prod

dirname := $(notdir $(patsubst %/,%,$(CURDIR)))
project_name = eligibility-signposting-api

Expand All @@ -23,7 +23,7 @@ build-and-tag:
make tag-service-image

proxygen-docker-login: # Login to Proxygen Docker registry
make -C .. setup-proxygen-credentials ENV=$(ENV)
make -C .. setup-proxygen-credentials
proxygen docker get-login | bash

publish-to-docker-repo:
Expand Down
5 changes: 0 additions & 5 deletions specification/.proxygen/credentials-prod.yaml

This file was deleted.

4 changes: 0 additions & 4 deletions specification/.proxygen/credentials-ptl.yaml

This file was deleted.

2 changes: 1 addition & 1 deletion specification/.proxygen/credentials.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
client_id: eligibility-signposting-api-client
private_key_path: eligibility-signposting-api.pem
key_id: eligibility-signposting-api
key_id: 2027-01-21-Prod-eligibility-signposting-api
3 changes: 0 additions & 3 deletions specification/.proxygen/settings-prod.yaml

This file was deleted.

3 changes: 0 additions & 3 deletions specification/.proxygen/settings-ptl.yaml

This file was deleted.

Loading