1 import jenkins
.model
.Jenkins
6 * Gets the commit hash from a Jenkins build object, if any
9 def
commitHashForBuild( build
) {
10 def scmAction
= build?
.actions
.find
{ action
-> action
instanceof jenkins
.scm
.api
.SCMRevisionAction
}
11 return scmAction?
.revision?
.hash
15 String
getChangedFilesList() {
17 for (changeLogSet in currentBuild
.changeSets
) {
18 for (entry in changeLogSet
.getItems()) { // for each commit in the detected changes
19 for (file in entry
.getAffectedFiles()) {
20 changedFiles
.add(file
.getPath()) // add changed file to list
34 stage('Ensure is ready to build') {
36 sh
'pfexec /usr/sbin/mountall -F nfs || exit 0'
39 stage('Git Checkout') {
42 git branch
: 'oi/hipster', url
: 'https://github.com/OpenIndiana/oi-userland.git'
46 stage('Gmake Setup') {
48 sh
'rm -f components/components.mk'
49 sh
'rm -f components/depends.mk'
50 withPublisher('openindiana.org', 'incremental') {
55 stage('Gmake Publish') {
57 withPublisher('openindiana.org', 'incremental') {
59 writeFile file
: 'changed_files.txt', text
: getChangedFilesList().join("\n")
61 sh
'./tools/jenkinshelper-main.ksh -s build_changed'
65 stage('update system') {
68 sh
'/opt/local/bin/cleanup_bootenvs.sh'