Skip to content

Commit 9a8db91

Browse files
committed
update README
1 parent 9365367 commit 9a8db91

File tree

1 file changed

+36
-1
lines changed

1 file changed

+36
-1
lines changed

lambda_data_logger/README.md

Lines changed: 36 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -243,4 +243,39 @@ Delete the service resources by running the following ensuring your reference th
243243
terraform refresh -var-file=env/dev/dev.tfvars
244244
245245
terraform destroy -var-file=env/dev/dev.tfvars
246-
```
246+
```
247+
248+
### Deployments with Concourse
249+
250+
#### Allowlisting your IP
251+
To setup the deployment pipeline with concourse, you must first allowlist your IP address on the Concourse
252+
server. IP addresses are flushed everyday at 00:00 so this must be done at the beginning of every working day
253+
whenever the deployment pipeline needs to be used. Follow the instructions on the Confluence page (SDP Homepage > SDP Concourse > Concourse Login) to
254+
login. All our pipelines run on sdp-pipeline-prod, whereas sdp-pipeline-dev is the account used for
255+
changes to Concourse instance itself. Make sure to export all necessary environment variables from sdp-pipeline-prod (AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, AWS_SESSION_TOKEN).
256+
257+
#### Setting up a pipeline
258+
When setting up our pipelines, we use ecs-infra-user on sdp-dev to be able to interact with our infrastructure on AWS. The credentials for this are stored on
259+
AWS Secrets Manager so you do not need to set up anything yourself.
260+
261+
To set the pipeline, run the following script:
262+
```bash
263+
chmod u+x ./concourse/scripts/set_pipeline.sh
264+
./concourse/scripts/set_pipeline.sh github-copilot-usage-lambda
265+
```
266+
Note that you only have to run chmod the first time running the script in order to give permissions.
267+
This script will set the branch and pipeline name to whatever branch you are currently on. It will also set the image tag on ECR to the current commit hash at the time of setting the pipeline.
268+
269+
The pipeline name itself will usually follow a pattern as follows: `<repo-name>-<branch-name>`
270+
If you wish to set a pipeline for another branch without checking out, you can run the following:
271+
```bash
272+
./concourse/scripts/set_pipeline.sh github-copilot-usage-lambda <branch_name>
273+
```
274+
275+
If the branch you are deploying is "main" or "master", it will trigger a deployment to the sdp-prod environment. To set the ECR image tag, you must draft a Github release pointing to the latest release of the main/master branch that has a tag in the form of vX.Y.Z. Drafting up a release will automatically deploy the latest version of the main/master branch with the associated release tag, but you can also manually trigger a build through the Concourse UI or the terminal prompt.
276+
277+
#### Triggering a pipeline
278+
Once the pipeline has been set, you can manually trigger a build on the Concourse UI, or run the following command:
279+
```bash
280+
fly -t aws-sdp trigger-job -j github-copilot-usage-lambda-<branch-name>/build-and-push
281+
```

0 commit comments

Comments
 (0)