Skip to content

Commit 27cf3cd

Browse files
committed
add env stage
1 parent 3676f53 commit 27cf3cd

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

Jenkinsfile

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
pipeline {
22
agent any
33

4+
environment {
5+
install = "docker exec -it node sh -c 'npm install --save-dev jest'"
6+
test = "docker exec node sh -c 'npm test'"
7+
}
8+
49
stages {
510
stage('build') {
611
steps {
@@ -16,8 +21,8 @@ pipeline {
1621
steps {
1722
echo "test pipeline"
1823
sh '''
19-
docker exec -it node sh -c "npm install --save-dev jest"
20-
docker exec node sh -c "npm test"
24+
${install}
25+
${test}
2126
'''
2227
}
2328
}

0 commit comments

Comments
 (0)