origin: Allow suppressing of build trigger in new-app
When creating new deployment using oc new-app it should be possible not to trigger the build automatically.
Version
oc v1.5.1+7b451fc kubernetes v1.5.2+43a9be4 features: Basic-Auth
openshift v1.5.1+7b451fc kubernetes v1.5.2+43a9be4
Steps To Reproduce
- oc new-app --strategy=docker app/
Current Result
Build is automatically triggered as part of the oc command.
Expected Result
There should be a switch to postpone the first build to be trigger by manual intervention.
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Comments: 18 (10 by maintainers)
@bparees agree, this request came from real world problem … @mhausenblas and me were using OpenShift to build project --from-dir … however, as
new-appdoes a lot of magic and there was.gitin the directory,new-appwas setting the source to the Github repo, which did not have the latest source code, as we were doing local testing. As the first build is always triggered, it gets the source from Github and fails. We agreed that asking to change the behaviour ofnew-appis probably impossible, we came to a workaround that being able to disable the first automatic build solves our problem and as we discussed it in the office, it was clear that such a feature would make sense for other use-cases as well.So, back to your comment, keeping DC’s normal behaviour is what we would like to have, we just want to be able to skip the first initial build.
I can see a bit of ambiguity here around use of
--suppress-triggers.The intent as I understand it is that want to create the build configuration and deployment configuration, but simply don’t run the initial build. The initial build would have to be started using
oc start-build, or perhaps as web hook trigger from a git push against a repo. After that, everything would then run as normal, as image and config change triggers would still be in place.The use of
--suppress-triggerscould though be interpreted as meaning don’t even add triggers to the build and deployment configuration, thus requiringoc set triggerslater on to add them back.I would suggest a better name is needed for the option which makes it clear you are deferring the running of the initial build only. It should also be an option name which can also be added to
oc new-buildfor the non binary build case as well, as it would be useful to have to there as well.So I would suggest
--defer-buildor--defer-initial-build, and whatever the option, it be added to bothoc new-appandoc new-build, with it only having meaning in the latter for a non binary build.@csrwng as much as i’m personally biased towards my --inert suggestion, --suppress-triggers is probably more obvious as to what it does, let’s go w/ that. We can always send the PR through cli-review.
👍 @mhausenblas PRs are always welcome 😃
This is in our Trello backlog https://trello.com/c/3BxvvENz/1200-3-allow-new-app-to-create-things-in-an-inert-state-appcreate