Jenkinsfile and xai cli for nextcloud deployment
This commit is contained in:
62
dockerfiles/services/nextcloud/Jenkinsfile
vendored
Normal file
62
dockerfiles/services/nextcloud/Jenkinsfile
vendored
Normal file
@@ -0,0 +1,62 @@
|
||||
pipeline {
|
||||
environment {
|
||||
APP_NAME = 'xaibox'
|
||||
WORKDIR = 'dockerfiles/services/nextcloud'
|
||||
}
|
||||
|
||||
agent { label 'docker' }
|
||||
options {
|
||||
buildDiscarder(logRotator(numToKeepStr: '2'))
|
||||
}
|
||||
triggers {
|
||||
cron('@weekly')
|
||||
}
|
||||
|
||||
stages {
|
||||
stage('prepare') {
|
||||
steps {
|
||||
checkout scm
|
||||
sh 'ls'
|
||||
}
|
||||
}
|
||||
|
||||
stage('build') {
|
||||
options {
|
||||
ansiColor('xterm')
|
||||
timeout(2)
|
||||
}
|
||||
steps {
|
||||
dir(WORKDIR) {
|
||||
withDockerRegistry(credentialsId: 'b11d7f1a-81ac-4daf-8842-56afc0d2370e', url: 'http://dkregistry.xai-corp.net:5000') {
|
||||
sh "pwd"
|
||||
sh "xai build"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
stage('deploy') {
|
||||
options {
|
||||
ansiColor('xterm')
|
||||
timeout(2)
|
||||
}
|
||||
steps {
|
||||
dir(WORKDIR) {
|
||||
withDockerRegistry(credentialsId: 'b11d7f1a-81ac-4daf-8842-56afc0d2370e', url: 'http://dkregistry.xai-corp.net:5000') {
|
||||
sh "xai deploy"
|
||||
}
|
||||
}
|
||||
}
|
||||
post {
|
||||
failure {
|
||||
dir(WORKDIR) {
|
||||
withDockerRegistry(credentialsId: 'b11d7f1a-81ac-4daf-8842-56afc0d2370e', url: 'http://dkregistry.xai-corp.net:5000') {
|
||||
sh "xai rollback"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user