1. Download the latest Jenkins image

    docker image pull jenkins/jenkins:lts
Copy the code

2. Start a Jenkins container

docker container run -d --name my-jenkins -p 8090:8080 -v /c/Users/jenkins:/home/jenkins_01 jenkins/jenkins:lts
Copy the code

3. Start the service

Get the address of the vm named default:

Docker-machine ls docker-machine IP default // 192.168.99.100Copy the code

Open http://192.168.99.100:8090 in your browser

4. Enter the container

docker exec -it 'container id' /bin/bash
Copy the code

Perform:

cat /var/jenkins_home/secrets/initialAdminPassword
Copy the code

Get the password and paste it in

Install the recommended plug-ins

Download and install plug-ins

Choose System > Plug-in Management > Optional Plug-ins to install some front-end plug-ins. If the plug-ins recommended in previous steps fail to be downloaded, a red warning will be displayed. Download and install the plug-ins here as well.

In addition to the recommended plug-ins, the following plug-ins need to be installed on the front end:

  1. Localization: Chinese (Simplified) (Jenkins Localization)
  2. NodeJS Plugin
  3. Git parameter (select your own version branch before building)
  4. Publish Over FTP

After the NodeJS Plugin is installed, you need to choose System Administration -> Global Tool Configuration to configure node download and install:

Publish Over FTP After the installation is complete, choose System Management > Global Tool Configuration and configure Publish Over FTP

Configure tasks, compile vuE-CLI project

Here we pulled vue-CLI project from Github and compiled it in Jenkins. Create a new task to build a free-style software project.

I use git management code, if you want to choose your own version branch before build, follow the steps below, otherwise skip. You need to install the Git parameter plug-in.


Click Save to complete the configuration.

build

Click Build with Parameters to start building

The workspace
Package and download all files