[CI] Add deploy in staging
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
510c9f3da4
commit
2e3af3700a
1 changed files with 22 additions and 21 deletions
43
.drone.yml
43
.drone.yml
|
@ -12,28 +12,29 @@ steps:
|
|||
image: apihackers/pelican
|
||||
commands:
|
||||
- pelican content -o output -s pelicanconf.py
|
||||
- ls output
|
||||
|
||||
- name: deploy staging
|
||||
image: kroniak/ssh-client
|
||||
environment:
|
||||
DEPLOY_USER:
|
||||
from_secret: deploy_user
|
||||
DEPLOY_HOST:
|
||||
from_secret: deploy_host
|
||||
DEPLOY_KEY:
|
||||
from_secret: deploy_key
|
||||
commands:
|
||||
- echo "deploy $DEPLOY_USER@$DEPLOY_HOST"
|
||||
- echo "$DEPLOY_KEY" | sed 's/!/\n/g' > deploy_key
|
||||
- chmod 0600 deploy_key
|
||||
- cat deploy_key
|
||||
- ssh -i deploy_key -o StrictHostKeyChecking=no $DEPLOY_USER@$DEPLOY_HOST rm -Rf /srv/http/blog-lan/output/
|
||||
- scp -i deploy_key -o StrictHostKeyChecking=no output/* $DEPLOY_USER@$DEPLOY_HOST:/srv/http/blog-lan/output/
|
||||
when:
|
||||
branch:
|
||||
exclude:
|
||||
- master
|
||||
|
||||
#- name: deploy staging
|
||||
# image: kroniak/ssh-client
|
||||
# environment:
|
||||
# DEPLOY_USER:
|
||||
# from_secret: deploy_user
|
||||
# DEPLOY_HOST:
|
||||
# from_secret: deploy_host
|
||||
# DEPLOY_KEY:
|
||||
# from_secret: deploy_key
|
||||
# commands:
|
||||
# - echo "deploy $DEPLOY_USER@$DEPLOY_HOST"
|
||||
# - echo "$DEPLOY_KEY" | sed 's/!/\n/g' > deploy_key
|
||||
# - chmod 0600 deploy_key
|
||||
# - cat deploy_key
|
||||
# - ssh -i deploy_key -o StrictHostKeyChecking=no $DEPLOY_USER@$DEPLOY_HOST rm -Rf /srv/http/blog-lan/output/
|
||||
# - scp -i deploy_key -o StrictHostKeyChecking=no output/* $DEPLOY_USER@$DEPLOY_HOST:/srv/http/blog-lan/output/
|
||||
# when:
|
||||
# branch:
|
||||
# exclude:
|
||||
# - master
|
||||
#
|
||||
#- name: deploy staging
|
||||
# image: kroniak/ssh-client
|
||||
# environment:
|
||||
|
|
Loading…
Reference in a new issue