fritzkink
2023-12-25 d0e7e113635048a7c5d7abd80b5ac76c58408492
commit | author | age
4a2f97 1 import jenkins.model.Jenkins
TW 2
6bbc19 3 @Library("BuildLib") _
4a2f97 4
caeb09 5 /**
TW 6  * Gets the commit hash from a Jenkins build object, if any
7  */
8 @NonCPS
9 def commitHashForBuild( build ) {
10   def scmAction = build?.actions.find { action -> action instanceof jenkins.scm.api.SCMRevisionAction }
11   return scmAction?.revision?.hash
12 }
13
6bbc19 14 pipeline {
TW 15     agent {
16         node {
17             label 'userland'
18         }
19     }
20     stages {
33a37d 21         stage('Ensure is ready to build') {
TW 22             steps {
332bc2 23                 sh 'pfexec /usr/sbin/mountall -F nfs || exit 0'
33a37d 24             }
TW 25         }
6bbc19 26         stage('Git Checkout') {
TW 27             steps {
28                 withSharedWs() {
29                     git branch: 'oi/hipster', url: 'https://github.com/OpenIndiana/oi-userland.git'
30                 }
31             }
32         }
33         stage('Gmake Setup') {
34             steps {
35                 sh 'rm -f components/components.mk'
36                 sh 'rm -f components/depends.mk'
34f00b 37                 withPublisher('openindiana.org', 'incremental') {
6bbc19 38                     sh 'gmake setup'
TW 39                 }
40             }
41         }
42         stage('Gmake Publish') {
43             steps {
34f00b 44                 withPublisher('openindiana.org', 'incremental') {
4a2f97 45                     script {
caeb09 46                         def last_build = Jenkins.instance.getItem('OpenIndiana').getItem('Userland').lastSuccessfulBuild
TW 47                         def last_commit = commitHashForBuild(last_build)
5c47f5 48                     
4a2f97 49                     }
771159 50                     sh './tools/jenkinshelper-main.ksh -s build_changed'
6bbc19 51                 }
TW 52             }
53         }
34f00b 54         stage('copy packages') {
TW 55             steps {
761c4f 56                 pkgcopy()
34f00b 57             }
TW 58         }
59         stage('update system') {
60             steps {
61                 update()
894422 62                 sh '/opt/local/bin/cleanup_bootenvs.sh'
34f00b 63             }
TW 64         }
6bbc19 65     }
TW 66 }
67