moonstar-x
a74ae969ee
All checks were successful
Gitea - Public/kavita-books-organizer/pipeline/head This commit looks good
59 lines
950 B
Groovy
59 lines
950 B
Groovy
pipeline {
|
|
agent {
|
|
label 'local-agent'
|
|
}
|
|
|
|
options {
|
|
ansiColor('xterm')
|
|
timestamps()
|
|
}
|
|
|
|
environment {
|
|
DOCKER_IMAGE = 'public/kavita-books-organizer'
|
|
DOCKER_REGISTRY = credentials('docker_registry')
|
|
}
|
|
|
|
stages {
|
|
stage('Build Docker Image') {
|
|
when {
|
|
allOf {
|
|
branch 'master'
|
|
|
|
not {
|
|
changeRequest()
|
|
}
|
|
}
|
|
}
|
|
|
|
steps {
|
|
echo 'Building docker image...'
|
|
|
|
script {
|
|
image = docker.build(DOCKER_IMAGE)
|
|
}
|
|
}
|
|
}
|
|
|
|
stage('Deploy Docker Image') {
|
|
when {
|
|
allOf {
|
|
branch 'master'
|
|
|
|
not {
|
|
changeRequest()
|
|
}
|
|
}
|
|
}
|
|
|
|
steps {
|
|
echo 'Deploying docker image to registry...'
|
|
|
|
script {
|
|
docker.withRegistry(DOCKER_REGISTRY, 'gitea_packages_account') {
|
|
image.push('latest')
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
} |