Jenkinsfile 1.57 KB
Newer Older
Harald Sitter's avatar
importy  
Harald Sitter committed
1
env.DIST = 'xenial'
2
env.TYPE = params.TYPE
Harald Sitter's avatar
importy  
Harald Sitter committed
3 4
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
      stage('rake-test') {
        sh 'rake test'
      }
14 15 16 17 18 19
      stage('iso-handover') {
          if (params.ISO) {
            echo 'Picking up ISO from trigger job.'
            sh "cp -v ${params.ISO} incoming.iso"
        }
      }
Harald Sitter's avatar
Harald Sitter committed
20
      stage('test_installation') {
Harald Sitter's avatar
Harald Sitter committed
21 22 23
        wrap([$class: 'LiveScreenshotBuildWrapper', fullscreenFilename: 'wok/qemuscreenshot/last.png']) {
          sh 'INSTALLATION=1 bin/contain.rb /workspace/bin/bootstrap.rb'
        }
24
      }
25 26 27 28 29 30
      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"
31 32
      }
    } finally {
Harald Sitter's avatar
Harald Sitter committed
33
      archiveArtifacts 'wok/testresults/*.png, wok/testresults/*.json, wok/ulogs/*, wok/video.ogv'
Harald Sitter's avatar
Harald Sitter committed
34
      junit 'junit/*'
Harald Sitter's avatar
Harald Sitter committed
35
      sh 'bin/contain.rb chown -R jenkins .'
36
    }
Harald Sitter's avatar
importy  
Harald Sitter committed
37 38 39 40 41 42 43 44 45 46 47
  }
}

def cleanNode(label = null, body) {
  node(label) {
    try {
      wrap([$class: 'AnsiColorBuildWrapper', colorMapName: 'xterm']) {
        wrap([$class: 'TimestamperBuildWrapper']) {
          body()
        }
      }
Harald Sitter's avatar
Harald Sitter committed
48
    } finally {
49
      // step([$class: 'WsCleanup', cleanWhenFailure: true])
Harald Sitter's avatar
importy  
Harald Sitter committed
50 51 52
    }
  }
}