I have Jenkinsfile, Im trying to stash BuildApp and unstash it into other docker container to run npm test. but seems like it's missing node_modules, so npm test fails.
steps {
dir("/var/jenkins_home") {
unstash "app"
}
echo "Building app (CLOUD_ENV = ${env.CLOUD_ENV})"
sh 'yarn install'
stash name: "BuildApp", includes: "*"
sh "ls -la ${pwd()}"
}
That's where I'm trying to stash and I did debug with "ls -la ${pwd()}" and I see that node_modules are there but when unstash them
steps {
dir("/var/jenkins_home") {
unstash "BuildApp"
}
echo "Testing app (CLOUD_ENV = ${env.CLOUD_ENV})"
// unstash 'builtApp'
sh "ls -la ${pwd()}"
sh 'npm test > test.out'
archiveArtifacts artifacts: 'test.out', fingerprint: true
stash name: "testApp", includes: "*"
}
I did "ls -la ${pwd()}" and I can see that node_modules folder is not there.
Am I doing something wrong?