To start:
sudo service jenkins start
To stop:
sudo service jenkins stop
To restart:
sudo service jenkins restart
To check status:
sudo systemctl status jenkins
To access: localhost:8080
use Pipe line to build git branch
- create a multiple scan pipe line item in Jenkins (branch sources in local format: file:///home/leo2019/play_jenkins)
- global tool config to add git excutable
- create a Jenkinsfile in the git repository
Find plugins installed
- go to http://localhost:8080/script
- past the groovy script below
- run the script
Jenkins.instance.pluginManager.plugins.each{
plugin ->
println ("${plugin.getDisplayName()} (${plugin.getShortName()}): ${plugin.getVersion()}")
}
Install Jenkins on Docker
- stop jenkin if other jenkin is running
- Go to home directory
mkdir jenkins_home
//let folder own by jenkin. If log into container //and issue id command, got: //uid=1000(jenkins) gid=1000(jenkins) groups=1000(jenkins) cd jenkins_home sudo chown -R 1000:1000 .
docker run -d -p 49001:8080 -v ~/jenkins_home:/var/jenkins_home --name jenkins jenkins/jenkins
- http://localhost:49001
- user name: admin password in: /var/lib/jenkins/secrets/initialAdminPassword
To Start container
docker container start jenkins
To Stop container
docker container stop jenkins
No comments:
Post a Comment