-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.drone.yml
49 lines (45 loc) · 1.35 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
kind: pipeline
name: default
steps:
- name: requirements
image: kennethreitz/pipenv
commands: ["pipenv lock -r | tee requirements.txt"]
- name: info
image: alpine/git
commands:
- git fetch --tags
- git describe --tags 2> /dev/null | cut -c 2- > /info/version
- git rev-parse HEAD 2> /dev/null > /info/commit
- git rev-parse --abbrev-ref HEAD 2> /dev/null > /info/branch
- head -1 < go.mod | awk '{print $2}' 2> /dev/null > /info/module
- tail -n +1 /info/*
volumes:
- name: info
path: /info
- name: build
image: stevenxie/kaniko-drone
settings: &settings
repo: stevenxie/veritaserum
dockerfile: Dockerfile
tags:
- |
$([ $DRONE_BUILD_EVENT != tag ] && \
printf '%s-%s' $(cat /i/branch | tr / -) $(cat /i/commit) || true)
- |
$([ $DRONE_BUILD_EVENT != pull_request ] && \
[ $(cat /i/branch) == master ] && \
echo latest || true)
- |
$([ $DRONE_BUILD_EVENT != pull_request ] && \
([ $DRONE_BUILD_EVENT == tag ] || \
[ $(cat /i/branch) == master ]) && \
cat /i/version || true)
username: stevenxie
password:
from_secret: docker_token
volumes: &volumes
- name: info
path: /i
volumes:
- name: info
temp: {}