You've already forked agentic-coding-workflow
Jenkinsfile
This commit is contained in:
Vendored
+39
@@ -0,0 +1,39 @@
|
||||
pipeline {
|
||||
agent any
|
||||
|
||||
environment {
|
||||
REGISTRY = 'git.jerryyan.net'
|
||||
IMAGE = "${REGISTRY}/q792602257/agent-coding-workflow"
|
||||
TAG = sh(script: 'git rev-parse --short HEAD', returnStdout: true).trim()
|
||||
}
|
||||
|
||||
stages {
|
||||
stage('Build & Push') {
|
||||
steps {
|
||||
withCredentials([usernamePassword(
|
||||
credentialsId: 'gitea-registry',
|
||||
usernameVariable: 'REGISTRY_USER',
|
||||
passwordVariable: 'REGISTRY_PASS'
|
||||
)]) {
|
||||
sh """
|
||||
docker build -t ${IMAGE}:${TAG} -t ${IMAGE}:latest .
|
||||
echo "\$REGISTRY_PASS" | docker login ${REGISTRY} -u "\$REGISTRY_USER" --password-stdin
|
||||
docker push ${IMAGE}:${TAG}
|
||||
docker push ${IMAGE}:latest
|
||||
"""
|
||||
}
|
||||
}
|
||||
post {
|
||||
always {
|
||||
sh 'docker logout ${REGISTRY} || true'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
post {
|
||||
failure {
|
||||
echo "Build failed for commit ${env.TAG}"
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user