Skip to content

Commit e24e830

Browse files
committed
Jenkinsfile: Calculate K_VERSION correctly
1 parent 80781a4 commit e24e830

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

Jenkinsfile

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,17 @@
11
pipeline {
2+
environment {
3+
LONG_REV = """${sh(returnStdout: true, script: 'git rev-parse HEAD').trim()}"""
4+
K_VERSION = """${sh(returnStdout: true, script: 'cat deps/k_release | cut --characters=2-').trim()}"""
5+
}
26
agent {
37
dockerfile {
48
label 'docker'
5-
additionalBuildArgs '--build-arg K_COMMIT=$(cat deps/k_release | cut --delimiter="-" --field="2") --build-arg USER_ID=$(id -u) --build-arg GROUP_ID=$(id -g)'
9+
additionalBuildArgs '--build-arg K_COMMIT=${K_VERSION} --build-arg USER_ID=$(id -u) --build-arg GROUP_ID=$(id -g)'
610
}
711
}
812
options {
913
ansiColor('xterm')
1014
}
11-
environment {
12-
LONG_REV = """${sh(returnStdout: true, script: 'git rev-parse HEAD').trim()}"""
13-
}
1415
stages {
1516
stage('Init title') {
1617
when { changeRequest() }

0 commit comments

Comments
 (0)