this is my basic-app. I've never written a line of go before this. This is just a practice deployment to playwith CI/CD tools other than buildkite (playing withgithub actions)
it is a basic web-app written in Go.
endpoints:
root: returns "hello world"
/metadata: returns info about the app, current version, commit sha, description
- AWS CLI V2. and configured creds
- docker.
- access to an IAM role in my admin group (shrug)
- Go.
/cfn cloudformation templates for hosting infra to be deployed outside of pipeline
/bin scripts with 0** prefix are non-pipeline scripts to deploy infra in /cfn
bin/ 1** prefix for deploying/publishing
deployment is automated via github actions on pushes to this repo
how:
-
I have configured an IAM user and administrator access group.
-
'configure AWS credentials' pipeline step allows github actions agents to assume a user in admin group mentioned above.
check AWS resources exist outlined in /cfn (eg, ECR exists), can check CF stacks, query the outputs of them, run the scripts, whatever
if not:
find bin/ scripts prefixed with 0. (eg 00-spin-up-ecr.sh)
to deploy cloud formation stacks, access to aws account or appropriate IAM user is needed and obviously won't be outlined in this repo because it's my own personal acc.But maybe I create an IAM user for you and add you to my admin group.
then:
/bin 0**.sh scripts (scripts with 0 prefix)
these 0 steps are ordered, eg 00*.sh, 01*.sh etc.
if resources exist / once resource stacks are up:
deploy --> bin/1***.sh
run the scripts prefixed with 1 in order (e.g: 10*.sh before 11*.sh)
these scripts can run 'localy' and in the pipeline. I have opted to put most of the work, for instance for building and pushing the images - getting commit sha, grabbing the ecr-name, rather than using github actions envs/ and output features - in the rare case I am unable to run the pipeline, or for whatever reason need to run all of these steps myself.