Jobs represent isolated steps in a pipeline
Stages are executed sequentially
Jobs in the same stage are executed in parallel
Described in .gitlab-ci.yml
in YAML
Special stages .pre
and .post
Minimal job:
job_name:
script:
- whoami
- pwd
- printenv | sort
script
is a string and supports all herestring variants of YAML
Script blocks can be testing using a container based on alpine
:
docker run -it --rm -v $PWD:/src -w /src alpine sh
See src/main.go
Build command: go build -o hello .
Use docker to play:
docker run --interactive --tty --rm \
--volume ${PWD}:/project --workdir /project \
golang:1.18 bash
Initialize dependency information: go mod init
Update dependency information: go mod tidy
src/
to root of projectbuild/.gitlab-ci.yml
to root of projectlint/.gitlab-ci.yml
to root of projectparallel/.gitlab-ci.yml
to root of project