I've been searching all day today and have yet to find something that looks 
like it applies. I'm sorry if this answer has been hashed before and I just 
asked the all mighty Google the wrong questions.

Here is the workflow I'm trying to bring over from my freestyle projects as 
Pipelines (the new Pipeline project is set up as a Multi-branch project 
with a Jenkinsfile).

1. A dev branches off of master and starts work on a feature. Whenever he 
pushes new code to GitHub I want Jenkins to set up the workspace, build the 
code, run tests, and then stop.
2. Once he get's his code to build clean he creates a PR.
3. Jenkins sees the PR and builds that, but once again, should stop after 
tests pass.
4. The success status, after tests, is pushed back to GitHub which then 
enables the PR to be merged with the master branch.
5. Now that the master branch has been updated, Jenkins once again sets up 
the workspace, builds the code, runs test, but now deploys to staging, 
waits for approval, then pushes to prod.

Another way to ask the question, how do I put logic into a Pipeline to only 
run certain stages depending on what branch/PR is being built?

As of right now, I have a single Jenkins file with the checkout, build, 
test, and deploy stages in it, and every time a branch is updated, a PR 
created, and with a merge to master, the code is able to be deployed. I 
don't want the code to be able to be deployed until after it's merged to 
master. Any thoughts on how to make this happen? Thanks.

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/2615c315-9686-4f70-975c-364f065000f2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to