This is interesting, it's something I've been struggling with while
converting our current system over to the new world (I really like the
stage view!).
We currently have a "pipeline" of freestyle jobs, that pass artifacts down
the line. Build (and test) -> Deploy to stage -> Deploy to prod. The last
build uses pinned artifacts ("keep forever"), which allows us to rollback
by unpinning the latest build. This is something I'd like to keep.
The one thing I don't understand is where I would define the deploy jobs?
Isn't the whole point that everything is now in the Jenkinsfile, and under
version control? Also, I don't seem to be able to point my existing
freestyle job at the new pipeline build job, to retrieve artifacts. So what
am I missing?
Thanks,
Graham
On Wednesday, October 26, 2016 at 4:26:17 PM UTC+1, Michael Lasevich wrote:
>
> I am not sure the stages you are talking about are same as what Jenkins
> Pipelines calls stages.
>
> Jenkins, at its core, is a job server. In Pipelines, a stage is a segment
> of a job. Stages of a build job would be something like "Build Binaries" or
> "Upload Build Artifacts" - something that is part of one logical job. What
> you are talking is a deployment process which is really a separate job from
> a build job, and not really a "stage" of build.
>
> So, my approach would be (and is, in some cases):
>
> * Set up a Pipeline build for the develop branch
> * Make sure the build job archives either deployment artifact(s) or
> pointer to them - something that can be used for deployment.
> * Set up a separate deployment job (can also be Pipeline) that takes in
> parameters for a build run and target environment (stage, QA, UA, PreProd,
> Production, whatever), and grabs artifacts/pointers from the selected run
> and performs a deployment
>
> Now, if you want to get fancy, you make that first "build" job a
> MultiBranch job that builds both develop and some versions of the feature
> branches (I've used /feature/build/* pattern) and then modify the selection
> of the job run to select from multiple branches (need to write a Groovy
> based Parameter selector for that) - and now you can deploy builds from
> feature branches for testing BEFORE they are merged into develop
>
> HTH,
>
> -M
>
>
>
>
>
>
>
> On Wednesday, October 26, 2016 at 4:21:23 AM UTC-7, Sathyakumar
> Seshachalam wrote:
>>
>> New to Jenkins pipeline.
>>
>> My process is that developers work off of develop branch (Feature
>> branches and merges of-course).
>> At any point in time, a release branch is branched off of develop and
>> then deployed to a stage environment, Once Accepted/approved, the same
>> release branch is deployed into prod. (All immutable deployments).
>>
>> So am looking at atleast two stages that are only conditionally and
>> manually entered - stages being deploy to stg, deploy to prod and
>> condition being the branch prefix. (Each stage will have build steps like
>> deploy binaries, launch, run functional tests etc.,) and an automatic stage
>> that is triggered only once per day (nightly) with build steps like deploy
>> binaries, lunch, run and tear down).
>>
>> Is this kind of a workflow feasible with pipelines. If yes, Are there any
>> recommendations/suggestions/pointers.
>>
>> Thanks,
>> Sathya
>>
>
--
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 [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/jenkinsci-users/5fd36db7-d0bc-4c9f-ad33-75d0b325dfd2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.