下面是if-else命令在GitLab CI YAML文件中的使用示例: 代码语言:txt 复制 job1: script: - echo "This is job1" job2: script: - echo "This is job2" rules: - if: $CI_COMMIT_REF_NAME == "main" # 如果分支名称是main when: never # 则不执行该作业 - if: $CI_COMMIT_REF_NAME == "...
if [ $(docker ps -a | grep fastapi-dev | wc -l ) -gt 0 ];then echo "dev env exists, remove it!!!" docker stop fastapi-dev sleep 5 else echo "dev env does not exist, pls deploy to test" fi script: - docker run -d --rm --name fastapi-dev -p 8000:8000 $CI_REGISTRY_I...
before_script在script之前,在artifacts 恢复之后执行 after_script则会在script之后执行,包括失败的 Job 在default关键字中定义before_script和after_script将会在所有 Job 执行命令的前后执行命令。如果您不想在指定 Job 执行这些命令或想执行其他的命令,可以在 Job 中使用before_script和after_script来覆盖这些命令,不...
From planning to production, bring teams together in one application. Ship secure code more efficiently to deliver value faster.
添加Gitlab 仓库源:curl https://packages.gitlab.com/install/repositories/gitlab/gitlab-ee/script.deb.sh | sudo bash,这样就可以直接使用apt来安装 Gitlab 了。 直接使用命令sudo EXTERNAL_URL="https://gitlab.example.com" apt-get install gitlab-ee安装 Gitlab。命令执行后,就开始下载 Gitlab 软件包...
Engineering Demo Process Engineering Error Budgets Engineering Fellow Shadow Engineering Function Performance Indicators Engineering Hiring Engineering IC Leadership Engineering Management Engineering Mentorship Engineering Projects Engineering Secondments Engineering Team Readmes Engineering Workflow Expa...
script.sh"echoecho"Please email support@packagecloud.io and let us know if you run into any issues."exit1 }gpg_check() {echo"Checking for gpg..."ifcommand-v gpg > /dev/null;thenecho"Detected gpg..."elseecho"Installing gnupg for GPG verification..."apt-get install -y gnupgif["$?
/bin/bashif[ $#-ne 2 ]then echo"arguments error!"exit1elsedeploy_path="/var/www/$1/$2"if[ ! -d"$deploy_path"] then project_path="git@你的git项目地址:"$1/$2".git"git clone$project_path$deploy_pathelsecd$deploy_pathgit pull...
each do |issue| if issue.state != "closed" && issue.moved_to.nil? Issues::MoveService.new(container: project, current_user: admin_user).execute(issue, target_project) else puts "issue with id: #{issue.id} and title: #{issue.title} was not moved" end end; nil To exit the ...
stages: [stage_a, stage_b] workflow: auto_cancel: on_job_failure: all job1: stage: stage_a script: sleep 60 job2: stage: stage_a script: - sleep 30 - exit 1 job3: stage: stage_b script: - sleep 30 In this example, if job2 fails, job1 is canceled if it is still running...