Demo project that use with jenkins and kubernetes.
More information. Try github pull request builder.
Depends on plugins:
Please check them at Manage --> Plugin Manager.
After Kubernetes plugin installed, go to Manage Jenkins -> Configure System -> Cloud section.
- Add a
Kubernetescloud and an unique name likemy-k8s-cluster. - Leave
Kubernetes URL/Kubernetes server certificate key/Kubernetes Namespaceif jenkins in cluster. - Set
Jenkins URLtohttp://<jenkins-service>:<jenkins-port>if jenkins in cluster. - Set
Container Capto a smaller number if k8s cluster is tiny, ep.2.
Go to Manage Jenkins -> Configure System -> GitHub Pull Request Builder section.
Read more for what you need.
Add Jenkinsfile to root of project, and config like following.
podTemplate(label: 'mypod', containers: [
containerTemplate(name: 'alpine', image: 'alpine:3.6', ttyEnabled: true, command: 'cat')
]) {
node('mypod') {
stage('Test a demo job') {
git url: 'https://github.com/tAoD/first-blood.git'
container('alpine') {
stage('Build a Java project') {
sh """
echo LICENSE
"""
}
}
}
}
}
Go home, byebye.
- Create a new project if required.
- Setup CVS with
Git - Checked
GitHub Pull Request BuilderinBuild Phasesection - Checked
Use github hooks for build triggering - Complete
Trigger phraseif interested, ep.(/run\w+|/)?tests? - Checked
GitHub Pull Request MergerOnly Admin can merge codeFail the build if the Pull Request can't be merged?Delete the branch after successful merge?Allow merge without trigger phrase?ifBuild every pull request automatically without asking (Dangerous!).checked inGitHub Pull Request Builder