budibase/.github/workflows/README.md

140 lines
6.0 KiB
Markdown
Raw Normal View History

2021-12-21 17:21:44 +01:00
# Budibase CI Pipelines
Welcome to the budibase CI pipelines directory. This document details what each of the CI pipelines are for, and come common combinations.
## All CI Pipelines
### Note
2023-09-07 15:27:13 +02:00
- When running workflow dispatch jobs, ensure you always run them off the `master` branch. It defaults to `develop`, so double check before running any jobs. The exception to this case is the `deploy-release` job which requires the develop branch.
2021-12-21 17:21:44 +01:00
### Standard CI Build Job (budibase_ci.yml)
2023-09-07 15:27:13 +02:00
Triggers:
2023-09-07 15:27:13 +02:00
- PR or push to develop
- PR or push to master
2021-12-21 17:21:44 +01:00
2023-09-07 15:27:13 +02:00
The standard CI Build job is what runs when you raise a PR to develop or master.
- Installs all dependencies,
2023-09-07 15:27:13 +02:00
- builds the project
- run the unit tests
- Generate test coverage metrics with codecov
2023-09-07 15:27:13 +02:00
- Run the integration tests
2021-12-21 17:21:44 +01:00
### Release Develop Job (release-develop.yml)
2023-09-07 15:27:13 +02:00
Triggers:
2023-09-07 15:27:13 +02:00
- Push to develop
2021-12-21 17:21:44 +01:00
2023-09-07 15:27:13 +02:00
The job responsible for building, tagging and pushing docker images out to the test and release environments.
- Installs all dependencies
2023-09-07 15:27:13 +02:00
- builds the project
- run the unit tests
- publish the budibase JS packages under a prerelease tag to NPM
- build, tag and push docker images under the `develop` tag to docker hub
2021-12-21 17:21:44 +01:00
These images will then be pulled by the test and release environments, updating the latest automatically. Discord notifications are sent to the #infra channel when this occurs.
2021-12-21 17:21:44 +01:00
### Release Job (release.yml)
2023-09-07 15:27:13 +02:00
Triggers:
2023-09-07 15:27:13 +02:00
- Push to master
This job is responsible for building and pushing the latest code to NPM and docker hub, so that it can be deployed.
2023-09-07 15:27:13 +02:00
- Installs all dependencies
2023-09-07 15:27:13 +02:00
- builds the project
- run the unit tests
- publish the budibase JS packages under a release tag to NPM (always incremented by patch versions)
- build, tag and push docker images under the `v.x.x.x` (the tag of the NPM release) tag to docker hub
### Release Selfhost Job (release-selfhost.yml)
2023-09-07 15:27:13 +02:00
Triggers:
2023-09-07 15:27:13 +02:00
- Manual Workflow Dispatch Trigger
2023-09-07 15:27:13 +02:00
This job is responsible for delivering the latest version of budibase to those that are self-hosting.
This job relies on the release job to have run first, so the latest image is pushed to dockerhub. This job then will pull the latest version from `lerna.json` and try to find an image in dockerhub corresponding to that version. For example, if the version in `lerna.json` is `1.0.0`:
2023-09-07 15:27:13 +02:00
- Pull the images for all budibase services tagged `v1.0.0` from dockerhub
- Tag these images as `latest`
- Push them back to dockerhub. This now means anyone who pulls `latest` (self hosters using docker-compose) will get the latest version.
- Build and release the budibase helm chart for kubernetes users
- Perform a github release with the latest version. You can see previous releases here (https://github.com/Budibase/budibase/releases)
### Deploy Release (deploy-release.yml)
2023-09-07 15:27:13 +02:00
Triggers:
2023-09-07 15:27:13 +02:00
- Manual Workflow Dispatch Trigger
This job is responsible for deploying to our release, cloud kubernetes environment. You must run the release job first, to ensure that the latest images have been built and pushed to docker hub. After kicking off this job, the following will occur:
2023-09-07 15:27:13 +02:00
- Checks out the release branch
- Pulls the latest `values.yaml` from budibase infra, a private repo containing budibases infrastructure configuration
- Gets the latest budibase version from `lerna.json`, if it hasn't been specified in the workflow when you kicked it off
2023-09-07 15:27:13 +02:00
- Configures AWS Credentials
- Deploys the helm chart in the budibase repo to our preproduction EKS cluster, injecting the `values.yaml` we pulled from budibase-infra
- Fires off a discord webhook in the #infra channel to show that the deployment completely successfully.
### Deploy Preprod (deploy-preprod.yml)
2023-09-07 15:27:13 +02:00
Triggers:
2023-09-07 15:27:13 +02:00
- Manual Workflow Dispatch Trigger
This job is responsible for deploying to our preprod, cloud kubernetes environment. You must run the release job first, to ensure that the latest images have been built and pushed to docker hub. After kicking off this job, the following will occur:
2023-09-07 15:27:13 +02:00
- Checks out the master branch
- Pulls the latest `values.yaml` from budibase infra, a private repo containing budibases infrastructure configuration
- Gets the latest budibase version from `lerna.json`, if it hasn't been specified in the workflow when you kicked it off
2023-09-07 15:27:13 +02:00
- Configures AWS Credentials
- Deploys the helm chart in the budibase repo to our preprod EKS cluster, injecting the `values.yaml` we pulled from budibase-infra
- Fires off a discord webhook in the #infra channel to show that the deployment completely successfully.
### Deploy Production (deploy-cloud.yml)
2023-09-07 15:27:13 +02:00
Triggers:
2023-09-07 15:27:13 +02:00
- Manual Workflow Dispatch Trigger
This job is responsible for deploying to our production, cloud kubernetes environment. You must run the release job first, to ensure that the latest images have been built and pushed to docker hub. You can also manually enter a version number for this job, so you can perform rollbacks or upgrade to a specific version. After kicking off this job, the following will occur:
2023-09-07 15:27:13 +02:00
- Checks out the master branch
- Pulls the latest `values.yaml` from budibase infra, a private repo containing budibases infrastructure configuration
- Gets the latest budibase version from `lerna.json`, if it hasn't been specified in the workflow when you kicked it off
2023-09-07 15:27:13 +02:00
- Configures AWS Credentials
- Deploys the helm chart in the budibase repo to our production EKS cluster, injecting the `values.yaml` we pulled from budibase-infra
- Fires off a discord webhook in the #infra channel to show that the deployment completely successfully.
2021-12-21 17:21:44 +01:00
## Common Workflows
### Deploy Changes to Production (Release)
2023-09-07 15:27:13 +02:00
- Merge `develop` into `master`
- Wait for budibase CI job and release job to run
- Run cloud deploy job
- Run release selfhost job
2021-12-21 17:21:44 +01:00
### Deploy Changes to Production (Hotfix)
2023-09-07 15:27:13 +02:00
- Branch off `master`
- Perform your hotfix
- Merge back into `master`
- Wait for budibase CI job and release job to run
- Run cloud deploy job
- Run release selfhost job
2021-12-21 17:21:44 +01:00
### Rollback A Bad Cloud Deployment
2023-09-07 15:27:13 +02:00
- Kick off cloud deploy job
- Ensure you are running off master
2023-09-07 15:27:13 +02:00
- Enter the version number of the last known good version of budibase. For example `1.0.0`