Install Jenkins in WSL

1. Install WSL

References:
Install WSL

Possible issue:
WSL 指定的网络名不再可用

2. Install Java in WSL

sudo apt install openjdk-8-jre-headless

3. Install Jenkins

Reference: WAR files

  • Download Jenkins
// Download Jenkins
Download https://get.jenkins.io/war-stable/2.332.2/jenkins.war
  • Install Jenkins
java -jar /mnt/c/Users/xxx/Downloads/jenkins.war
  • Configure Jenkins
    Browse to http://localhost:8080 and wait until the Unlock Jenkins page appears.

Test Jenkins:

  1. Create a new Pipeline job:
echo "Hello Jenkins"
  1. Run the job

  2. Check for console output, expected output to look like this:

Started by user MadHatter
[Pipeline] Start of Pipeline
[Pipeline] echo
Hello Jenkins
[Pipeline] End of Pipeline
Finished: SUCCESS

你可能感兴趣的:(Install Jenkins in WSL)