This repository is based on a concept that any application has two parts:
- Some docker images
- Connections between these images
For example, here are diagrams of two different applications using the same set of docker images:
We keep images in the /images
folder, and connection between them in the /manifests
folder.
There are two possibe ways to trigger the CI pipelines:
- Update images
- Update manifests
When change in /images
folder is detected, GitHub triggers "Build and Promote" Action, which does build and promote for the each subfolder.
- Run unit tests
- Build image
- Tag image as
ghcr.io/<repository_owner>/<subfolder_name>:
sha-<short-sha>
if triggered event is push in branchx.x.x
if triggered event is tagvx.x.x
- Push image to ghcr.io
- Checkout into main branch of nikita-akuity/demo-workflow-delivery repository
- Run
kustomize set image <subfolder-name>=<image-url>:<tag>
- in
apps/<subfolder-name>/env/dev
if triggered event is push in branch - in
apps/<subfolder-name>/env/stage
if triggered event is tagvx.x.x
- in
- Push changes to nikita-akuity/demo-workflow-delivery repository
The promote part can be removed and replaced with Argo CD Image Updater
When change in /manifests
folder is detected, GitHub triggers "Update Kustomize Base" Action which does promotion for the each subfolder.
- Test manifests by running
kustomize build <subfolder-name>
- Checkout into main branch of nikita-akuity/demo-workflow-delivery repository
- Update
resources
list in theapps/<subfolder-name>/env/base/kustomization.yaml
, setting the first element of the list into"https://github.com/<repository>//manifests/<subfolder-name>/?ref=<sha>"
- Push changes to nikita-akuity/demo-workflow-delivery repository
All images are simple python based scripts:
- greetings
Take a string argument--names
(e.g."name1,name2"
) and create a filehello name1 hello name2
- replace-text
Take an input text file, replacehello
togoodbye
and save result into different file, e.g.goodbye name1 goodbye name2
- count
Take an input file, count number of string occurances there and print the result number in stdout
Please check corresponding folders for the detailed description of each application: