script
represents the core steps performed by a job
script
is just a YAML string
GitLab also supported YAML herestrings :
job_name:
script: |
pwd
whoami
printenv
Some jobs require preparation and cleanup to work correctly
job_name:
before_script: echo before_script
script: echo core
after_script: echo after_script
after_script
runs even if the job failed (useful for cleanup)
Separate script
into…
Move apk
operations into before_script
See new .gitlab-ci.yml
:
git checkout origin/160_gitlab_ci/030_script_blocks -- '*'
Yes, this is still repetetive