try this
Gitea/homepage/pipeline/head There was a failure building this commit

This commit is contained in:
Georgios Jason Efstathiou
2024-12-22 20:06:11 +01:00
parent c7afc41a1c
commit 32d5ac9dec
Vendored
+14 -18
View File
@@ -1,28 +1,24 @@
pipeline {
agent any
node {
def app
environment {
REGISTRY = "docker-registry.service.consul"
IMAGE_NAME = "homepage"
stage('Clone repository') {
checkout scm
}
stages {
stage('Docker Build') {
steps {
script {
dockerImage = docker.build("$REGISTRY/$IMAGE_NAME")
stage('Build image') {
app = docker.build("brandonjones085/test")
}
stage('Test image') {
app.inside {
sh 'echo "Tests passed"'
}
}
stage('Docker Publish') {
steps {
script {
docker.withRegistry("http://$REGISTRY") {
dockerImage.push("latest")
}
}
}
stage('Push image') {
docker.withRegistry('https://registry.hub.docker.com', 'git') {
app.push("${env.BUILD_NUMBER}")
app.push("latest")
}
}
}