Skip to content

Latest commit

 

History

History
97 lines (65 loc) · 7.17 KB

cicd.md

File metadata and controls

97 lines (65 loc) · 7.17 KB

CI/CD

Overview

overview

  • Template based or plain K8s manifests is stored in the neco-apps repository.
  • CI runs light-weight test, named "kindtest", for topic branches. To verify changed manifests deploy, CI runs bootstrap tests on kind (Kubernetes IN Docker).
  • To merge master branch to stage branch, CI runs full-scale test, named "dctest". CI emulates a datacenter environment on GCP instances and runs bootstrap/upgrade tests on those instances.
  • Argo CD watches changes of this repository, then synchronize(deploy) automatically when new commit detected.
  • After the deployment process finished, Argo CD sends alert to the Alertmanager where is running on the same cluster. Then it notifies to Slack channel and/or Email address.

GCP instance

This repository uses Google Compute Engine instance for GitOps testing. The instances are automatically created and deleted by CircleCI depending on the job contents.

The GCP instance name is neco-apps-<CircleCI Build Number>. If the job succeeds, the corresponding GCP instance will be deleted immediately. When the job failed, the GCP instance remains for a while.

CircleCI Workflow

This repository has 4 CircleCI workflows, main, daily, manual-dctest and production-release.

main workflow

main workflow is used for testing feature branch of neco-apps. This consists of the following 2 jobs.

job name description target branch
test Syntax check for go lang all branches
kindtest Bootstrap test on kind all branches except master, stage, release, op-release-* and op-stage-*

daily workflow

daily workflow is executed daily for merging master to stage. This consists of the following 4 jobs.

job name description target branch
bootstrap Bootstrap test on GCP instances master
upgrade-stage Upgrade test from stage branch (staging env) master
upgrade-release Upgrade test from release branch (production env) master
create-pull-request-stage Create PR to stage, then trigger create-pull-request-stage of the secret repository. master

update-stage is executed only if 3 other jobs succeeded.

manual-dctest workflow

manual-dctest workflow is not executed automatically. This provides full-scale test for all branches, which can be triggered from Web UI.

This consists of the following 6 jobs.

job name description target branch
bootstrap Bootstrap test on GCP instances all branches
upgrade-master Upgrade test from master branch all branches except master, stage, release, op-release-* and op-stage-*
upgrade-stage Upgrade test from stage branch (staging env) all branches
upgrade-release Upgrade test from release branch (production env) all branches
create-pull-request-stage Create PR to stage, then trigger create-pull-request-stage of the secret repository. master

manual-dctest-with-neco-feature-branch workflow

manual-dctest-with-neco-feature-branch workflow is not executed automatically. This can be triggered from Web UI.

This consists of the following job.

job name description target branch
bootstrap-with-neco-branch Bootstrap test with neco's feature branch all branches except master, stage, release, op-release-* and op-stage-*

bootstrap-with-neco-branch is tested with neco's feature branch which is the same name as neco-apps's target branch name. For example, when foo-bar branch of neco-apps, it's tested with foo-bar branch of neco.

release-tag workflow

release-tag workflow is used for pushing release tag to stage HEAD. This workflow is executed only when a PR is merged to stage branch.

production-release workflow

production-release workflow is used for releasing neco-apps to a production environment. This workflow is executed only when a release-* tag is created. And it creates a pull request for the release.

CD of each cluster

See details of the deployment step in deploy.md.

  • stage: watch argocd-config/overlays/stage<num> in stage HEAD branch. All changes of stage are always deployed to staging cluster.
  • prod (tokyo0, osaka0, ...): watch argocd-config/overlays/{tokyo<num>,osaka<num>} in release HEAD branch. To deploy changes for a production cluster.