scarletsky / scarletsky.github.io

http://scarletsky.github.io
10 stars 5 forks source link

2016/07/29/use-gitlab-ci-for-continuous-integration/ #5

Open utterances-bot opened 5 years ago

utterances-bot commented 5 years ago

用 GitLab CI 进行持续集成 - scarletsky

简介 从 GitLab 8.0 开始,GitLab CI 就已经集成在 GitLab 中,我们只要在项目中添加一个 .gitlab-ci.yml 文件,然后添加一个 Runner,即可进行持续集成。 而且随着 GitLab 的升级

https://scarletsky.github.io/2016/07/29/use-gitlab-ci-for-continuous-integration/

zhkugh commented 5 years ago

👍

h5m1007 commented 5 years ago

真棒👍

JerryChan31 commented 4 years ago

你好,这篇文章写得太好了,我感觉详细到可以作为指南文档,我可以转载到自己的博客吗?会注明来源的。提前感谢。

scarletsky commented 4 years ago

@JerryChan31 可以的,很高兴能帮到你 :smile:

JerryChan31 commented 4 years ago

非常感谢!

lddsb commented 3 years ago

dist为什么要缓存呢?

scarletsky commented 3 years ago

@lddsb 因为我的用例里面要把 dist/ 提供给 deploy_testdeploy_production 两个 job

lddsb commented 3 years ago

@scarletsky 那其实可以用artifacts传递到下一个job吧,还是说在使用artifacts遇到坑才改用cache的呢?

scarletsky commented 3 years ago

@lddsb artifacts 是用来把指定文件/目录上传到 gitlab,提供相关的人员来下载的吧。我没用过这个属性,我用 cache 是为了把 dist/ 上传到其他服务器里面。

关于 artifacts 可以看看这个: Gitlab CI Pipeline, Artifacts and Environments

stardustman commented 2 years ago

mark

stardustman commented 2 years ago

设置 Job.only 后,只有当 develop 分支和 master 分支有提交的时候才会触发相关的 Jobs。 注意,我这里用 GitLab Runner 所在的服务器作为测试服务器。

gitlab runner 要是不在测试服务器上是不是要麻烦些?

scarletsky commented 2 years ago

@stardustman

gitlab runner 要是不在测试服务器上是不是要麻烦些?

没什么区别吧,只要你的 runner 所在的服务器能访问你的 gitlab 服务器就行了

zhengwei1219 commented 2 years ago

请教大佬:你文章中的scripts/deploy/deploy.sh 这个deploy.sh脚本是放在你gitlab项目根目录下的吗?

scarletsky commented 2 years ago

@zhengwei1219

你文章中的scripts/deploy/deploy.sh 这个deploy.sh脚本是放在你gitlab项目根目录下的吗?

大概是这样的目录结构 . ├── README.md ├── package.json ├── scripts │ --└── deploy │ ------└── deploy.sh