代码之家  ›  专栏  ›  技术社区  ›  Nicolas Albarracin

部署反应.js从gitlab到heroku的app/dist文件夹

  •  0
  • Nicolas Albarracin  · 技术社区  · 7 年前

    gitlab ci:

    image: node:8.10.0-alpine
    cache:
      key: "alpine"
      paths:
        - node_modules/
    
    stages:
      - build
      - production
    
    build:
      stage: build
      artifacts:
        paths:
          - dist/
      script:
        - npm install
        - npm run build
      tags:
        - docker
      only:
        - master
    
    production:
      type: deploy
      stage: production
      image: ruby:latest
      script:
        - apt-get update -qy
        - apt-get install -y ruby-dev
        - gem install dpl
        - cd dist
        - dpl --provider=heroku --app=app --api-key=api-key
      only:
        - master
    

    当进程运行时,我得到:sh: 0:getcwd()失败:没有这样的文件或目录 致命:无法读取当前工作目录:没有这样的文件或目录 错误:作业失败:退出代码1

    1 回复  |  直到 7 年前
        1
  •  3
  •   Rômulo Bordezani    7 年前

    我解决了这个问题,添加了--skip\u cleanup到dpl命令的末尾。

    例子:

    dpl --provider=heroku --app=your-app-name --api-key=$HEROKU_API_KEY --skip_cleanup

    希望有帮助。