首页 > 解决方案 > 如何在 gitlab ci 上部署 quasar - vue 应用程序

问题描述

我有一个使用 $ quasar create 创建的基本类星体页面。我想在 Gitlab ci 上部署应用程序,但部署不断给我错误,我已设法修复构建和测试错误,但无法弄清楚它的部署部分。

.gitlab-ci.yml

build site:
  image: node:10
  stage: build
  script:
    - npm install -g @quasar/cli
    - npm install --progress=false
    - quasar build
  artifacts:
    expire_in: 1 week
    paths:
      - dist

unit test:
  image: node:10
  stage: test
  script:
    - npm install --progress=false

deploy:
  image: alpine
  stage: deploy
  script:
    - apk add --no-cache rsync openssh
    - mkdir -p ~/.ssh
    - echo "$SSH_PRIVATE_KEY" >> ~/.ssh/id_dsa
    - chmod 600 ~/.ssh/id_dsa
    - echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config
    - rsync -rav --delete dist/ user@server.com:/your/project/path/

部署阶段出错

我尝试添加rsync -av -e "ssh -vv" --delete ... 这是我得到的错误在此处输入图像描述

标签: dockergitlabgitlab-cigitlab-ci-runnerquasar-framework

解决方案


尝试使用 ssh verbose active 进行 rsync,以查看有关该错误的更多信息:

rsync -av -e "ssh -vv" --delete ...

检查您的 ssh 元素的权限
例如:

chmod 700 ~/.ssh

推荐阅读