明树Git Lab

Commit 536268e1 authored by Administrator's avatar Administrator

Update .gitlab-ci.yml

parent 3ea3023d
Pipeline #103658 failed with stages
in 0 seconds
#-----------------------------------------------master-10.40.8.7-------------------------------------------------------- #-----------------------------------------------master-10.40.8.7--------------------------------------------------------
# 自动部署到master环境 # 自动部署到cloud环境
stages: stages:
- package - package
- deploy - deploy
...@@ -10,7 +10,7 @@ package to master: ...@@ -10,7 +10,7 @@ package to master:
script: script:
- eval $(ssh-agent -s) - eval $(ssh-agent -s)
- mkdir -p ~/.ssh - mkdir -p ~/.ssh
- echo "$SSH_PRIVATE_KEY_master" | tr -d '\r' > ~/.ssh/id_rsa - echo "$SSH_PRIVATE_KEY_CLOUD" | tr -d '\r' > ~/.ssh/id_rsa
- chmod 700 ~/.ssh/id_rsa - chmod 700 ~/.ssh/id_rsa
- eval "$(ssh-agent -s)" - eval "$(ssh-agent -s)"
- ssh-add ~/.ssh/id_rsa - ssh-add ~/.ssh/id_rsa
...@@ -30,6 +30,22 @@ package to master: ...@@ -30,6 +30,22 @@ package to master:
- master - master
tags: tags:
- gzb-runner - gzb-runner
- echo -e "Host *\n\tStrictHostKeyChecking no\n\nHost *\n\tPubkeyAcceptedKeyTypes=+ssh-dss\n\n" > ~/.ssh/config
- ssh-add -l
- ssh root@10.40.8.7 "
cd /srv/jt_backend &&
git checkout ./package.json &&
git pull &&
npm install --registry https://registry.npmmirror.com &&
rm -rf ./dist &&
npm run build
"
environment:
name: master
only:
- master
tags:
- gzb-runner
deploy to master: deploy to master:
stage: deploy stage: deploy
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment