Jenkins official

www.jenkins.io/zh/doc/book…

Execute the following command, where I map the Jenkins container’s access port to the server’s port 8686 so that Jenkins can be accessed through 8686.

docker run -u root --rm  -d  -p 8686:8080  -p 50000:50000  -v jenkins-data:/var/jenkins_home  -v /var/run/docker.sock:/var/run/docker.sock jenkinsci/blueocean
Copy the code

Jenkins Base Configuration

With the above configuration, you can access your Jenkins by typing http://ip:8686/ in your browser

Note: Some partners may not be able to open it. At this time, you need to check whether the server has opened port 8686. If not, you need to configure the security group (Ali Cloud/Tencent Cloud).

If the configuration is ok: The following screen will appear, first showing you the location of the login password:

According to clew we perform the cat/var/lib/Jenkins/secrets/initialAdminPassword get password,

Note: we are using the docker image, the password is in the image, we need to enter the container to execute the above cat command:

Enter and click Continue, as follows:

Select Install Suggested plugins and wait until the installation is complete. If the installation fails, you can skip them and manually install them as required.

Set an initial account and password and make it as complicated as possible

After setting, enter:

\

Making generated token

To generate the token

Settings -> Developer Settings -> Personal Access Tokens Click Generate New Tokens

Making configuration Jenkins

Add webhook

Repository –> Setting –>Webhooks –> Add Webhooks –> Enter the IP address of the server where Jenkins was just deployed

Add /github-webhook/ to the IP address

\

\

Github configuration (Chinese Version Jenkins)

The installationGitHub plugin(Search for this name directly)

System management -> Plug-in management -> Optional plug-in

When you install the Github Plugin, you can install the plain-credentials, Git credentials, and Github API automatically. When you install the Github Plugin, you can install the plain-credentials, Git credentials, and Github API automatically

Configuration is making the Plugin

System management -> System Settings -> GitHub -> GitHub server

The token generated on Github was added

Click the Jenkins button, the screen pops up, enter the information, and click Add.

Select the added credentials to test the link