gitlab 项目持续集成

  • 修改文件 .gitlab-ci.yml
  • 这里展示了轻量方式分布对 dev master 进行集成
  • shell 中国内推荐用 cnpm ,yarn 国内各种原因会卡,尽管你配置了阿里镜像 ```javascript stages:
    • build

build-master: stage: build script:

  1. - pwd
  2. # - yarn
  3. # - yarn build
  4. - cnpm i
  5. - npm run build
  6. - rm -rf /home/cicd/docker-data/nginx/html/project.youserver.net
  7. - cp -rf ./dist /home/cicd/docker-data/nginx/html/project.youserver.net

tags:

- centos-aliyun-158

only:

- master

build-develop: stage: build script:

- pwd
# - yarn
# - yarn build
- cnpm i
- npm run build
- rm -rf /home/cicd/docker-data/nginx/html/project-dev.youserver.net
- cp -rf ./dist /home/cicd/docker-data/nginx/html/project-dev.youserver.net

tags:

- centos-aliyun-158

only:

- develop

```

查案集成报告

因为用的 gitlab + runner cicd 官方方案,所以很方便的有管理界面可以看。
image.png