Files
homepage/Jenkinsfile
T
Georgios Jason Efstathiou b7fa2fdcfe
Gitea/homepage/pipeline/head There was a failure building this commit
change jenkinsfile again
2024-12-23 12:06:01 +01:00

34 lines
658 B
Groovy

pipeline {
agent {
docker {
image 'docker' // Use an image with Node.js and Docker installed
args '-u root -v /var/run/docker.sock:/var/run/docker.sock' // Mount Docker socket
}
}
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")
}
}
}
}
}
}