forked from coreos/coreos-assembler
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.cci.jenkinsfile
More file actions
65 lines (51 loc) · 2.25 KB
/
.cci.jenkinsfile
File metadata and controls
65 lines (51 loc) · 2.25 KB
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
63
64
65
// Documentation: https://github.com/coreos/coreos-ci/blob/main/README-upstream-ci.md
properties([
// abort previous runs when a PR is updated to save resources
disableConcurrentBuilds(abortPrevious: true),
// only keep the last 10 builds
// builds older than 30 days are also rotated out
buildDiscarder(logRotator(
numToKeepStr: '10',
daysToKeepStr: '30'
))
])
// Grab a decent amount of memory/cpu
def cpuCount = 10
def memory = (12 * 1024) as Integer
// Build coreos-assembler image and create
// an imageStream for it
def cpuCount_s = cpuCount.toString()
def imageName = buildImage(env: [ENABLE_GO_RACE_DETECTOR: "1", GOMAXPROCS: cpuCount_s], cpu: cpuCount_s)
cosaPod(cpu: "${cpuCount}",
memory: "${memory}Mi",
image: imageName + ":latest") {
checkout scm
stage("Unit tests") {
shwrap("make check")
shwrap("make unittest")
}
shwrap("rpm -qa | sort > rpmdb.txt")
archiveArtifacts artifacts: 'rpmdb.txt'
// Run stage Build FCOS (init, fetch and build)
cosaBuild(skipKola: 1, cosaDir: "/srv", noForce: true)
// Run stage Kola QEMU (basic-qemu-scenarios, upgrade and self tests)
kola(cosaDir: "/srv", addExtTests: ["${env.WORKSPACE}/ci/run-kola-self-tests"])
stage("Build Artifacts") {
def artifacts = ["aliyun", "applehv", "aws", "azure", "azurestack",
"digitalocean", "exoscale", "gcp", "hetzner", "hyperv",
"ibmcloud", "kubevirt", "live", "metal", "metal4k",
"nutanix", "openstack", "vultr"]
utils.cosaCmd(cosaDir: "/srv", args: "osbuild ${artifacts.join(' ')}")
cosaParallelCmds(cosaDir: "/srv", commands: ["vmware", "virtualbox"])
// quick schema validation
utils.cosaCmd(cosaDir: "/srv", args: "meta --get name")
}
kolaTestIso(cosaDir: "/srv")
stage("Compress") {
// Test compression but only a few of the artifacts. This should test xz, zip, gzip
utils.cosaCmd(cosaDir: "/srv", args: "compress --fast --artifact=qemu --artifact=applehv --artifact=hyperv")
}
stage("Upload Dry Run") {
utils.cosaCmd(cosaDir: "/srv", args: "buildupload --dry-run s3 --acl=public-read my-nonexistent-bucket/my/prefix")
}
}