2.1. Rules attributes The job attributes you can use with rules are: when: If not defined, defaults to when: on_success. If used as when: delayed, start_in is also required. allow_failure: If not defined, defaults to allow_failure: false. variables: If not defined, uses the variables...
stages:# 指定运行的顺序-test-deployvariables:name:hahadeploy:tags:-k8sstage:deployretry:parallel:3# 要并行运行的作业实例数rules:-changes:# 当 Dockerfile 或者 Jenkinsfile 里的文件内容改变时,才会执行 deploy 的 job-Dockerfile-Jenkinsfilescript:-echo"我是部署阶段"test:stage:testscript:-echo"我是测...
only: variables: - $USER_NAME === "fizz" 上面的例子展示了,如果定义的变量USER_NAME 等于 fizz时,该作业才会被运行。开发者可以配置多个only:variables的条件判断,只要有一条符合条件,作业就会被运行。 only:changes/ except:changes 使用changes来修饰关键词only适用于某些文件改变后触发作业的情景。比如只有项目...
workflow:rules 顶级workflow:关键字适用于整个管道,并将确定是否创建管道。when :可以设置为always或never . 如果未提供,则默认值always。 代码语言:javascript 代码运行次数:0 运行 AI代码解释 variables:DOMAIN:example.comworkflow:rules:-if:'$DOMAIN == "example.com"'-when:always 综合实例代码 代码语言:javasc...
stages:# 指定运行的顺序-test-deployvariables:name:zouzoudeploy:tags:-k8sstage:deployretry:parallel:3# 要并行运行的作业实例数rules:-if:'$name == "zouzou"'# 如果变量名等于 zouzou,则运行流水线,将流水线设置为手动执行when:manual-if:'$name == "haha"'# 如果变量名等于 haha,则延迟 10 秒执行whe...
任务的28个关键词分别是,script,after_script,allow_failure,artifacts,before_script,cache,coverage,dependencies,environment,except,extends,image,include,interruptible,only,pages,parallel,release,resource_group,retry,rules,services,stage,tags,timeout,trigger,variables,when ...
- echo"部署成功"rules: # 跟only一个意思-if: $CI_COMMIT_TAG 更多用法参考官方文档 三、项目添加cicd 1.1 项目开启cicd 1.2 添加本项目gitlab-runner 为项目添加的runner,只能用于本项目。 gitlab-runner有多个种,本项目的,项目组的,还有就是全局。这样一个runner可以用于多个,由于权限问题,此处只是选择单项...
These variables cannot be used as CI/CD variables to configure a pipeline (for example with the rules keyword), but they can be used in job scripts. To pass a job-created environment variable to other jobs: In the job script, save the variable as a .env file. The format of the file...
Summary workflow:rules (as described in https://docs.gitlab.com/12.7/ee/ci/yaml/README.html#workflowrules) does not work properly with triggered pipelines and passing variables...
I have some CI jobs which run the same steps on different files and try to DRY my CI by usingextends. However, GitLab does not currently evaluate variables inrules:changes, which makes this difficult. I can work around it by replacingextendswith the explicit properties, but it makes my CI...