service-ntfy/.drone.yml

101 lines
2.3 KiB
YAML
Raw Permalink Normal View History

2023-01-15 22:31:19 +00:00
---
kind: pipeline
2023-01-15 22:49:45 +00:00
type: docker
2023-01-15 22:31:19 +00:00
name: default
2023-01-15 22:46:18 +00:00
2023-01-15 22:31:19 +00:00
steps:
2023-02-21 13:39:13 +00:00
- name: debug
image: alpine
environment:
commands:
- 'echo "Repository: glenux/service-ntfy"'
- 'echo "Git commit: ${DRONE_COMMIT_SHA:0:8}"'
2023-01-15 22:49:45 +00:00
- name: publish:commit_sha
2023-01-15 22:31:19 +00:00
image: plugins/docker
2023-01-15 22:49:45 +00:00
# pull: never
2023-01-15 23:45:02 +00:00
# volumes:
# - name: cache
# path: /stupid
2023-02-21 13:39:13 +00:00
environment:
DOCKER_REPO: glenux/service-ntfy
2023-01-15 22:31:19 +00:00
settings:
2023-01-15 22:49:45 +00:00
username:
from_secret: DOCKERHUB_USERNAME
password:
from_secret: DOCKERHUB_PASSWORD
2023-01-15 23:57:17 +00:00
cache_from: "${DOCKER_REPO}:latest_${DRONE_BRANCH/\\//-}"
2023-02-21 13:39:13 +00:00
repo: glenux/service-ntfy
2023-01-15 22:49:45 +00:00
tags: "${DRONE_COMMIT_SHA:0:8}"
2023-02-21 13:39:13 +00:00
purge: false
2023-01-15 22:46:18 +00:00
2023-01-15 22:49:45 +00:00
- name: publish:commit_branch
2023-01-15 22:46:18 +00:00
image: plugins/docker
2023-01-15 23:45:02 +00:00
# volumes:
# - name: cache
# path: /stupid
2023-01-15 22:46:18 +00:00
settings:
2023-01-15 22:49:45 +00:00
username:
from_secret: DOCKERHUB_USERNAME
password:
from_secret: DOCKERHUB_PASSWORD
2023-02-21 13:39:13 +00:00
cache_from: "glenux/service-ntfy:latest_${DRONE_BRANCH/\\//-}"
repo: glenux/service-ntfy
2023-01-15 22:49:45 +00:00
tags: "latest_${DRONE_BRANCH/\\//-}"
2023-02-21 13:39:13 +00:00
purge: false
2023-01-15 22:46:18 +00:00
when:
branch:
2023-01-15 22:49:45 +00:00
- "master"
- "develop"
- "feature/*"
2023-01-15 22:31:19 +00:00
2023-02-21 13:39:13 +00:00
- name: publish:latest
2023-01-15 23:57:17 +00:00
image: plugins/docker
settings:
2023-02-21 13:39:13 +00:00
username:
from_secret: DOCKERHUB_USERNAME
password:
from_secret: DOCKERHUB_PASSWORD
cache_from: "glenux/service-ntfy:latest_${DRONE_BRANCH/\\//-}"
repo: glenux/service-ntfy
2023-01-15 23:57:17 +00:00
tags: latest
2023-02-21 13:39:13 +00:00
purge: false
when:
branch:
- master
- name: deploy:dokku
image: alpine
2023-01-15 23:57:17 +00:00
when:
branch:
- master
2023-02-21 13:39:13 +00:00
environment:
SSH_USER:
from_secret: SSH_USER
SSH_HOST:
from_secret: SSH_HOST
SSH_PRIVATE_KEY:
from_secret: SSH_PRIVATE_KEY
commands:
- echo $SSH_USER
- echo $SSH_HOST
- echo $SSH_PRIVATE_KEY
- apk update && apk add openssh-client
- mkdir -p ~/.ssh && chmod 700 ~/.ssh
- echo "$SSH_PRIVATE_KEY" | base64 -d > ~/.ssh/deploy_key
- chmod 600 ~/.ssh/deploy_key
- ssh -o StrictHostKeyChecking=no
-i ~/.ssh/deploy_key
"$SSH_USER@$SSH_HOST"
git:from-image notify
"glenux/service-ntfy:${DRONE_COMMIT_SHA:0:8}"
#
2023-01-15 22:49:45 +00:00
2023-01-15 23:45:02 +00:00
# volumes:
# - name: cache
# temp: {}
2023-01-15 22:31:19 +00:00
#