reddit-slideshow/Jenkinsfile

59 lines
944 B
Plaintext
Raw Permalink Normal View History

2023-06-02 14:00:52 -05:00
pipeline {
agent {
label 'local-agent'
}
options {
ansiColor('xterm')
timestamps()
}
environment {
DOCKER_IMAGE = 'public/reddit-slideshow'
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')
}
}
}
}
}
}