xref: /illumos-joyent/Jenkinsfile (revision 7ff6d3a0)
1/*
2 * This Source Code Form is subject to the terms of the Mozilla Public
3 * License, v. 2.0. If a copy of the MPL was not distributed with this
4 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
5 */
6
7/*
8 * Copyright 2020 Joyent, Inc.
9 */
10
11@Library('jenkins-joylib@v1.0.4') _
12
13pipeline {
14
15    agent {
16        label 'platform:true && image_ver:18.4.0 && pkgsrc_arch:x86_64 && ' +
17            'dram:8gb && !virt:kvm && fs:pcfs && fs:ufs && jenkins_agent:2'
18    }
19
20    options {
21        buildDiscarder(logRotator(numToKeepStr: '30'))
22        timestamps()
23        parallelsAlwaysFailFast()
24    }
25
26    stages {
27        stage('trigger smartos-live') {
28            when {
29                anyOf {
30                    branch 'master'
31                    triggeredBy cause: 'UserIdCause'
32                }
33                // Prevent a user from starting a UserIdCause build on a
34                // release branch, since that would trigger the smartos-live
35                // 'master' branch build below, which is not what we want.
36                not {
37                    branch pattern: 'release-\\d+', comparator: 'REGEXP'
38                }
39            }
40            steps {
41                build(job:'joyent-org/smartos-live/master',
42                    wait: false,
43                    parameters: [
44                        text(name: 'CONFIGURE_PROJECTS',
45                            value:
46                            "illumos-extra: master: origin\n" +
47                            'illumos: $BRANCH_NAME: origin\n' +
48                            'local/kbmd: master: origin\n' +
49                            'local/kvm-cmd: master: origin\n' +
50                            'local/kvm: master: origin\n' +
51                            'local/mdata-client: master: origin\n' +
52                            'local/ur-agent: master: origin')
53                    ])
54            }
55        }
56    }
57    post {
58        always {
59            joyMattermostNotification(channel: 'jenkins')
60        }
61    }
62}
63