-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathJenkinsfile
More file actions
63 lines (58 loc) · 1.69 KB
/
Copy pathJenkinsfile
File metadata and controls
63 lines (58 loc) · 1.69 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
#!/usr/bin/groovy
// Simple Pipeline that only checks the metadata
pipeline {
agent {
label 'docker'
}
environment {
METADATA_VERSION = "2.0.0"
}
stages {
stage("Variable initialization") {
steps {
script {
checkout scm
}
}
}
stage('AI4OS Hub metadata V2 validation (YAML)') {
when {
// Check if ai4-metadata.yml is present in the repository
expression {fileExists("ai4-metadata.yml")}
}
agent {
docker {
image 'ai4oshub/ci-images:python3.12'
}
}
steps {
script {
if (!fileExists("ai4-metadata.yml")) {
error("ai4-metadata.yml file not found in the repository")
}
if (fileExists("ai4-metadata.json")) {
error("Both ai4-metadata.json and ai4-metadata.yml files found in the repository")
}
}
script {
sh "ai4-metadata validate --metadata-version ${env.METADATA_VERSION} ai4-metadata.yml"
}
}
}
stage("License validation") {
steps {
script {
// Check if LICENSE file is present in the repository
if (!fileExists("LICENSE")) {
error("LICENSE file not found in the repository")
}
}
}
}
}
post {
always {
cleanWs()
}
}
}