fritzkink
2023-12-25 d0e7e113635048a7c5d7abd80b5ac76c58408492
ci/user-build.groovy
@@ -2,6 +2,15 @@
@Library("BuildLib") _
/**
 * Gets the commit hash from a Jenkins build object, if any
 */
@NonCPS
def commitHashForBuild( build ) {
  def scmAction = build?.actions.find { action -> action instanceof jenkins.scm.api.SCMRevisionAction }
  return scmAction?.revision?.hash
}
pipeline {
    agent {
        node {
@@ -34,9 +43,11 @@
            steps {
                withPublisher('openindiana.org', 'incremental') {
                    script {
                        def last_commit = Jenkins.instance.getItem('OpenIndiana/Userland').lastSuccessfulBuild.changeset[0].revision
                        def last_build = Jenkins.instance.getItem('OpenIndiana').getItem('Userland').lastSuccessfulBuild
                        def last_commit = commitHashForBuild(last_build)
                    }
                    sh './tools/jenkinshelper-main.ksh -s build_changed $last_commit'
                    sh './tools/jenkinshelper-main.ksh -s build_changed'
                }
            }
        }
@@ -48,7 +59,7 @@
        stage('update system') {
            steps {
                update()
                sh /opt/local/bin/cleanup_bootenvs.sh'
                sh '/opt/local/bin/cleanup_bootenvs.sh'
            }
        }
    }