gpt4 book ai didi

GitLab CI : Two independent scheduled jobs

转载 作者:行者123 更新时间:2023-12-04 04:30:59 27 4
gpt4 key购买 nike

考虑以下 gilab-ci.yml 脚本:

stages:
- build_for_ui_automation
- independent_job

variables:
LC_ALL: "en_US.UTF-8"
LANG: "en_US.UTF-8"

before_script:
- gem install bundler
- bundle install

build_for_ui_automation:
dependencies: []
stage: build_for_ui_automation
artifacts:
paths:
- fastlane/screenshots
- fastlane/logs
- fastlane/test_output
- fastlane/report.xml
script:
- bundle exec fastlane ui_automation
tags:
- ios
only:
- schedules
allow_failure: false

# This should be added and trigerred independently from "build_for_ui_automation"
independent_job:
dependencies: []
stage: independent_job
artifacts:
paths:
- fastlane/screenshots
- fastlane/logs
- fastlane/test_output
- fastlane/report.xml
script:
- bundle exec fastlane independent_job
tags:
- ios
only:
- schedules
allow_failure: false

我希望能够独立安排这两项工作,但要遵循以下规则:
  • build_for_ui_automation 每天在 5 AM
  • 运行
  • Independent_job 每天在 5 PM
  • 运行

    但是,使用当前设置,我只能触发整个管道,这将依次执行两个作业。

    如何让计划只触发一个作业?

    最佳答案

    在您的项目中的 gitlab 中转到CI/CD -> Schedules按新的计划按钮根据需要配置任务设置时间和间隔

    现在最后为每个变量添加一个变量

    现在通过在 only 部分添加该变量来编辑您的 gitlab.yml

    如下所示

    https://docs.gitlab.com/ee/ci/variables/#environment-variables-expressions

    关于GitLab CI : Two independent scheduled jobs,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56686864/

    27 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com