update 5 files
This commit is contained in:
17
Jenkinsfile
vendored
17
Jenkinsfile
vendored
@@ -29,21 +29,10 @@ pipeline {
|
||||
sh 'ls -la'
|
||||
}
|
||||
}
|
||||
stage('Check for package.json changes') {
|
||||
stage('Install npm package') {
|
||||
steps {
|
||||
echo "Check for package.json changes"
|
||||
script {
|
||||
// Check if package.json has changed
|
||||
def hasChanges = sh(script: 'git diff --name-only HEAD~1 | grep "package.json"', returnStatus: true) == 0
|
||||
if (hasChanges) {
|
||||
echo "package.json changed, running npm install"
|
||||
currentBuild.result = 'SUCCESS'
|
||||
sh 'npm install'
|
||||
} else {
|
||||
echo "package.json not changed, skipping npm install"
|
||||
currentBuild.result = 'SUCCESS'
|
||||
}
|
||||
}
|
||||
echo "Install npm package"
|
||||
sh 'npm install'
|
||||
}
|
||||
}
|
||||
stage('Run Tests') {
|
||||
|
||||
Reference in New Issue
Block a user