Using the Jenkinsfile mechanism - see the Salesforce Jenkinsfile Walkthrough - allows one Continuous Integration (CI) definition to automatically build multiple branches and multiple pull requests via multiple scratch orgs. So it fits well with an SFDX/Git setup.
But I can't find a way to get the sh executions in this step:
stage('Add other packages') {
// Need to block until the installs are done
sh "sfdx force:package:install --wait 15 --package ${A_PACKAGE_VERSION_ID} --installationkey ${A_PACKAGE_PASSWORD}"
sh "sfdx force:package:install --wait 15 --package ${B_PACKAGE_VERSION_ID} --installationkey ${B_PACKAGE_PASSWORD}"
}
to block so that the packages are installed before following tests that depend on those packages run.
If you have this blocking working, please share.
(Note that the Jenkins file adds another layer that seems to stop this salesforce DX installing managed package and status response in an automated environment from being sufficient.)
PS
Thought this might work:
stage('Add other packages') {
echo "Installing A"
timeout(900) {
waitUntil {
sh "sfdx force:package:install --package ${A_PACKAGE_VERSION_ID} --installationkey ${A_PACKAGE_PASSWORD} --wait 15"
}
}
echo "A installed"
based on Make Jenkins pipeline wait until server is up but I get silent failure immediately after the first echo
.
PPS
Both these managed packages include "Remote Site Settings" that normally require a manual confirmation.
--noprompt
looks like it fixes the problem; without that thesfdx force:package:install
is probably waiting for user input as we have remote site definitions in our package and that is blocking the waiting somehow. I've asked him to post an answer here.