aboutsummaryrefslogtreecommitdiff
path: root/Jenkinsfile
blob: 93759cfbad177f2350a69e2077d18c4135da75c5 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
String cronString = BRANCH_NAME == 'master' ? '@weekly' : ''

pipeline {
    agent any
    triggers { cron(cronString) }
    options { ansiColor('xterm') }
    stages {
        stage('Check') {
            agent {
                docker {
                    image 'ghcr.io/super-linter/super-linter:latest'
                    args '--entrypoint ""'
                }
            }
            steps { sh 'bash .scripts.d/10-check.sh' }
        }
        stage('Publish') {
            environment { DOCKERHUB_TOKEN = credentials('DOCKERHUB_TOKEN') }
            parallel {
                stage('stable') {
                    steps { sh 'bash .scripts.d/20-publish.sh stable' }
                }
                stage('nightly') {
                    steps { sh 'bash .scripts.d/20-publish.sh nightly' }
                }
            }
        }
    }
    post {
        always {
            step([$class: 'Mailer',
                notifyEveryUnstableBuild: true,
                recipients: "christian+jenkins@segundo.io",
                sendToIndividuals: true])
        }
    }
}