Jenkinsfile 1.86 KB
Newer Older
Harald Sitter's avatar
importy  
Harald Sitter committed
1 2 3 4
env.DIST = 'xenial'
env.TYPE = 'user'
env.PWD_BIND = '/workspace'

Harald Sitter's avatar
Harald Sitter committed
5
cleanNode('master') {
6
  ws('/tmp/kde-os-autoinst') {
7 8 9 10
    try {
      stage('clone') {
        git 'https://github.com/apachelogger/kde-os-autoinst'
      }
11 12 13 14 15 16
      stage('iso-handover') {
          if (params.ISO) {
            echo 'Picking up ISO from trigger job.'
            sh "cp -v ${params.ISO} incoming.iso"
        }
      }
17 18 19
      stage('installation') {
        sh 'INSTALLATION=1 bin/contain.rb /workspace/bin/bootstrap.rb'
      }
20 21 22 23 24 25
      stage('archive-raid') {
        tar = "/var/www/metadata/os-autoinst/${env.TYPE}.tar"
        sh "tar --exclude=*.iso --exclude=*.iso.* --exclude=*socket --exclude=wok/video.ogv --exclude=wok/ulogs --exclude=wok/testresults -cf ${tar}.new ."
        sh "gpg2 --armor --detach-sign -o ${tar}.new.sig ${tar}.new"
        sh "mv -v ${tar}.new ${tar}"
        sh "mv -v ${tar}.new.sig ${tar}.sig"
26 27
      }
    } finally {
Harald Sitter's avatar
Harald Sitter committed
28
      archiveArtifacts 'wok/testresults/*.png, wok/testresults/*.json, wok/ulogs/*, wok/video.ogv'
Harald Sitter's avatar
Harald Sitter committed
29
      junit 'junit/*'
30 31 32
      // sh 'rm -f wok.tar wok.tar.xz'
      // sh 'tar cfJ wok.tar.xz wok'
      // archiveArtifacts 'wok.tar.xz'
Harald Sitter's avatar
Harald Sitter committed
33
      sh 'bin/contain.rb chown -R jenkins .'
34
    }
Harald Sitter's avatar
importy  
Harald Sitter committed
35 36 37 38 39 40
  }
}

def cleanNode(label = null, body) {
  node(label) {
    try {
41 42 43 44 45
// Supremely bugged causing excessive slowdown in jenkins. not sure why.
// <org.jenkinsci.plugins.livescreenshot.LiveScreenshotBuildWrapper plugin="livescreenshot@1.4.5">
// <fullscreenFilename>screenshot.png</fullscreenFilename>
// <thumbnailFilename>screenshot-thumb.png</thumbnailFilename>
// </org.jenkinsci.plugins.livescreenshot.LiveScreenshotBuildWrapper>
Harald Sitter's avatar
importy  
Harald Sitter committed
46 47 48 49 50
      wrap([$class: 'AnsiColorBuildWrapper', colorMapName: 'xterm']) {
        wrap([$class: 'TimestamperBuildWrapper']) {
          body()
        }
      }
Harald Sitter's avatar
Harald Sitter committed
51
    } finally {
52
      // step([$class: 'WsCleanup', cleanWhenFailure: true])
Harald Sitter's avatar
importy  
Harald Sitter committed
53 54 55
    }
  }
}