Skip to content

Commit

Permalink
Added .drone.yml file for Humanitec Platform.
Browse files Browse the repository at this point in the history
  • Loading branch information
chrishumanitec committed Dec 16, 2019
1 parent 53c450f commit 3c1c15c
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions .drone.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,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]

0 comments on commit 3c1c15c

Please sign in to comment.