2023-01-15 23:58:43 +00:00
|
|
|
---
|
|
|
|
kind: pipeline
|
|
|
|
type: docker
|
|
|
|
name: default
|
|
|
|
|
|
|
|
steps:
|
2023-01-16 00:41:15 +00:00
|
|
|
- name: debug
|
|
|
|
image: alpine
|
2023-01-16 00:53:09 +00:00
|
|
|
environment:
|
2023-01-16 01:01:25 +00:00
|
|
|
|
2023-01-16 00:36:17 +00:00
|
|
|
commands:
|
2023-01-16 01:35:29 +00:00
|
|
|
- 'echo "Repository: glenux/service-dolibarr"'
|
2023-01-16 00:42:24 +00:00
|
|
|
- 'echo "Git commit: ${DRONE_COMMIT_SHA:0:8}"'
|
2023-01-16 00:36:17 +00:00
|
|
|
|
2023-01-15 23:58:43 +00:00
|
|
|
- name: publish:commit_sha
|
|
|
|
image: plugins/docker
|
|
|
|
# pull: never
|
|
|
|
# volumes:
|
|
|
|
# - name: cache
|
|
|
|
# path: /stupid
|
2023-01-16 00:53:09 +00:00
|
|
|
environment:
|
|
|
|
DOCKER_REPO: glenux/service-dolibarr
|
2023-01-15 23:58:43 +00:00
|
|
|
settings:
|
|
|
|
username:
|
|
|
|
from_secret: DOCKERHUB_USERNAME
|
|
|
|
password:
|
|
|
|
from_secret: DOCKERHUB_PASSWORD
|
2023-01-16 01:35:29 +00:00
|
|
|
cache_from: "glenux/service-dolibarr:latest_${DRONE_BRANCH/\\//-}"
|
|
|
|
repo: glenux/service-dolibarr
|
2023-01-15 23:58:43 +00:00
|
|
|
tags: "${DRONE_COMMIT_SHA:0:8}"
|
2023-01-16 01:17:38 +00:00
|
|
|
purge: false
|
2023-01-15 23:58:43 +00:00
|
|
|
|
|
|
|
- name: publish:commit_branch
|
|
|
|
image: plugins/docker
|
|
|
|
# volumes:
|
|
|
|
# - name: cache
|
|
|
|
# path: /stupid
|
|
|
|
settings:
|
|
|
|
username:
|
|
|
|
from_secret: DOCKERHUB_USERNAME
|
|
|
|
password:
|
|
|
|
from_secret: DOCKERHUB_PASSWORD
|
2023-01-16 01:35:29 +00:00
|
|
|
cache_from: "glenux/service-dolibarr:latest_${DRONE_BRANCH/\\//-}"
|
|
|
|
repo: glenux/service-dolibarr
|
2023-01-15 23:58:43 +00:00
|
|
|
tags: "latest_${DRONE_BRANCH/\\//-}"
|
2023-01-16 01:17:38 +00:00
|
|
|
purge: false
|
2023-01-15 23:58:43 +00:00
|
|
|
when:
|
|
|
|
branch:
|
|
|
|
- "master"
|
|
|
|
- "develop"
|
|
|
|
- "feature/*"
|
|
|
|
|
2023-01-16 01:35:29 +00:00
|
|
|
- name: publish:latest
|
2023-01-15 23:58:43 +00:00
|
|
|
image: plugins/docker
|
|
|
|
settings:
|
2023-01-16 01:35:29 +00:00
|
|
|
username:
|
|
|
|
from_secret: DOCKERHUB_USERNAME
|
|
|
|
password:
|
|
|
|
from_secret: DOCKERHUB_PASSWORD
|
|
|
|
cache_from: "glenux/service-dolibarr:latest_${DRONE_BRANCH/\\//-}"
|
|
|
|
repo: glenux/service-dolibarr
|
2023-01-15 23:58:43 +00:00
|
|
|
tags: latest
|
2023-01-16 01:17:38 +00:00
|
|
|
purge: false
|
2023-01-15 23:58:43 +00:00
|
|
|
when:
|
|
|
|
branch:
|
|
|
|
- master
|
|
|
|
|
2023-02-21 12:41:38 +00:00
|
|
|
- name: deploy:dokku
|
|
|
|
image: alpine
|
|
|
|
when:
|
|
|
|
branch:
|
|
|
|
- master
|
|
|
|
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 erp \
|
|
|
|
"glenux/service-dolibarr:${DRONE_COMMIT_SHA:0:8}"
|
|
|
|
|
2023-01-15 23:58:43 +00:00
|
|
|
# volumes:
|
|
|
|
# - name: cache
|
|
|
|
# temp: {}
|
|
|
|
#
|