I'm setting up a gitlab CI pipeline for my project. It has 3 stages - build, build-async and build-all and deployment_mode "dev" as of now. In build stage, creation of folders, deployment zips will take place. In build-async, all the async stuff like copying kits to aws s3 bucket will occur and build-all must essentially consist of build plus build-async stage. Assume that stage and deployment_mode environment variables have been setup in the gitlab environment variables. Here's sample snippet -
stages:
-build
-build-async
-build-all
dev-build:
image: python:3.7.4-alpine3.9
script:
- echo "Hello from dev-build. "
stage: build
tags:
- docker
- linux
only:
variables:
- $stage =~ /^build$/ && $deployment_mode =~ /^dev$/
dev-build-async:
image: python:3.7.4-alpine3.9
script:
- echo "Hello from dev-build-async. "
stage: build-async
tags:
- docker
- linux
only:
variables:
- $stage =~ /^build-async$/ && $deployment_mode =~ /^dev$/
dev-build-all:
image: python:3.7.4-alpine3.9
script:
- echo "Hello from dev-build-all. "
stage: build-all
tags:
- docker
- linux
needs: ["dev-build", "dev-build-async"]
only:
variables:
- $stage =~ /^build-all$/ && $deployment_mode =~ /^dev$/
I'm not able to trigger the jobs dev-build and dev-build-async as a part of dev-build-all. Does anyone have idea how to trigger them both?
In this case the output expected when I provide stage as build-all and deployment-mode as dev is
Hello from dev-build.
Hello from dev-build-async.
Hello from dev-build-all.