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:
- Create a new Pipeline job:
echo "Hello Jenkins"
Run the job
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