развернуть в digitalocean с помощью gitlab-ci - PullRequest
0 голосов
/ 21 апреля 2020

Я пытаюсь развернуть свой проект nodejs в цифровом океане, используя gitlab ci, но работа не выполняется. это мой gitlab-ci.yml

image: node:12

cache:
  paths:
    - node_modules/

stages:
  - deploy

before_script:
  # Check for ssh-agent + rsync and install if not present
  - 'which ssh-agent || ( apt-get update -y && apt-get install openssh-client -y  )'
  - 'which rsync || ( apt-get update -y && apt-get install rsync -y )'
  - eval $(ssh-agent -s)
  # Inject the remote's private key
  - echo "$SSH_PRIVATE_KEY" | tr -d '\r' | ssh-add - > /dev/null
  - mkdir -p ~/.ssh
  - chmod 700 ~/.ssh
  # Append keyscan output into known hosts
  - ssh-keyscan $SERVER_IP >> ~/.ssh/known_hosts
  - chmod 644 ~/.ssh/known_hosts
  - npm install
  - npm run build

deploy:
  stage: deploy
  script:
    - rsync -avuz --exclude=".*" $CI_PROJECT_DIR $SERVER_USER@$SERVER_IP:~
    - ssh $SERVER_USER@$SERVER_IP '. /etc/profile; pm2 reload all'
  only:
    - develop

, и это ошибка на моей работе

enter image description here

Чем я могу быть делать неправильно? пожалуйста, мне нужна помощь

...