Files
homepage/Jenkinsfile
T
Georgios Jason Efstathiou f444f93b0b
Gitea/homepage/pipeline/head This commit looks good
maybe fix fix it?
2025-01-17 22:49:37 +01:00

40 lines
769 B
Groovy

pipeline {
agent any
environment {
REGISTRY = "docker.internal.jason-e.dev:8443"
IMAGE_NAME = "efstajas/homepage"
}
stages {
stage('Docker Build') {
steps {
script {
dockerImage = docker.build("$IMAGE_NAME")
}
}
}
stage('Docker Publish') {
steps {
script {
docker.withRegistry("https://$REGISTRY") {
dockerImage.push("latest")
}
}
}
}
stage('Deploy to Nomad') {
steps {
script {
// Read the jobspec.json file
def jobSpec = readFile 'jobspec.json'
sh 'curl -X POST -H "Content-Type: application/json" -d "$jobSpec" http://nomad.service.consul:4646/v1/jobs'
}
}
}
}
}