Fork of external-dns but only Hetzner provider included to speed up provider development
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

65 lines
1.7 KiB

node {
checkout scm
def branch = env.BRANCH_NAME
def build = env.BUILD_NUMBER
def image
def repository = "registry.blindage.org"
def image_name = "${repository}/hetzner-dns"
def commit_hash = checkout(scm).GIT_COMMIT
def git_tag = env.TAG_NAME
def version
stage("Tests") {
sh """
docker run --rm -v jenkins_jenkins-data:/var/jenkins_home golang:1.15 \
/bin/sh -c 'cd ${WORKSPACE} && \
go test -race ./...'
"""
}
stage("Build app image") {
try {
sh "docker build -t ${image_name} ."
} catch (Exception e) {
error("Failed to build image")
}
}
stage("Push latest") {
try {
docker.withRegistry("", "dockerhub") {
image = docker.image(image_name)
image.push("latest")
}
} catch(Exception e) {
echo "${e}"
error("Failed to push image")
}
}
if ( git_tag != null ) {
// stage("Update Helm Chart") {
// sh "tar -zcvf /var/www/charts.blindage.org/hetzner-dns-${version}.tgz -C helm ."
// sh "cd /var/www/charts.blindage.org/ && helm repo index ."
// }
stage("Push release") {
try {
docker.withRegistry("", "dockerhub") {
image = docker.image(image_name)
image.push(git_tag)
}
} catch(Exception e) {
echo "${e}"
error("Failed to push image")
}
}
}
stage("Cleanup") {
sh "docker rmi ${image_name} || true"
}
}