Continuous integration continuous deployment workflow reference

Overview

This reference helps contributors and developers understand and support the release workflow.

sequenceDiagram
    Developers->>Applications: Merge Release
    Applications->>Gitlab: Build Container Image
    K8s Staging->>Gitlab: Watch Container Image Tag
    K8s Production->>Gitlab: Watch Container Image Tag
    K8s Staging->>Sellsy: Update image tags
    break Semantic Release
      Gitlab->>Sellsy: Generate workers configuration
      Gitlab->>Sellsy: Generate tag
    end
    K8s Staging->>Sellsy: Watch git tags
    K8s Staging->>Sellsy: Reconcile tag configuration
    Developers->>Gitlab: Release job
    Gitlab->>K8s Production: Update sellsy tag
    K8s Production->>Sellsy: Reconcile tag configuration
    Developers->>Gitlab: Rollback job
    Gitlab->>K8s Production: Update sellsy tag
    K8s Production->>Sellsy: Reconcile tag configuration

Steps in the workflow

  1. Merge Release
    • Developers merge code changes into the release branch of the application repository.
    • Action: Trigger the release process and start the build of a new container image.
  2. Build Container Image
    • Applications trigger Gitlab to build a new container image based on the merged release branch.
    • Action: Tag and push the container image to the container registry.
  3. Watch Container Image Tag
    • K8s Staging and K8s Production environments check the container image tag for changes.
    • Action: Trigger the update process when a new image appears.
  4. Update Image Tags in Staging
    • K8s Staging notifies Sellsy to update the image tags in its configuration.
    • Action: Upgrade container tag for staging environment.
  5. Semantic Release
    • Gitlab interacts with Sellsy to generate the workers’ configuration and create a new release tag.
    • Action: Upgrade container topology into Sellsy repository.
  6. Watch Git Tags
    • K8s Staging monitors the Git tags generated by Sellsy.
    • Action: Update the staging environment’s configuration based on the new tags.
  7. Reconcile Tag Configuration in Staging
    • K8s Staging reconciles its configuration to align with the latest tags.
    • Action: Update the staging environment configuration to the latest version.
  8. Release Job
    • Developers trigger a release job in Gitlab.
    • Action: Propagate the changes to the production environment.
  9. Update Sellsy Tag in Production
    • Gitlab updates the Sellsy tag in the K8s Production environment.
    • Action: Upgrade the container for production environment.
  10. Reconcile Tag Configuration in Production
    • K8s Production reconciles its configuration to align with the latest Sellsy tags.
    • Action: Upgrade containers in production environment.
  11. Rollback Job (if needed)
    • Developers can trigger a rollback job in Gitlab if necessary.
    • Action: Revert changes in the K8s Production environment to an earlier state.