Jenkinsfile 1.66 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'

5 6 7 8
if (params.TYPE) {
  error 'TYPE param not set. Cannot run install test without a type.'
}

Harald Sitter's avatar
Harald Sitter committed
9
cleanNode('master') {
10
  ws('/tmp/kde-os-autoinst') {
11 12 13 14
    try {
      stage('clone') {
        git 'https://github.com/apachelogger/kde-os-autoinst'
      }
15 16 17
      stage('rake-test') {
        sh 'rake test'
      }
18 19 20 21 22 23
      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
24
      stage('test_installation') {
Harald Sitter's avatar
Harald Sitter committed
25 26 27
        wrap([$class: 'LiveScreenshotBuildWrapper', fullscreenFilename: 'wok/qemuscreenshot/last.png']) {
          sh 'INSTALLATION=1 bin/contain.rb /workspace/bin/bootstrap.rb'
        }
28
      }
29 30 31 32 33 34
      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"
35 36
      }
    } finally {
Harald Sitter's avatar
Harald Sitter committed
37
      archiveArtifacts 'wok/testresults/*.png, wok/testresults/*.json, wok/ulogs/*, wok/video.ogv'
Harald Sitter's avatar
Harald Sitter committed
38
      junit 'junit/*'
Harald Sitter's avatar
Harald Sitter committed
39
      sh 'bin/contain.rb chown -R jenkins .'
40
    }
Harald Sitter's avatar
importy  
Harald Sitter committed
41 42 43 44 45 46 47 48 49 50 51
  }
}

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