Added Jenkinsfile.
All checks were successful
Gitea - Public/kavita-books-organizer/pipeline/head This commit looks good

This commit is contained in:
moonstar-x 2023-05-30 01:26:59 -05:00
parent a5180339a1
commit a74ae969ee

59
Jenkinsfile vendored Normal file
View File

@ -0,0 +1,59 @@
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')
}
}
}
}
}
}