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.










share|improve this question
























  • 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 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

















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.










share|improve this question
























  • 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 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















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.










share|improve this question















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 jenkinsfile






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited yesterday

























asked Dec 5 at 15:20









Keith C

93.7k1088199




93.7k1088199












  • 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 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




















  • 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 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


















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












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.






share|improve this answer





















  • 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













Your Answer








StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "459"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















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

























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.






share|improve this answer





















  • 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

















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.






share|improve this answer





















  • 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















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.






share|improve this answer












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.







share|improve this answer












share|improve this answer



share|improve this answer










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




















  • 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




















draft saved

draft discarded




















































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.




draft saved


draft discarded














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





















































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







Popular posts from this blog

數位音樂下載

格利澤436b

When can things happen in Etherscan, such as the picture below?