- 一、CI/CD执行机制
- 二、离线安装gitlab-runner
- 下载相应版本的gitlab-runner
(下载地址:https://packages.gitlab.com/runner/gitlab-runner)
- dpkg -i gitlab-runner_12.8.0_amd64.deb
- gitlab-runner register
- 第3步中需要的信息可从下图所示位置获取
- 三、示例
3.1 .gitlab-ci.yml
内容如下:
before_script:
- date
stages:
- test
- build
- deploy
test:
stage: test
script:
- echo "Running tests"
- echo $username
- export
build:
stage: build
script:
- echo "Building the app"
- curl http://api.newgoai.com/api/index/serverTime
deploy_staging:
stage: deploy
script:
- echo "Deploy to staging server"
environment:
name: staging
url: https://staging.example.com
only:
- master
deploy_prod:
stage: deploy
script:
- echo "Deploy to production server"
environment:
name: production
url: https://example.com
when: manual
only:
- master
3.2 Pipelines执行结果列表
3.3 Pipeline执行结果详情
3.4 Jobs执行结果列表
3.5 Jobs执行结果详情
3.6 Schedules列表
3.7 Schedules详情
3.8 Pipeline triggers
3.9 Pipeline triggers调用结果
- 四、其它
1、哪个分支发生了push或merge事件,则gitlab-runner执行哪个分支下的.gitlab-ci.yml文章来源:https://www.toymoban.com/news/detail-798607.html
- 五、参考地址:
1、.gitlab-ci.yml 语法:{gitlabHost}/help/ci/yaml/README.md文章来源地址https://www.toymoban.com/news/detail-798607.html
到了这里,关于Gitlab中的CICD的使用方法的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!