I want to define a pipeline to compile, deploy to target and test my project.
This should happen in two distinct ways: an incremental (hopefully fast) build at each commit and a full build scheduled at night.
The following .gitlab-ci.yml has all jobs marked "manual" for testing purposes.
stages:
- build
- deploy
- test
variables:
BUILD_ARTIFACTS_DIR: "artifacts"
build-incremental:
timeout: 5h
stage: build
script:
- echo "Building"
- ./ci/do-prep
- echo "done."
artifacts:
paths:
- $BUILD_ARTIFACTS_DIR/
variables:
BUILD_TOP_DIR: "/workspace/builds"
tags:
- yocto
when: manual
build-nightly:
timeout: 5h
stage: build
script:
- echo "Building"
- ./ci/do-prep
- echo "done."
artifacts:
paths:
- $BUILD_ARTIFACTS_DIR/
tags:
- yocto
when: manual
deploy:
stage: deploy
script:
- echo "Deploying..."
- ./ci/do-deploy
- echo "done."
tags:
- yocto
dependencies:
- build
when: manual
test:
stage: test
script:
- echo "Testing..."
- ./ci/do-test
- echo "done."
tags:
- yocto
dependencies:
- deploy
when: manual
This fails with message: deploy job: undefined dependency: build.
Cow do I explain to GitLab deploy stage needs either build-incremental or build-nightly artifacts?
Later I will have to understand how to trigger build-incremental at commit and build-nightly using a schedule, but that seems to be a different problem.