Files
homepage/Jenkinsfile
T
Georgios Jason Efstathiou e4095abe3f
Gitea/homepage/pipeline/head There was a failure building this commit
add deploy step
2024-12-23 15:01:47 +01:00

37 lines
669 B
Groovy

pipeline {
agent any
environment {
REGISTRY = "docker-registry.service.consul"
IMAGE_NAME = "efstajas/homepage"
}
stages {
stage('Docker Build') {
steps {
script {
dockerImage = docker.build("$IMAGE_NAME")
}
}
}
stage('Docker Publish') {
steps {
script {
docker.withRegistry("http://$REGISTRY:4124") {
dockerImage.push("latest")
}
}
}
}
stage('Deploy to Nomad by running jobspec.hcl') {
steps {
script {
sh 'nomad job run jobspec.hcl -address=http://nomad.service.consul:4646'
}
}
}
}
}