82 lines
2.2 KiB
YAML
82 lines
2.2 KiB
YAML
kind: pipeline
|
|
name: default
|
|
|
|
steps:
|
|
- name: prends_des_branches
|
|
image: alpine/git
|
|
commands:
|
|
- git submodule init
|
|
- git submodule update --recursive --remote
|
|
|
|
- name: construis_ton_nid
|
|
image: plugins/hugo
|
|
settings:
|
|
hugo_version: 0.79.0
|
|
extended: false
|
|
validate: true
|
|
# config: hugo/config.toml
|
|
# content: hugo/content
|
|
# layout: hugo/layout
|
|
# output: hugo/public
|
|
# theme: hugo/themes/hugo-theme-hello-friend-ng/
|
|
url: https://blog.goe.land
|
|
|
|
- name: read
|
|
image: alpine/git
|
|
commands:
|
|
- ls
|
|
- ls public/
|
|
|
|
#- name: deploie_tes_ailes
|
|
# image: appleboy/drone-scp
|
|
# settings:
|
|
# host: {from_secret: SCP_HOSTNAME}
|
|
# port: {from_secret: SCP_PORT}
|
|
# username: {from_secret: SCP_USERNAME}
|
|
# #password: {from_secret: SCP_PASSWORD}
|
|
# key: {from_secret: SCP_KEY}
|
|
# source: public/
|
|
# strip_components: 1
|
|
# target: {from_secret: SCP_TARGET_DIRECTORY}
|
|
# #target: /srv/apps/blog/data/www/public
|
|
# rm: true
|
|
- name: deploy
|
|
image: alpine/git
|
|
environment:
|
|
SCP_KEY:
|
|
from_secret: SCP_KEY
|
|
SCP_HOSTNAME:
|
|
from_secret: SCP_HOSTNAME
|
|
SCP_USER:
|
|
from_secret: SCP_USER
|
|
SCP_PORT:
|
|
from_secret: SCP_PORT
|
|
SCP_TARGET:
|
|
from_secret: SCP_TARGET_DIRECTORY
|
|
SCP_COMMAND:
|
|
from_secret: SCP_COMMAND
|
|
commands:
|
|
- ls public/
|
|
- mkdir $HOME/.ssh
|
|
- echo "$SCP_KEY" > $HOME/.ssh/id_rsa
|
|
- ssh-keyscan -t rsa -p $SCP_PORT $SCP_HOSTNAME >> $HOME/.ssh/known_hosts
|
|
- chmod -R og-rw $HOME/.ssh/
|
|
- scp -r -P $SCP_PORT -i $HOME/.ssh/id_rsa public/* $SCP_USER@$SCP_HOSTNAME:$SCP_TARGET_DIRECTORY
|
|
- ssh -p $SCP_PORT -i $HOME/.ssh/id_rsa $SCP_USER@$SCP_HOSTNAME '$SCP_COMMAND'
|
|
|
|
#- name: rereveille_toi
|
|
# image: appleboy/drone-ssh
|
|
# settings:
|
|
# host:
|
|
# from_secret: SCP_HOSTNAME
|
|
# port:
|
|
# from_secret: SCP_PORT
|
|
# username:
|
|
# from_secret: SCP_USERNAME
|
|
# #password: {from_secret: SCP_PASSWORD}
|
|
# key:
|
|
# from_secret: SCP_KEY
|
|
# script:
|
|
# #- {from_secret: SSH_COMMAND}
|
|
# - docker-compose -f /srv/apps/blog/docker-compose.yml restart
|