diff --git a/.docker/rsync_deploy/Dockerfile b/.docker/rsync_deploy/Dockerfile new file mode 100644 index 0000000..af02f13 --- /dev/null +++ b/.docker/rsync_deploy/Dockerfile @@ -0,0 +1,2 @@ +FROM alpine:latest +RUN apk --update add --no-cache openssh-client rsync diff --git a/.woodpecker.yaml b/.woodpecker.yaml new file mode 100644 index 0000000..5bcd1b9 --- /dev/null +++ b/.woodpecker.yaml @@ -0,0 +1,70 @@ +clone: + git: + image: woodpeckerci/plugin-git + settings: + lfs: true + recursive: true + branch: master + +pipeline: + build: + image: klakegg/hugo:ext-alpine-ci + +# pipeline: + build-deploy-image: + image: docker + volumes: + - /var/run/docker.sock:/var/run/docker.sock + commands: + - cd .docker/rsync_deploy; docker build -t internal/rsync_deploy:latest . + +# pipeline: + deploy: + image: internal/rsync_deploy:latest + commands: + - mkdir /root/.ssh + - chmod 700 /root/.ssh + - echo "$SSH_KEY_BASE64" | base64 -d >/root/.ssh/id_ecdsa + - chmod 600 /root/.ssh/id_ecdsa + - rsync -az -e 'ssh -p 22 -i /root/.ssh/id_ecdsa -o UserKnownHostsFile=/dev/null -o LogLevel=quiet -o StrictHostKeyChecking=no' public/ root@web.mondomaine.mu:/var/www/html/ + secrets: + - ssh_key_base64 + + notify-on-success: + image: plugins/webhook + settings: + urls: + from_secret: gotify_url_tokenized + content_type: application/json + template: | + { + "extras": { + "client::display": { + "contentType": "text/markdown" + } + }, + "title": "Building : ${CI_REPO}", + "message": "Succes on build [${CI_BUILD_NUMBER}](${CI_BUILD_LINK}) for commit ${CI_COMMIT_SHA}", + "priority": 5 + } + + notify-on-failure: + image: plugins/webhook + settings: + urls: + from_secret: gotify_url_tokenized + content_type: application/json + template: | + { + "extras": { + "client::display": { + "contentType": "text/markdown" + } + }, + "title": "Building : ${CI_REPO}", + "message": "Failed on build [${CI_BUILD_NUMBER}](${CI_BUILD_LINK}) for commit ${CI_COMMIT_SHA}", + "priority": 5 + } + when: + status: + - failure