-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy path.drone.yml
28 lines (26 loc) · 882 Bytes
/
.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
pipeline:
# Walhall requires git tags to exactly match the image tags. This step preserves the tags.
preserve-git-tags:
image: bash
commands:
# Check if the commit reference is a tag, if it is write the tag to the .tags file
- bash -c "[[ \"${DRONE_COMMIT_REF}\" == \"refs/tags/\"* ]] && echo \"${DRONE_COMMIT_REF#refs/tags/}\" > .tags"
when:
event: [tag]
# This step builds the image and pushes it to the registry.
# Drone is configured to use the Walhall registry by default, so no need to change anything.
build-docker-image-tag:
image: plugins/docker
registry:
from_secret: DOCKER_REGISTRY
repo:
from_secret: DOCKER_REPO
username:
from_secret: DOCKER_USERNAME
password:
from_secret: DOCKER_PASSWORD
insecure: true
file: Dockerfile
when:
event: [tag]
status: [success]