Added Jenkinsfile.
All checks were successful
Gitea - Public/kavita-books-organizer/pipeline/head This commit looks good
All checks were successful
Gitea - Public/kavita-books-organizer/pipeline/head This commit looks good
This commit is contained in:
parent
a5180339a1
commit
a74ae969ee
59
Jenkinsfile
vendored
Normal file
59
Jenkinsfile
vendored
Normal 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')
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user