Let’s take a look at Merge Request workflow. Here’s the YAML.
image: ruby:latest stages: # ... - plan dev # ... # Runs on Merge Request Only plan_dev: stage: plan dev only: - merge_requests script: - terraspace plan demo # ...
The difference here is that this will create a GitLab pipeline that only runs on
merge_request events and will run a
Create Branch and MR
git checkout feature1 vim app/stacks/demo/main.tf git add . git commit -m "change code" git push -u origin feature1
To create a Merge Request, you can either go to the url printed out from
Or go to the branch on GitLab and click “Create Merge Request” on the newly pushed branch.
The build should start shortly.
You can see the step by clicking on it.
Click on Details to see the Pipeline Logging output.
plan was run and provides a preview of what would happen. Any additional
git push to the MR branch will provide updated previews.
Merge Request Comment
Also, a MR comment with a Terraspace cloud link was added.
If you merge the MR, the Push Pipeline that we covered earlier will automatically apply the preview.
Next, we’ll cover the Manual Web Pipeline.