Cicd documentation layout


Create CICD Jenkins multi-branch Pipeline Started with Shared Library using BlueOcean



Download 6.25 Mb.
Page37/39
Date15.06.2023
Size6.25 Mb.
#61535
1   ...   31   32   33   34   35   36   37   38   39
CIcd

12.7. Create CICD Jenkins multi-branch Pipeline Started with Shared Library using BlueOcean


Jenkinsfile with jenkins shared library:

  • The below Jenkinsfile executes the script in helmCloudPipeline.groovy file which presents in vars folder.


Using Blue Ocean, the new UI for jenkins, you can easily create a new project and connect it to the Github repository, following these steps:

  • Click on Blueocean

  • Create a new pipeline and select GitHub as your code store.

  • Enter a Personal Access Token from GitHub (which can be generated for the first time using GitHub New Personal Access Token page), so that Jenkins can access your private repositories.

  • Choose your Github repository that contains the code.

  • Give your pipeline a name and save the changes.



  • Jenkins automatically will detect the branches and the Jenkinsfile if present. It will also trigger the job.



  • To trigger any branch manually, click on Build With parameters option.

  • After it finishes, you should see a view similar to this, in which you can see the details of each stage (time it took, success or failure, logs) along with the Console Output of the build.




12.8. Summary


Now successfully created a CI/CD multi-branch pipeline for a containerized spring-boot java application on Kubernetes using Jenkins.

13. Maintenance of Docker with Jenkins using pipeline

13.1. Why Maintenance of Docker?


Docker is a great tool to create isolated micro services and environments. However, over time the number of images and containers size of log files used by the images and containers increases which can take up considerable disk space. Besides, dangling images and old images/containers which we do not use anymore are not automatically removed. Fortunately, docker has some options which can help us reclaim disk space.
For example, Check the system disk space using command df -h and check the output

Now check the docker system disk space

Now we can see that we have about 5.373GB still held up in images and the larger amount of 52GB in local volumes. To clean up all these use docker image prune -a --force command in Jenkinsfile to run as a pipeline job in Jenkins.

Download 6.25 Mb.

Share with your friends:
1   ...   31   32   33   34   35   36   37   38   39




The database is protected by copyright ©ininet.org 2024
send message

    Main page