Use Jenkins instead
This commit is contained in:
parent
478f8a473f
commit
01fd623189
2 changed files with 55 additions and 17 deletions
|
|
@ -1,17 +0,0 @@
|
|||
when:
|
||||
event: tag
|
||||
|
||||
steps:
|
||||
docker:
|
||||
image: woodpeckerci/plugin-docker-buildx
|
||||
privileged: true
|
||||
settings:
|
||||
registry: codeberg.org
|
||||
repo: codeberg.org/lvl0/incr
|
||||
tags: ${CI_COMMIT_TAG}
|
||||
dockerfile: docker/Dockerfile
|
||||
context: .
|
||||
username:
|
||||
from_secret: REGISTRY_USERNAME
|
||||
password:
|
||||
from_secret: REGISTRY_PASSWORD
|
||||
55
Jenkinsfile
vendored
Normal file
55
Jenkinsfile
vendored
Normal file
|
|
@ -0,0 +1,55 @@
|
|||
pipeline {
|
||||
agent any
|
||||
|
||||
environment {
|
||||
REGISTRY = 'codeberg.org/lvl0/incr'
|
||||
IMAGE_TAG = "${env.GIT_TAG_NAME ?: 'latest'}"
|
||||
}
|
||||
|
||||
triggers {
|
||||
pollSCM('H/5 * * * *') // Replace with webhook later
|
||||
}
|
||||
|
||||
stages {
|
||||
stage('Check Tag') {
|
||||
when {
|
||||
expression {
|
||||
return env.GIT_TAG_NAME != null
|
||||
}
|
||||
}
|
||||
steps {
|
||||
echo "🕵️ Detected tag: ${env.GIT_TAG_NAME}"
|
||||
}
|
||||
}
|
||||
|
||||
stage('Build Docker Image') {
|
||||
when {
|
||||
expression {
|
||||
return env.GIT_TAG_NAME != null
|
||||
}
|
||||
}
|
||||
steps {
|
||||
sh """
|
||||
echo "⚙️ Building Docker image for ${IMAGE_TAG}"
|
||||
docker build -f docker/Dockerfile -t ${REGISTRY}:${IMAGE_TAG} .
|
||||
"""
|
||||
}
|
||||
}
|
||||
|
||||
stage('Push to Registry') {
|
||||
when {
|
||||
expression {
|
||||
return env.GIT_TAG_NAME != null
|
||||
}
|
||||
}
|
||||
steps {
|
||||
withCredentials([usernamePassword(credentialsId: 'codeberg-registry', usernameVariable: 'REGISTRY_USER', passwordVariable: 'REGISTRY_PASS')]) {
|
||||
sh """
|
||||
echo "$REGISTRY_PASS" | docker login ${REGISTRY} -u "$REGISTRY_USER" --password-stdin
|
||||
docker push ${REGISTRY}:${IMAGE_TAG}
|
||||
"""
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Reference in a new issue