Jenkins CI/CD: Passo a Passo COMPLETO para Iniciantes!

Share

Summary

A practical guide to getting started with Jenkins, covering installation, setup, and creating a basic CI/CD pipeline for deploying an application to Kubernetes.

Highlights

Introduction to Jenkins
00:00:00

Jenkins is an automation tool used to create and automate processes, including CI/CD pipelines. It is written in Java, open-source, and has been used for over 10 years. Jenkins is flexible due to its plugin-based architecture and can be used in cloud or on-premises environments.

Jenkins Architecture
00:06:59

Jenkins consists of a Jenkins server (the core) and Jenkins agents/nodes, which execute the automations. The server holds configurations, while agents handle execution. Agents can be VMs, Docker containers, or Kubernetes clusters.

Setting Up the Environment
00:09:21

The tutorial uses a virtual machine and a Kubernetes cluster in Azure, created using Terraform. The video provides the steps on how to install Java as a requirement and then Jenkins in an Ubuntu server.

Installing Jenkins
00:12:44

Guide to install jenkins on a linux distribution using the steps available in the official documentation, including the usage of commands to add the key and repository, update packages and install Jenkins.

Jenkins Initial Setup
00:17:49

Accessing jenkins from the browser on the 8080 port, and retrieving the admin password to complete the installation using the tool's guided steps and sugested plugins.

Installing Plugins
00:22:31

Relevant plugins like Docker and Kubernetes plugins for use in the pipeline are installed from the 'Manage Jenkins' section.

Installing Docker and Kubectl
00:27:43

Docker and Kubectl are installed on the VM. The current user also needs to be granted access to the docker group in order to run commands, and finally restart the Jenkins server.

Creating a Pipeline
00:35:34

A new pipeline is created in Jenkins, named 'guia-jenkins'. The pipeline script is set to be managed from a Git repository. The github repository URL is defined along with the 'main' branch option.

Jenkinsfile Structure
00:38:33

The tutorial describes the structure of a Jenkinsfile, using the pipeline > agent > stages > stage > steps structure and the usage of 'echo' commands for testing purposes.

Building the first image with Docker in Jenkinsfile
00:46:42

Instead of using shell commands, the tutorial adds the usage of the docker plugin to build an image and tag it, using the build ID to make it dynamic.

Pushing the image with Docker in Jenkinsfile
00:52:41

Docker registry and credentials are created in Jenkins for Docker Hub using username and password. The dockerhub credential ID is used to push the image.

Preparing the deployment with Kubectl
00:59:58

Kubernetes credentials are created in Jenkins using the kube config. The Cubectl image tag is versioned based on the environment build ID.

Automating the trigger with Github Webhooks
01:14:36

Github webhooks are setup to automatically trigger the execution of a pipeline when a commit is performed. The Github Webhook option is configured in Jenkins and linked to the correct URL.

Recently Summarized Articles

Loading...