before_script:定的脚本将与您指定的任何脚本连接起来 在主脚本中。组合的脚本在单个 shell 中一起执行。也可在开头直接使用,只有一个会生效
示例1:
before_script
job:
before_script:
- echo "Execute this command before any 'script:' commands."
script:
- echo "This command executes after the job's 'before_script' commands."
示例2:
before_script:
- echo "Before script section"
- echo "For example you might run an update here or install a build dependency"
- echo "Or perhaps you might print out some debugging details"
after_script:覆盖在作业后执行的一组命令。用于定义在每个作业(包括失败的作业)之后运行的命令数组。
示例1:
after_script:
- echo "After script section"
- echo "For example you might do some cleanup here"
示例2:
job:
script:
- echo "An example script section."
after_script:
- echo "Execute this command after the `script` section completes."
stages:用于定义包含作业组的阶段。使用作业中的阶段将作业配置为在特定阶段运行。
示例:
stages:
- build
- test
- deploy