-
Notifications
You must be signed in to change notification settings - Fork 83
/
Copy pathpsi-tier-3-pipeline-executor.groovy
87 lines (76 loc) · 3.08 KB
/
psi-tier-3-pipeline-executor.groovy
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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
// Pipeline script for executing Tier-3 test suites
// Recipe file path details
def recipeFile = "RHCEPH-*.yaml"
def recipeFileDir = "/ceph/cephci-jenkins/latest-rhceph-container-info"
// Default job parameters
def buildType = (params.buildType)?.trim() ?: "tier-1"
def overrides = (params.overrides)?.trim() ?: "{}"
def tags = (params.tags)?.trim() ?: "schedule,openstack-only,tier-3,stage-1"
// Pipeline script entry point
node("rhel-9-medium || ceph-qe-ci") {
stage('prepareNode') {
if (env.WORKSPACE) { sh script: "sudo rm -rf * .venv" }
checkout(
scm: [
$class: 'GitSCM',
branches: [[name: 'origin/master']],
extensions: [[
$class: 'CleanBeforeCheckout',
deleteUntrackedNestedRepositories: true
], [
$class: 'WipeWorkspace'
], [
$class: 'CloneOption',
depth: 1,
noTags: true,
shallow: true,
timeout: 10,
reference: ''
]],
userRemoteConfigs: [[
url: 'https://github.com/red-hat-storage/cephci.git'
]]
],
changelog: false,
poll: false
)
load("${env.WORKSPACE}/pipeline/vars/v3.groovy").prepareNode(1)
}
stage("executeWorkflow") {
println("Begin synchronizing image artifacts.")
def validRecipeFiles = sh(
returnStdout: true,
script: "find ${recipeFileDir} -name ${recipeFile} -mtime -7 -print"
).trim().split("\n") as List
if (! validRecipeFiles ) {
currentBuild.result = 'ABORTED'
error("There no new RHCS build since last Friday")
}
for (validRecipeFile in validRecipeFiles) {
def rhcephVersion = validRecipeFile.split("/").last().replace(".yaml", "")
def recipeContent = readYaml file: "${validRecipeFile}"
if ( ! recipeContent.containsKey('tier-1') ) {
println('No stable build available for ${rhcephVersion}')
continue
}
def recipeString = writeJSON returnText: true, json: recipeContent['tier-1']
println("Triggering test execution:")
println("\tRHCEPH Version: ${rhcephVersion}")
println("\tBuild: ${buildType}")
println("\tRecipe: ${recipeContent['tier-1']}")
println("\tOverrides: ${overrides}")
println("\tMetadata tags: ${tags}")
build ([
wait: false,
job: "rhceph-test-execution-pipeline",
parameters: [
string(name: 'rhcephVersion', value: rhcephVersion),
string(name: 'tags', value: tags),
string(name: 'buildType', value: buildType),
string(name: 'overrides', value: overrides),
string(name: 'buildArtifacts', value: recipeString)
]
])
}
}
}