在gitlab CICD中 小试 hooks:pre_get_sources_script 功能

参考链接:

功能简介

hooks:pre_get_sources_script 是gitlab CICD中的一个功能,该功能可以指定在克隆 Git 仓库和任何子模块之前要在执行器上执行的某些命令。例如:

  • 调整 Git 配置
  • 导出跟踪变量

下来简单给大家演示下,看下细节过程。

ci配置

bash 复制代码
job1:
  hooks:
    pre_get_sources_script:
      - echo 'hello job1 pre_get_sources_script'
  script: echo 'hello job1 script'

从跑pipeline的效果来看,如果使用了hooks:pre_get_sources_script关键字,那么确实会在拉取代码之前做一些操作;那么基于这样的能力,我们完全将一些前置性的操作在这里执行,从而方便后面ci中来更快的完成某些job的运行。

相关推荐
Aubrey-J7 小时前
老版本Gitlab SSL证书自动续期错误KeyError: key not found: “token“解决
网络协议·gitlab·ssl
java_logo1 天前
Docker 部署 GitLab CE 完整版教程
docker·容器·gitlab·gitlab docker部署·gitlab部署文档·gitlab部署·gitlab部署教程
隔窗听雨眠2 天前
GitLab CI前端加载慢优化实录
ci/cd·gitlab
东北甜妹4 天前
DevOps 和 Git,Gitlab
git·gitlab·devops
qq_白羊座4 天前
GitLab CI + Jenkins 双流水线模式Jenkins 端配置
ci/cd·gitlab·jenkins
qq_白羊座4 天前
GitLab CI 与 Jenkins
ci/cd·gitlab·jenkins
lisanmengmeng4 天前
gitlab 配置的jenkins 链接错误
运维·gitlab·jenkins
qq_356408665 天前
Kubernetes 部署 GitLab Runner 及 Java CI/CD 实践指南
java·kubernetes·gitlab
Niliuershangba6 天前
ChestnutCMS 栗子内容管理系统:从入门到模板开发实战
java·git·开源·gitlab·github·开源软件·gitcode
heimeiyingwang8 天前
【架构实战】GitOps实践:让运维更优雅
架构·gitlab·jenkins