Compare commits
1 commit
Author | SHA1 | Date | |
---|---|---|---|
db8e2fc928 |
1 changed files with 40 additions and 14 deletions
54
.drone.yml
54
.drone.yml
|
@ -6,6 +6,8 @@ name: default
|
||||||
steps:
|
steps:
|
||||||
- name: debug
|
- name: debug
|
||||||
image: alpine
|
image: alpine
|
||||||
|
environment:
|
||||||
|
|
||||||
commands:
|
commands:
|
||||||
- 'echo "Repository: glenux/service-monica"'
|
- 'echo "Repository: glenux/service-monica"'
|
||||||
- 'echo "Git commit: ${DRONE_COMMIT_SHA:0:8}"'
|
- 'echo "Git commit: ${DRONE_COMMIT_SHA:0:8}"'
|
||||||
|
@ -23,12 +25,24 @@ steps:
|
||||||
from_secret: DOCKERHUB_USERNAME
|
from_secret: DOCKERHUB_USERNAME
|
||||||
password:
|
password:
|
||||||
from_secret: DOCKERHUB_PASSWORD
|
from_secret: DOCKERHUB_PASSWORD
|
||||||
cache_from: "glenux/service-monica:${DRONE_BRANCH/\\//-}_latest"
|
cache_from: "glenux/service-monica:latest_${DRONE_BRANCH/\\//-}"
|
||||||
repo: glenux/service-monica
|
repo: glenux/service-monica
|
||||||
tags:
|
tags: "${DRONE_COMMIT_SHA:0:8}"
|
||||||
- "${DRONE_BRANCH/\\//-}_${DRONE_COMMIT_SHA:0:8}"
|
purge: false
|
||||||
- "${DRONE_BRANCH/\\//-}_latest"
|
|
||||||
- "latest"
|
- name: publish:commit_branch
|
||||||
|
image: plugins/docker
|
||||||
|
# volumes:
|
||||||
|
# - name: cache
|
||||||
|
# path: /stupid
|
||||||
|
settings:
|
||||||
|
username:
|
||||||
|
from_secret: DOCKERHUB_USERNAME
|
||||||
|
password:
|
||||||
|
from_secret: DOCKERHUB_PASSWORD
|
||||||
|
cache_from: "glenux/service-monica:latest_${DRONE_BRANCH/\\//-}"
|
||||||
|
repo: glenux/service-monica
|
||||||
|
tags: "latest_${DRONE_BRANCH/\\//-}"
|
||||||
purge: false
|
purge: false
|
||||||
when:
|
when:
|
||||||
branch:
|
branch:
|
||||||
|
@ -36,6 +50,21 @@ steps:
|
||||||
- "develop"
|
- "develop"
|
||||||
- "feature/*"
|
- "feature/*"
|
||||||
|
|
||||||
|
- name: publish:latest
|
||||||
|
image: plugins/docker
|
||||||
|
settings:
|
||||||
|
username:
|
||||||
|
from_secret: DOCKERHUB_USERNAME
|
||||||
|
password:
|
||||||
|
from_secret: DOCKERHUB_PASSWORD
|
||||||
|
cache_from: "glenux/service-monica:latest_${DRONE_BRANCH/\\//-}"
|
||||||
|
repo: glenux/service-monica
|
||||||
|
tags: latest
|
||||||
|
purge: false
|
||||||
|
when:
|
||||||
|
branch:
|
||||||
|
- master
|
||||||
|
|
||||||
- name: deploy:dokku
|
- name: deploy:dokku
|
||||||
image: alpine
|
image: alpine
|
||||||
when:
|
when:
|
||||||
|
@ -56,15 +85,12 @@ steps:
|
||||||
- mkdir -p ~/.ssh && chmod 700 ~/.ssh
|
- mkdir -p ~/.ssh && chmod 700 ~/.ssh
|
||||||
- echo "$SSH_PRIVATE_KEY" | base64 -d > ~/.ssh/deploy_key
|
- echo "$SSH_PRIVATE_KEY" | base64 -d > ~/.ssh/deploy_key
|
||||||
- chmod 600 ~/.ssh/deploy_key
|
- chmod 600 ~/.ssh/deploy_key
|
||||||
- ssh-keygen -f ~/.ssh/deploy_key -y > ~/.ssh/deploy_key.pub
|
- |
|
||||||
- "cat ~/.ssh/deploy_key.pub | cut -f3 -d' '"
|
ssh -o StrictHostKeyChecking=no \
|
||||||
- ssh -o StrictHostKeyChecking=no
|
-i ~/.ssh/deploy_key \
|
||||||
-i ~/.ssh/deploy_key
|
"$SSH_USER@$SSH_HOST" \
|
||||||
"$SSH_USER@$SSH_HOST"
|
git:from-image prm \
|
||||||
git:from-image prm
|
"glenux/service-monica:${DRONE_COMMIT_SHA:0:8}"
|
||||||
"glenux/service-monica:${DRONE_BRANCH/\\//-}_${DRONE_COMMIT_SHA:0:8}"
|
|
||||||
#
|
|
||||||
- echo "SUCCESS"
|
|
||||||
|
|
||||||
# volumes:
|
# volumes:
|
||||||
# - name: cache
|
# - name: cache
|
||||||
|
|
Loading…
Add table
Reference in a new issue