Till Wegmüller
2023-10-22 4a2f97fac0cb03465ff213e35b6dd01e7a93dd61
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
import jenkins.model.Jenkins
 
@Library("BuildLib") _
 
pipeline {
    agent {
        node {
            label 'userland'
        }
    }
    stages {
        stage('Ensure is ready to build') {
            steps {
                sh 'pfexec /usr/sbin/mountall -F nfs || exit 0'
            }
        }
        stage('Git Checkout') {
            steps {
                withSharedWs() {
                    git branch: 'oi/hipster', url: 'https://github.com/OpenIndiana/oi-userland.git'
                }
            }
        }
        stage('Gmake Setup') {
            steps {
                sh 'rm -f components/components.mk'
                sh 'rm -f components/depends.mk'
                withPublisher('openindiana.org', 'incremental') {
                    sh 'gmake setup'
                }
            }
        }
        stage('Gmake Publish') {
            steps {
                withPublisher('openindiana.org', 'incremental') {
                    script {
                        def last_commit = Jenkins.instance.getItem('OpenIndiana/Userland').lastSuccessfulBuild.changeset[0].revision
                    }
                    sh './tools/jenkinshelper-main.ksh -s build_changed $last_commit'
                }
            }
        }
        stage('copy packages') {
            steps {
                pkgcopy()
            }
        }
        stage('update system') {
            steps {
                update()
                sh /opt/local/bin/cleanup_bootenvs.sh'
            }
        }
    }
}