partybot/Jenkinsfile
Morgan McMillian ec2dfcec42
All checks were successful
dreamfall/partybot/pipeline/head This commit looks good
adjustment to docker registry settings and add status messages
2022-11-29 22:27:43 -08:00

79 lines
3.5 KiB
Groovy

pipeline {
agent none
environment {
SNAPCRAFT_STORE_CREDENTIALS = credentials('snapcraft-store-credentials')
registryCredential = credentials('docker-gitea-creds')
}
options {
skipDefaultCheckout(true)
}
stages {
stage('Build docker image') {
agent { label 'docker-build' }
steps {
mattermostSend "Docker build started - ${env.JOB_NAME} ${env.BUILD_NUMBER} (<${env.BUILD_URL}|Open>)"
cleanWs()
checkout scm
script {
docker.withRegistry('https://git.dreamfall.space/thrrgilag', registryCredential) {
def customImage = docker.build('git.dreamfall.space/thrrgilag/partybot:latest')
customImage.push()
}
}
}
post {
success {
mattermostSend color: "good", message: "Docker build success - ${env.JOB_NAME} ${env.BUILD_NUMBER} (<${env.BUILD_URL}|Open>)"
}
failure {
mattermostSend color: "danger", message: "Docker build failure - ${env.JOB_NAME} ${env.BUILD_NUMBER} (<${env.BUILD_URL}|Open>)"
}
}
}
stage('Build snap packages') {
when { expression { false == true } }
parallel {
stage('Build snap for ARM64') {
agent { label "snap-arm64" }
steps {
mattermostSend "ARM64 Snap build started - ${env.JOB_NAME} ${env.BUILD_NUMBER} (<${env.BUILD_URL}|Open>)"
cleanWs()
checkout scm
sh "snapcraft clean"
sh "snapcraft"
}
post {
success {
mattermostSend color: "good", message: "ARM64 Snap build success - ${env.JOB_NAME} ${env.BUILD_NUMBER} (<${env.BUILD_URL}|Open>)"
archiveArtifacts artifacts: '*.snap'
sh "snapcraft upload --release=edge *.snap"
}
failure {
mattermostSend color: "danger", message: "ARM64 Snap build failure - ${env.JOB_NAME} ${env.BUILD_NUMBER} (<${env.BUILD_URL}|Open>)"
}
}
}
stage('Build snap for AMD64') {
agent { label "snap-amd64" }
steps {
mattermostSend "AMD64 Snap build Started - ${env.JOB_NAME} ${env.BUILD_NUMBER} (<${env.BUILD_URL}|Open>)"
cleanWs()
checkout scm
sh "snapcraft clean"
sh "snapcraft"
}
post {
success {
mattermostSend color: "good", message: "AMD64 Snap build success - ${env.JOB_NAME} ${env.BUILD_NUMBER} (<${env.BUILD_URL}|Open>)"
archiveArtifacts artifacts: '*.snap'
sh "snapcraft upload --release=edge *.snap"
}
failure {
mattermostSend color: "danger", message: "AMD64 Snap build failure - ${env.JOB_NAME} ${env.BUILD_NUMBER} (<${env.BUILD_URL}|Open>)"
}
}
}
}
}
}
}