aboutsummaryrefslogtreecommitdiffstats
path: root/jenkinsfile.firmware.repo
blob: bd7830c7142676669132e927749d69d2282315d3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
#!/usr/bin/env groovy
/*
 * job name: firmware-repo
 */

def CopyFirmware(project) {
    copyArtifacts([
        filter: 'rpms/*/*.rpm',
        flatten: true,
        projectName: project,
        selector: lastSuccessful(),
        target: "rpms/$project"
    ])
}

pipeline {
    agent {
        kubernetes {
            yamlFile 'centos7-rpmbuild.yaml'
            defaultContainer 'centos7-rpmbuild'
            slaveConnectTimeout '3600'
            nodeSelector 'kubernetes.io/os=linux,kubernetes.io/arch=amd64'
        }
    }

    options {
	buildDiscarder(logRotator(numToKeepStr: '3'))
	disableConcurrentBuilds()
    }

    triggers {
	upstream(upstreamProjects: 'seabios,u-boot,coreboot,edk2,ipxe,qboot',
		 threshold: hudson.model.Result.SUCCESS)
    }

    stages {
        stage ('cleanup') {
            steps {
                dir('rpms') {
                    deleteDir()
                }
            }
        }
        stage ('copy firmware') {
            steps {
                CopyFirmware('coreboot')
                CopyFirmware('edk2')
                CopyFirmware('ipxe')
                CopyFirmware('seabios')
                CopyFirmware('u-boot')
                CopyFirmware('qboot')
            }
        }
        stage ('create repo') {
            steps {
                sh 'createrepo rpms'
                sh 'find rpms -print'
                archiveArtifacts 'rpms/*/*'
            }
        }
    }
}