-
Notifications
You must be signed in to change notification settings - Fork 1
/
.drone.yml
66 lines (61 loc) · 1.41 KB
/
.drone.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
kind: pipeline
name: build
steps:
# Default clone does not fetch tags
- name: metadata
image: docker
commands:
- echo "export OF_BUILD_DATE=$(date -Iseconds)" >> build_metadata
- echo "export OF_GIT_COMMIT=${DRONE_COMMIT}" >> build_metadata
- echo "export OF_GIT_BRANCH=master" >> build_metadata
- echo "export OF_GIT_RELEASE=${DRONE_TAG}" >> build_metadata
when:
event: [tag]
# Install dependencies and test the python code
- name: build-and-push
image: plugins/docker
settings:
username:
from_secret: docker_username
password:
from_secret: docker_password
repo: mythern/overflow
context: .
cache_from:
- mythern/overflow:latest
auto_tag: true
tags:
- latest
when:
event: [tag]
# Copy compose-file
- name: configure
image: appleboy/drone-scp
settings:
host: ace.ulv.io
port: 22000
username: root
key:
from_secret: ssh_key
target: /srv/www/overflow/
source: docker-compose.yml
when:
event: [tag]
# Pull fresh images, restart, cleanup and report status
- name: deploy
image: appleboy/drone-ssh
settings:
host: ace.ulv.io
port: 22000
username: root
key:
from_secret: ssh_key
command_timeout: 600s
script:
- cd /srv/www/overflow
- docker compose pull
- docker compose up -d -t 600
- docker image prune -f
- docker compose ps
when:
event: [tag]