We have the following steps in our “pipeline” when we create a merge request. This “pipeline” is shared across 2 repositories, e.g. repo A & repo B.
- Trigger unit tests
- Netlify builds a deploy preview as the environment is configured to trigger on merge request events (regardless of success / failure of step 1)
- Netlify adds a step in the pipeline (?)
- Using Netlify functions we trigger a gitlab pipeline in repo B as soon as the site is deployed.
I would like to go to the following situation, preferably using .gitlab-ci.yml:
- Trigger unit tests
- (depending on output step 1) build a deploy preview
- (depending on output step 2) kick off repo B pipeline
The .gitlab-ci.yml could be something like this:
stages:
- test
- deploy-preview
- e2e-tests
test:
stage: test
image: node:12
script:
- npm install --no-save
- npm test
e2e-tests:
stage: e2e-tests
script:
...code to kickoff e2e tests in repo B
Is something like this possible? Or would it be an alternative to resort to ‘manually’ deploying deploy previews using netlify-cli within .gitlab-ci.yml?