forked from tidelift/jenkins-pipeline-example
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathJenkinsfile-example
38 lines (36 loc) · 1.15 KB
/
Jenkinsfile-example
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
// Jenkinsfile example for checking dependencies from version control against a
// Tidelift Catalog
// Set build environment variable for the Tidelift API Key
// This example is for maven
pipeline {
agent any
tools {
maven 'maven 3.6.3'
}
environment {
TIDELIFT_API_KEY = credentials('tidelift-project-api-key')
}
// Checkout code from your version control system
stages {
stage('Checkout code') {
steps {
git 'https://some-git-repo.git'
}
}
// Download the Tidelift CLI and make it executable
stage('Downloading Tidelift CLI') {
steps {
sh 'curl -s -o ./tidelift https://download.tidelift.com/cli/tidelift'
sh 'chmod +x ./tidelift'
}
}
// Run Tidelift Catalog alignment and save output to Tidelift
stage('Running Tidelift Alignment') {
steps {
// optional: do not break build if failure, only log the failure
// catchError(buildResult: 'SUCCESS', stageResult: 'FAILURE') {
sh "./tidelift alignment save --wait"}
}
}
}
}