This series is for super beginners who want to practice CI / CD. We hope that you will get a sense of "What is CI / CD?" When introducing the enterprise level and production level. The tools to be used are selected here, so if you want to use another tool, please check accordingly. The general content is as follows.
- Environment construction
-Run Jenkins container --Jenkins initial settings --Automatically notify build results using gmail --Automatic installation of JDK / Ant / Maven
CI / CD tools include:
- Jenkins
- Tekton
This time we will introduce `` `Jenkins```
Execute the Jenkins container and perform the initial settings by referring to [Official] of Jenkins (https://www.jenkins.io/doc/book/installing/docker/#customizing-jenkins-with-plugins).
First, set network and volume
$ docker network create jenkins
$ docker volume create jenkins-docker-certs //Share the Docker client TLS certificate needed to connect to the Docker daemon
$ docker volume create jenkins-data //Used for data persistence
$ docker network ls //There are three networks, a newly created bridge network and default
$ docker volume ls
Then run `` `jenkinsci / blueocean``` as a jenkins container
$ docker container run --name jenkins-blueocean --rm --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 \
--publish 8080:8080 --publish 50000:50000 jenkinsci/blueocean
This will run jenkins
To enter the jenkins dashboard, type `http: // localhost: 8080 /`
on your browser
Enter the value when the container is executed as password
Alternatively, execute the following command to confirm the initial password
$ docker exec jenkins-blueocean cat /var/jenkins_home/secrets/initialAdminPassword
Next, install the plugin and create a user.
Select one of the following in Customizing Jenkins with plugins
Install suggested plugins` `` (basically here)
Select plugins to install```
When creating a user, create a new user with admin privileges as shown below.
This completes the settings for the first login.
In the initial setting, the following two points are set.
-Email notification of build result --Installation of tools essential for CI realization
First, set "Email notification of build result"
dashboard> Left pane ``` Manage Jenkins ``> Center pane
`` System Settings
>
Enter Jenkins URL` `,` `System Admin e-mail address
in Jenkins Location
system admin e-mail address
Is the sender of the notification email
Set as follows in E-mail Notification
After entering the test mail address, click `Test configuration`
If Email was successfully sent
is displayed after clicking, the email has arrived.
If Failed to send out e-mail
javax.mail.AuthenticationFailedException: 535-5.7.8 Username and Password not accepted. Learn more at 535 5.7.8 https://support.google.com/mail/?p=BadCredentials q14sm9594426pjp.43 - gsmtp
~~
Is displayed, "Access to insecure apps" of Google account is `` `disabled``` (default is disabled) To enable it, please refer to here
Next, set "Installation of tools essential for CI realization"
dashboard> Left pane Jenkins management` ``> Center pane
Global Tools Configuration
>
Enter as follows and save
Since an Oracle account is required to install the JDK, enter the user name and password from the link (an error is displayed near "I agree to the Java SE ~~" before entering) If you don't have an account, you can create one from there
Recommended Posts