Py学习  »  Git

Gitlab CI不在作业之间保留其他目录的节点模块

user274823 • 4 年前 • 191 次点击  

我想使用gitlab ci触发express api和react应用程序在一个repo中的连续部署。我用的是外壳执行器。

那是我的目录结构

/server
/client
.gitlab-ci.yml

我的配置如下:

stages:
  - deploy

server:
  stage: deploy
  script: 
    - npm run start
    - forever restartall
  only:
    refs: 
      - staging
    changes:
      - server/

client:
  script: 
    - npm run build --prefix ./client
  stage: deploy
  only:
    refs: 
      - staging
    changes:
      - client/

但是,当客户端作业运行时,它会清除服务器文件夹中导致服务器崩溃的节点模块。

我想要一种保留节点模块的方法。或者使用gitlab ci/cd构建服务器和客户机

Python社区是高质量的Python/Django开发社区
本文地址:http://www.python88.com/topic/40274
 
191 次点击  
文章 [ 1 ]  |  最新文章 4 年前
Mirco
Reply   •   1 楼
Mirco    5 年前

您需要定义要在每个阶段保留的文件夹:

server:
  stage: deploy
  script:
     - ....
 artifacts:
    paths:
        - node_modules/
        - bower/
        - ....

所有文物将从一个阶段运送到另一个阶段。见 https://docs.gitlab.com/ee/ci/yaml/#artifacts 了解更多信息