Wednesday, October 24, 2018

End to End Flow of the GoCD Pipeline

End to End Flow of the GoCD Pipeline



                                         End to End flow of the GoCD Pipeline
                                =======================================


-> To perform GoCD Pipeline we need to setup GoCD Server with atleast one Agent(Here We will take 3 agents for each environment)
-> Lets assume Continous deploment goes through 3 environments Development,QA,& Production.
-> Then Create Users for Dev,QA,& Prod to access GoCD to perform Continouse Delivery successfully.
-> And create a Pipelne Group Consists of pipelnes for Dev-env,QA-env, & Prod-env.
-> We can also create and run more pipelnes as per requirement.

-> The flow initially starts from Dev-env, they'll write code and keep it as a Material.
Here Material is  like input to a pipeline & is a source control repository like Git,&  tells what it is configured to do.
-> And also here output of one pipeline can be work as material to next pipeline.
-> And any new commit to the repository is a cause for the pipeline to trigger.
-> A pipeline needs to have at least one material.

Create a Pipeline For Dev-env :
-------------------------------
-> Click On Add pipeline->Name it->Give group name as Dev-env (here we are using 3 pipelines "inventory-pipeline", "catalog-pipeline", "wesite-pipeline" in the same group).
-> Configure Material
-> To perform Build, Unit test,& Deploy Create Stages , Jobs for the Dev-env group Pipelines & Configure it with appropriate scripting tool like Maven/Ant/msbuild.
-> Each build pipeline will compile, test and create a RPM artifact.
-> Whenever Dev-env pipelines finishes build successfully, it will be trigger as material for the User acceptance test in QA-env pipelines
-> Now here the output of the Pipelines in the Dev-env will be stored in Nexus Repository as rpm packages.

Create Pipeline for the QA-env :
--------------------------------
-> Create Pipeline "acceptance-pipeline" for the QA-env for the user acceptance test.
-> Here Materials will be from git Repo & Nexus Repo.
-> Here pipelines produces output as in the form Chain of lables & version count of each pipeline in Dev-env seperated by "_"  ,
   means it will just check the pipelines perfomed in Dev-env & maintains them as different labels with version count,
   like ${inventory-pipeline}_${catalog-pipeline}_${wesite-pipeline}_${Count}.
-> The QA deployment pipeline has a sign-off stage which is manually triggered once the QAs get successful build.
-> After successful build it will goes for UAT

-> Then for deploying these builds to production we can use Chef.
-> Only builds that have successfully passed the Acceptance test pipeline are available for deployment.
-> For this Chef workstation prepare cookbooks , will add them to chef server

-> The deployment pipelines do the below in sequence,
   * Deploy the RPMs by triggering a chef client run on the target nodes
   * Upload the test data required to setup the environment.
   * Check the correct versions have been deployed by querying the "/version" http endpoints.
   * Do few sanity tests to check the application deployment went through fine and that the application is up and running.


Create Pipeline and run for Prod-env :
-----------------------------
-> In the Prod-env pipeline builds will trigger in manual ,
   beacuse stages in production will not run automatically,
   we need to run them manually one ofter other.

No comments:

Post a Comment