gitlab-org--gitlab-foss/lib/gitlab/ci/syntax_templates/Before_script and after_scr...

37 lines
1.1 KiB
YAML

#
# You can define common tasks and run them before or after the main scripts in jobs.
# For more information, see:
# - https://docs.gitlab.com/ee/ci/yaml/README.html#before_script
# - https://docs.gitlab.com/ee/ci/yaml/README.html#after_script
#
stages:
- test
default:
before_script:
- echo "This script runs before the main script in every job, unless the job overrides it."
- echo "It may set up common dependencies, for example."
after_script:
- echo "This script runs after the main script in every job, unless the job overrides it."
- echo "It may do some common final clean up tasks"
job-standard:
stage: test
script:
- echo "This job uses both of the globally defined before and after scripts."
job-override-before:
stage: test
before_script:
- echo "Use a different before_script in this job."
script:
- echo "This job uses its own before_script, and the global after_script."
job-override-after:
stage: test
after_script:
- echo "Use a different after_script in this job."
script:
- echo "This job uses its own after_script, and the global before_script."