forked from humanitec-tutorials/sample-app
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.drone.yml
32 lines (30 loc) · 1.06 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
# .drone.yml - Sample file for connecting your module to Walhall's CI/CD pipeline.
# Save this in the repository root. You don't have to change anything.
# All environment variables are created in Walhall as secrets.
pipeline:
# Walhall requires git tags to exactly match the image tags.
# This step preserves the tags.
preserve-git-tags:
image: bash
commands:
# If the commit reference is a tag, then Drone will 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 when a tag is pushed.
# Drone is configured to use the Walhall registry by default.
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]