Skip to content

Commit 838bb7b

Browse files
Removed arguments passed to add_links in jenkinsfile
1 parent 77b62bc commit 838bb7b

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

Jenkinsfile

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ pipeline {
99
parameters {
1010
string(defaultValue: '', name: 'major_version', description: "Major version of the docs to be built")
1111
string(defaultValue: '', name: 'minor_version', description: "Minor version of the docs to be built")
12+
booleanParam(defaultValue: false, name: 'patch', description: "Is it a patch ?")
1213
}
1314
environment {
1415
GITHUB_TOKEN = credentials('6e7c1e8f-ca2c-4b11-a70e-d934d3f6b681')
@@ -50,7 +51,11 @@ pipeline {
5051
}
5152
stage("Link docs to latest") {
5253
steps{
53-
sh "add_links.sh $major_version $minor_version"
54+
script{
55+
if(params.patch) {
56+
sh "add_links.sh"
57+
}
58+
}
5459
}
5560
}
5661
stage("Push PR for docs") {

add_links.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
cd docs
77
# Count number of dirs in /docs
88
docsDirsCount=`find . -mindepth 1 -maxdepth 1 -type d | wc -l`
9-
# Get last docs version
9+
# Get [-1] docs version
1010
# Substract functions-reference, reference-manual, stan-users-guide, current version and remove trailing /
1111
directory=`ls -d -- */ | sed -n "$(($docsDirsCount-4))"p | sed 's/.$//'`
1212
cd ..

0 commit comments

Comments
 (0)