Design CD for Compose Stacks #7
Labels
No Label
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: Jafner/Jafner.net#7
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Presently, we deploy updates manually. The process is relatively consistent, and can sometimes accelerate debugging. But with automation we can accelerate most of the development process, and build a foundation for automated post-deployment support.
Below are some considerations for the design of the pipeline:
.gitattributes
with an encryption filter renders as unencrypted in the runner, it should immediately cancel the job and send an urgent notification to remediate the leaked secret(s).Stack Package Components
Below are some of the design considerations for a "package" schema for Stacks:
docker-compose.yml
file..env
because that file name is automatically sourced when bringing up the Compose stack. (E.g.DOCKER_DATA=/mnt/nas/docker_data/my_stack
).secrets.env
file, which is encrypted in the repo, and decrypted for the deployment process. Alternatively, secrets may be defined in the Compose file itself and encrypted with Sops. Discussion in #3.deploy/
subdirectory with resources for deploying the Stack, such as variables defined for the CI or CD scripts, or helper scripts. These would be defined indeploy.env
. Examples include:DEPLOY_LOGS_PATH
,DEPLOY_SMB_SHARES
,DEPLOY_S3_ENDPOINTS
,DEPLOY_HTTP_ENDPOINTS
, and more.Deployment Pipeline
scp
the package file onto the host.ssh
into the host, extract the package, decrypt the secrets file using the host's key, pull the latest version of the used images. Rundocker compose config
and pipe the output into a checksum. Compare the checksum against the one defined in the package. If they differ, abort and report. Otherwise,docker compose up -d --force-recreate > $CD_LOG_FILE 2&>1
Moved this to the automation milestone, but we're unlikely to continue development of Stacks as we move toward K8s for our core infrastructure.