Creating a pipeline (CD) for deploying ReactJS based on a Github repository - Docker usage example

preview_player
Показать описание
Welcome to @queiroz-rafael!
In this video we are going to show to use jenkins integrated with a git project, that though a pipeline defined in Jenkinsfile we are going to automatically deploy a project that has its code in a git project.

You can download the presented dockerfile and project code from here:

Please feel free to ask and suggest another content to be presented.
Do you want to support? Just subscribe this channel.

Reference:
============Step 1. Code for Dockerfile================
FROM jenkins/jenkins:2.361.4-jdk11
USER root
RUN apt-get update && apt-get install -y lsb-release
RUN echo "deb [arch=$(dpkg --print-architecture) \
RUN apt-get update && apt-get install -y docker-ce-cli && apt-get install -y nodejs && apt-get install -y npm
USER jenkins
RUN jenkins-plugin-cli --plugins "blueocean:1.25.8 docker-workflow:521.v1a_a_dd2073b_2e"
========================

============Step 2. Code for image build================
docker build -t myjenkins-blueocean:2.361.4-1 .
========================

============Step 3. Code for container execution================
docker run --name jenkins-blueocean --detach ^
--network jenkins --env DOCKER_HOST=tcp://docker:2376 ^
--env DOCKER_CERT_PATH=/certs/client --env DOCKER_TLS_VERIFY=1 ^
--volume jenkins-data:/var/jenkins_home ^
--volume jenkins-docker-certs:/certs/client:ro ^
--volume "%HOMEDRIVE%%HOMEPATH%":/home ^
--restart=on-failure ^
--publish 8080:8080 --publish 50000:50000 --publish 3000:3000 myjenkins-blueocean:2.361.4-1
========================

============Step 4. Code for getting admin key (first access only) ================
docker container ls (copy container id)
docker logs container ID (copy password)
========================

============Step 5. Jenkinsfile and git project ================
========================

0:00 Introduction
1:19 Dockerfile for Jenkins: creating Jenkins image
3:25 Docker run: Creating Jenkins container
6:32 Acessing Jenkins and creating a Pipeline item
8:55 Jenkinsfile: understanding pipeline stages and steps
13:04 Pipeline run: build, test and deploy the project
18:04 What are the CI/CD tools possibilities?
Рекомендации по теме