Integrating Waypoint with GitLab CI/CD
Using Waypoint to deploy an application from within GitLab CI/CD is similar to how you might deploy an application from your own workspace.
The example demonstrates the main steps:
- Set-up the dependencies Waypoint might use. This could be a Kubernetes context for a more advanced application, or in the below example, a Docker daemon to run applications on.
- Install Waypoint from the official source. If you are using a Docker custom image executor with your other deploy dependencies, you could utilize the public Docker image in a multi-stage build.
- Run
waypoint init
. This depends on the environment variables listed below and documented in the Automating Execution overview. - Run the build, deploy, and release. In this case, instead of using
waypoint up
, it breaks out each stage as a separate command to be easier to read and filter through in the GitLab UI.
Workspaces
This example assumes the use of a single default workspace.
You can also use defined GitLab environments:
If this was in a job triggered by a Git commit or merge request and may be an ephemeral development environment, you may want to interpolate the relevant Git ref for the workspace parameter, as demonstrated below:
See the GitLab CI/CD predefined environment variables page for a full list of variables that could be utilized in this way.
Example