2020-10-27 13:52:43 +01:00
|
|
|
---
|
|
|
|
kind: pipeline
|
2020-10-27 17:53:28 +01:00
|
|
|
name: build and deploy
|
|
|
|
|
|
|
|
deploy_commands_alias:
|
|
|
|
- &deploy_commands
|
|
|
|
commands:
|
|
|
|
- echo "deploy $DEPLOY_USER@$DEPLOY_HOST:$DEPLOY_DIR or $${DEPLOY_DIR}"
|
|
|
|
- echo "$DEPLOY_KEY" | sed 's/!/\n/g' > deploy_key
|
|
|
|
- chmod 0600 deploy_key
|
2020-11-28 15:46:25 +01:00
|
|
|
- echo "echo something otherwise the next line unterminated quote"
|
2020-10-27 17:53:28 +01:00
|
|
|
- ssh -i deploy_key -o StrictHostKeyChecking=no $DEPLOY_USER@$DEPLOY_HOST rm -Rf $${DEPLOY_DIR}/output/
|
|
|
|
- scp -r -i deploy_key -o StrictHostKeyChecking=no output $DEPLOY_USER@$DEPLOY_HOST:$${DEPLOY_DIR}
|
2020-10-27 13:52:43 +01:00
|
|
|
|
|
|
|
steps:
|
|
|
|
- name: markdown lint
|
|
|
|
image: pipelinecomponents/markdownlint:latest
|
|
|
|
commands:
|
2020-10-27 14:25:00 +01:00
|
|
|
- mdl .
|
2020-10-27 16:26:24 +01:00
|
|
|
|
2020-10-27 17:09:24 +01:00
|
|
|
- name: build pelican
|
2020-10-27 16:26:24 +01:00
|
|
|
image: apihackers/pelican
|
|
|
|
commands:
|
|
|
|
- pelican content -o output -s pelicanconf.py
|
2020-10-27 17:02:55 +01:00
|
|
|
|
|
|
|
- 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
|
2020-11-11 13:25:35 +01:00
|
|
|
DEPLOY_DIR: /srv/http/blog-dev
|
2020-10-27 17:46:45 +01:00
|
|
|
<<: *deploy_commands
|
2020-10-27 17:02:55 +01:00
|
|
|
when:
|
|
|
|
branch:
|
|
|
|
exclude:
|
|
|
|
- master
|
2020-10-27 16:26:24 +01:00
|
|
|
|
2020-10-27 17:46:45 +01:00
|
|
|
- name: deploy live
|
|
|
|
image: kroniak/ssh-client
|
|
|
|
environment:
|
|
|
|
DEPLOY_USER:
|
|
|
|
from_secret: deploy_user
|
|
|
|
DEPLOY_HOST:
|
|
|
|
from_secret: deploy_host
|
|
|
|
DEPLOY_KEY:
|
|
|
|
from_secret: deploy_key
|
|
|
|
DEPLOY_DIR: /srv/http/blog
|
|
|
|
commands:
|
|
|
|
<<: *deploy_commands
|
|
|
|
when:
|
|
|
|
branch:
|
|
|
|
include:
|
|
|
|
- master
|