在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的运行。

相关推荐
HIT_Weston1 小时前
65、【Ubuntu】【Gitlab】拉出内网 Web 服务:Gitlab 配置审视(九)
前端·ubuntu·gitlab
victory04313 小时前
GitLab部署报告
gitlab
HIT_Weston3 小时前
64、【Ubuntu】【Gitlab】拉出内网 Web 服务:Gitlab 配置审视(八)
前端·ubuntu·gitlab
HIT_Weston4 小时前
62、【Ubuntu】【Gitlab】拉出内网 Web 服务:Gitlab 配置审视(六)
前端·ubuntu·gitlab
不爱吃米饭_20 小时前
Gitea 轻量级的Git方案 - Gitlab的替代品
git·gitlab·gitea
嘻哈baby1 天前
自建GitLab与CI/CD实战:团队协作完整方案
ci/cd·gitlab
秦时明月天明1 天前
GitLab SSH Key 过期:git pull failed : remote your ssh key has expired
git·ssh·gitlab
极限实验室2 天前
程序员爆哭!我们让 COCO AI 接管 GitLab 审查后,团队直接起飞:连 CTO 都说“这玩意儿比人靠谱多了
人工智能·gitlab
HIT_Weston3 天前
61、【Ubuntu】【Gitlab】拉出内网 Web 服务:Gitlab 配置审视(五)
前端·ubuntu·gitlab
HIT_Weston3 天前
60、【Ubuntu】【Gitlab】拉出内网 Web 服务:Gitlab 配置审视(四)
前端·ubuntu·gitlab