Deployment
How to deploy
Deployment is done by leveraging GitLab CI alongside Git and Matrix Git bridge assets.
Deployment, as it stands, means generating a deploy branch, and then using Git Bridges to push the assets to the Matrix.
There is still an manual step of wiring up the build files to the Matrix implementation.
Component Service has a deployment process built in. This eliminates the need for complex implementations.
Prerequisites
Before you can deploy, make sure you’ve set up your repository correctly. These steps are outlined in the Set up Git repository section. The steps that pertain to deployment are clearly marked with the Deploy badge.
Trigger the deployment
Make sure your GitLab repository is is able to support CI/CD. For example,
code.squiz.net
does not support CI/CD.
With the CI script in place and the repository configured, you can now trigger the deployment. To trigger a deployment, head over to the CI/CD section in project’s GitLab UI.
Click the green Run Pipeline
button in the top right corner to start a new job.
Each deployment runs from an existing branch in the repository and generates a new deploy branch containing only the build files.
- Select the branch you want to deploy
- Add the variable DEPLOY with the value TRUE
Add the variable BRANCH_NAME with the value of the deploy branch you wish to create or update
Once the pipeline has successfully run, you will see a new branch in the repository.
This branch will be prefixed with deploy/
and suffixed with the branch name you entered in the pipeline.
You can deploy to the same deploy branch multiple times and it will be updated
Git Bridges
Now with the deploy branch generated, you can use Git Bridges to access the files to the Matrix.
Production Git Bridge
All projects will have a Git Bridge set up for production, this should be run off tags instead of branches.
When running the deployment pipeline and using the BRANCH_NAME
variable with a value of production
, the pipeline will automatically create a tag with the current date and time.
Working code Git Bridge(s)
You can set up multiple Git Bridges for testing different versions of code.
For example, you may have a deploy/feature-search
branch that’s tied to a Git Bridge that’s used for testing the search feature.
Once a feature is released the associated Git Bridge can be removed or the associated working branch can be removed from the configuration.