CI/CD Engine
- The idea of CI is to give feedback to developer about his recent change
- Steps: Whenever developer submits the code to git (push/pull request)
- Build the code
- Package the code
- Execute the automated tests (unit tests/integration tests)
- Run the static code analysis
- At any step if there is a failure, developer is supposed to rework i.e. his work is rejected.
- To perform this we need a software which can call the steps mentioned above. This software is called as CI/CD Engines
- Now lets look at a popular CI/CD Engine
- Jenkins
- Installing jenkins Refer Here
How Jenkins works
- Jenkins Single Node
- In Jenkins Single Node on the linux machine a user called as jenkins will be created.
- Anything which we run from jenkins ui will be translated to low level linux commands executed as jenkins user.
Terms in Jenkins
- Job/Project: This is set of steps configured as one unit (Job/Project)
- Workspace
- Jenkins Home: This is home directory for the user
jenkins
which got created as part of jenkins installation.- Default on linux
/var/lib/jenkins
- Jenkins stores everything in jenkins home directory
- Default on linux
Lets create a Project in Jenkins
- Create a jenkins free style project (UI/Classic) which shows the current user and environment variables
- For screenshots refer classroom video
Jenkins – Free Style Project
- This project is created with Jenkins UI
- The Sections are
- General: Give metadata and basic settings
- Source Code Management: Where the SCM (git details)
- Build Triggers: When to build
- Build Environment: Additonal environmental steps
- Build Steps: Actual build steps
- Post Build Actions: After success or failure what has to be done