Ajout de la pipeline de CI et du Dockerfile nécessaire
This commit is contained in:
parent
00761bace4
commit
d6c6dc190d
2 changed files with 72 additions and 0 deletions
2
.docker/rsync_deploy/Dockerfile
Normal file
2
.docker/rsync_deploy/Dockerfile
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
FROM alpine:latest
|
||||
RUN apk --update add --no-cache openssh-client rsync
|
||||
70
.woodpecker.yaml
Normal file
70
.woodpecker.yaml
Normal file
|
|
@ -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
|
||||
Loading…
Add table
Reference in a new issue