Jenkins is a CI/CD tool, but can actually be used to automate anything, like automatically triggering bash and python scripts.

Infrastructure

Jenkins infrastructure is composed by:

  • A Master Server, which controls pipelines and schedule builds, for example when a Github repository change happens, it triggers a certain pipeline, and distributes the build to the appropriate agent.
  • A set of Agents, which run their builds, which is usually composed of linux commands to build the project. There are two types of agents:
    1. Pernament Agents: they are just dedicated servers that run a single job;
    2. Cloud Agents (much popular choice), which are agents that spun up on demand. Cloud agents can be used with Docker, Kubernetes or with EC2 in order to dynamically spin up instances when needed.

There are two types of build types:

  • Freestyle Build: they can be seen as a shell script that runs on the server, and they are the simplest method to create a build.
  • Pipelines: they use the Groovy syntax, and they are broken down into multiple stages. Each step is a part of the pipeline, like cloning the repo, building it, executing tests etc.

tags: devops resources: