Can't get sfdx force:package:install to block in a Jenkinsfile
up vote
6
down vote
favorite
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.
salesforcedx continuous-integration jenkins
add a comment |
up vote
6
down vote
favorite
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.
salesforcedx continuous-integration jenkins
Is the observed behavior that the subshell returns immediately and SFDX spins in the background? (Just asking, I'm not particularly familiar with Jenkins).
– David Reed
Dec 5 at 16:07
1
@DavidReed Yes, I assume the install continues. But a colleague has just pointed out that adding--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.
– Keith C
Dec 5 at 16:16
add a comment |
up vote
6
down vote
favorite
up vote
6
down vote
favorite
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.
salesforcedx continuous-integration jenkins
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.
salesforcedx continuous-integration jenkins
salesforcedx continuous-integration jenkins
edited Dec 5 at 16:26
asked Dec 5 at 15:20
Keith C
93.4k1088199
93.4k1088199
Is the observed behavior that the subshell returns immediately and SFDX spins in the background? (Just asking, I'm not particularly familiar with Jenkins).
– David Reed
Dec 5 at 16:07
1
@DavidReed Yes, I assume the install continues. But a colleague has just pointed out that adding--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.
– Keith C
Dec 5 at 16:16
add a comment |
Is the observed behavior that the subshell returns immediately and SFDX spins in the background? (Just asking, I'm not particularly familiar with Jenkins).
– David Reed
Dec 5 at 16:07
1
@DavidReed Yes, I assume the install continues. But a colleague has just pointed out that adding--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.
– Keith C
Dec 5 at 16:16
Is the observed behavior that the subshell returns immediately and SFDX spins in the background? (Just asking, I'm not particularly familiar with Jenkins).
– David Reed
Dec 5 at 16:07
Is the observed behavior that the subshell returns immediately and SFDX spins in the background? (Just asking, I'm not particularly familiar with Jenkins).
– David Reed
Dec 5 at 16:07
1
1
@DavidReed Yes, I assume the install continues. But a colleague has just pointed out that adding
--noprompt
looks like it fixes the problem; without that the sfdx 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.– Keith C
Dec 5 at 16:16
@DavidReed Yes, I assume the install continues. But a colleague has just pointed out that adding
--noprompt
looks like it fixes the problem; without that the sfdx 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.– Keith C
Dec 5 at 16:16
add a comment |
1 Answer
1
active
oldest
votes
up vote
6
down vote
accepted
Some installations prompt you for permissions/confirmations.
Check the build failure log and see if there's some pending prompting during your Add other packages
stage.
If that's the case, add the --noprompt
option to the sfdx force:package:install
command.
Explanation
If sfdx
prompts the user for confirmations, my guess is that since there's no console attached it just aborts the process.
Thanks Francesco. Looks like this is the solution. (I think I was getting a return status of zero when I checked though.)
– Keith C
Dec 5 at 16:24
add a comment |
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
6
down vote
accepted
Some installations prompt you for permissions/confirmations.
Check the build failure log and see if there's some pending prompting during your Add other packages
stage.
If that's the case, add the --noprompt
option to the sfdx force:package:install
command.
Explanation
If sfdx
prompts the user for confirmations, my guess is that since there's no console attached it just aborts the process.
Thanks Francesco. Looks like this is the solution. (I think I was getting a return status of zero when I checked though.)
– Keith C
Dec 5 at 16:24
add a comment |
up vote
6
down vote
accepted
Some installations prompt you for permissions/confirmations.
Check the build failure log and see if there's some pending prompting during your Add other packages
stage.
If that's the case, add the --noprompt
option to the sfdx force:package:install
command.
Explanation
If sfdx
prompts the user for confirmations, my guess is that since there's no console attached it just aborts the process.
Thanks Francesco. Looks like this is the solution. (I think I was getting a return status of zero when I checked though.)
– Keith C
Dec 5 at 16:24
add a comment |
up vote
6
down vote
accepted
up vote
6
down vote
accepted
Some installations prompt you for permissions/confirmations.
Check the build failure log and see if there's some pending prompting during your Add other packages
stage.
If that's the case, add the --noprompt
option to the sfdx force:package:install
command.
Explanation
If sfdx
prompts the user for confirmations, my guess is that since there's no console attached it just aborts the process.
Some installations prompt you for permissions/confirmations.
Check the build failure log and see if there's some pending prompting during your Add other packages
stage.
If that's the case, add the --noprompt
option to the sfdx force:package:install
command.
Explanation
If sfdx
prompts the user for confirmations, my guess is that since there's no console attached it just aborts the process.
answered Dec 5 at 16:20
Francesco Pitzalis
1816
1816
Thanks Francesco. Looks like this is the solution. (I think I was getting a return status of zero when I checked though.)
– Keith C
Dec 5 at 16:24
add a comment |
Thanks Francesco. Looks like this is the solution. (I think I was getting a return status of zero when I checked though.)
– Keith C
Dec 5 at 16:24
Thanks Francesco. Looks like this is the solution. (I think I was getting a return status of zero when I checked though.)
– Keith C
Dec 5 at 16:24
Thanks Francesco. Looks like this is the solution. (I think I was getting a return status of zero when I checked though.)
– Keith C
Dec 5 at 16:24
add a comment |
Thanks for contributing an answer to Salesforce Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsalesforce.stackexchange.com%2fquestions%2f241528%2fcant-get-sfdx-forcepackageinstall-to-block-in-a-jenkinsfile%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Is the observed behavior that the subshell returns immediately and SFDX spins in the background? (Just asking, I'm not particularly familiar with Jenkins).
– David Reed
Dec 5 at 16:07
1
@DavidReed Yes, I assume the install continues. But a colleague has just pointed out that adding
--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.– Keith C
Dec 5 at 16:16