Jenkins
Jenkins is an open source automation tool written in Java with plugins built for Continuous Integration purpose.
With Jenkins, organizations can accelerate the software development process through automation. Jenkins integrates development life-cycle processes of all kinds, including build, document, test, package, stage, deploy, static analysis and much more.
setup
refer
pipeline
pipeline {
agent any
stages {
stage('Stage 1') {
steps {
echo 'Hello world!'
}
}
}
}
Syntax:
agent
stages: This section allows to generate different stages on your pipeline that will be visualized as different segments when the job is run.
stage: Jenkins graphically splits pipeline execution based on the defined stages and displays their duration and whether it was successful or not.
steps: At least one step must be defined in the “steps” section.
environment (Defined at stage or pipeline level)
input (Defined at stage level)
options (Defined at stage or pipeline level) , like retry, timeout
parallel
parameters
post
script
tools
triggers
when
Component
- Master
Scheduling build jobs. Dispatching builds to the slaves for the actual execution. Monitor the slaves (possibly taking them online and offline as required). Recording and presenting the build results. A Master instance of Jenkins can also execute build jobs directly.
- Slave(a java executable that runs on a remote machinei, TCP/IP)
It hears requests from the Jenkins Master instance. Slaves can run on a variety of operating systems. The job of a Slave is to do as they are told to, which involves executing build jobs dispatched by the Master. You can configure a project to always run on a particular Slave machine, or a particular type of Slave machine, or simply let Jenkins pick the next available Slave.
Api
api
CI(Build integration)
With the help of the Git plugin Jenkins can easily pull source code from any Git repository that the Jenkins build node can access.
The GitHub plugin extends upon that integration further by providing improved bi-directional integration with GitHub. Allowing you to set up a Service Hook which will hit your Jenkins instance every time a change is pushed to GitHub.
example
k8s-plugin
make groovy code clean if there are multiple containers running, by using pod template.
different image can also inherit each other
example
Security
refer