Skip to content

Commit

Permalink
Merge pull request #2251 from opengovsg/release-1.77
Browse files Browse the repository at this point in the history
Release 1.77
  • Loading branch information
PikkaPikkachu committed Aug 4, 2023
2 parents 55b55c6 + 6b3e5df commit 026e8fe
Show file tree
Hide file tree
Showing 21 changed files with 771 additions and 38 deletions.
41 changes: 41 additions & 0 deletions .ebextensions/25-load-sgid-env.config
@@ -0,0 +1,41 @@
# loads SGID environment variables to a .env file from SSM

commands:
01-create-env:
command: "/tmp/create-env.sh"

files:
"/tmp/create-env.sh":
mode: "000755"
content : |
#!/bin/bash
ENV_NAME=$(/opt/elasticbeanstalk/bin/get-config environment -k SSM_PREFIX)

ENV_VARS=("SGID_CLIENT_ID" "SGID_CLIENT_SECRET" "SGID_PRIVATE_KEY")

echo "Set AWS region"
aws configure set default.region ap-southeast-1

TARGET_DIR=/etc/gogovsg

echo "Checking if ${TARGET_DIR} exists..."
if [ ! -d ${TARGET_DIR} ]; then
echo "Creating directory ${TARGET_DIR} ..."
mkdir -p ${TARGET_DIR}
if [ $? -ne 0 ]; then
echo 'ERROR: Directory creation failed!'
exit 1
fi
else
echo "Directory ${TARGET_DIR} already exists!"
fi

echo "Creating config for ${ENV_NAME} in ${AWS_REGION}"

for ENV_VAR in "${ENV_VARS[@]}"; do
echo "Running for this ${ENV_NAME}"
echo "Fetching ${ENV_VAR} from SSM"
VALUE=$(aws ssm get-parameter --name "${ENV_NAME}_${ENV_VAR}" --with-decryption --query "Parameter.Value" --output text)
echo "${ENV_VAR}=${VALUE}" >> $TARGET_DIR/.env
echo "Saved ${ENV_VAR}"
done
7 changes: 7 additions & 0 deletions CHANGELOG.md
Expand Up @@ -4,8 +4,15 @@ All notable changes to this project will be documented in this file. Dates are d

Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).

#### [v1.77.0](https://github.com/opengovsg/GoGovSG/compare/v1.76.1...v1.77.0)

- Experiment go <> sgid integration [`#2247`](https://github.com/opengovsg/GoGovSG/pull/2247)
- [develop] 1.76.1 [`#2241`](https://github.com/opengovsg/GoGovSG/pull/2241)

#### [v1.76.1](https://github.com/opengovsg/GoGovSG/compare/v1.76.0...v1.76.1)

> 13 July 2023
- build(deps): bump semver from 7.3.8 to 7.5.4 [`#2239`](https://github.com/opengovsg/GoGovSG/pull/2239)
- build(deps): bump react-vis from 1.11.7 to 1.11.8 [`#2238`](https://github.com/opengovsg/GoGovSG/pull/2238)
- build(deps): bump @sentry/cli from 1.67.2 to 1.75.2 [`#2231`](https://github.com/opengovsg/GoGovSG/pull/2231)
Expand Down
6 changes: 6 additions & 0 deletions Dockerrun.aws.json
Expand Up @@ -8,5 +8,11 @@
{
"ContainerPort": "8080"
}
],
"Volumes": [
{
"HostDirectory": "/etc/gogovsg/.env",
"ContainerDirectory": "/usr/src/gogovsg/.env"
}
]
}
2 changes: 2 additions & 0 deletions docker-compose.yml
Expand Up @@ -28,6 +28,8 @@ services:
- REDIS_SAFE_BROWSING_URI=redis://redis:6379/4
- SESSION_SECRET=thiscouldbeanything
- GA_TRACKING_ID=UA-139330318-1
- SGID_API_HOSTNAME=https://api.id.gov.sg

- OG_URL=https://go.gov.sg
- VALID_EMAIL_GLOB_EXPRESSION=*.gov.sg
- COOKIE_MAX_AGE=86400000
Expand Down

0 comments on commit 026e8fe

Please sign in to comment.