Pull Request Based Workflow
- Create a Github token
- Configure GitHub Pull request builder plugin Refer Here
- Add a webhook from Github to Jenkins
http://<jenkinsip>:<port>/ghprbhook/, ensure content type is application/json
- Refer Here for ui based navigations
Git Flow Branching Strategy
- Refer Here for the article
-
Try what is GitLab Flow & GitHub Flow
-
Jenkinsfile Skeletons for
- develop
pipeline {
agent { label 'build' }
stages {
stage('vcs') {
steps {
git branch: 'develop',
url: ''
}
}
stage('build and package') {
steps {
sh 'mvn clean package'
}
}
stage('scans') {
steps {
sh 'Software Component Analysis'
sh 'Static Code Analysis'
sh 'quality gate'
}
}
}
post {
failed {
# send mail to author in to and rest in CC
}
}
}
pipeline {
agent { label 'build' }
stages {
stage('vcs') {
steps {
git branch: 'develop',
url: ''
}
}
stage('build and package') {
steps {
sh 'mvn clean package'
}
}
stage('scans') {
steps {
sh 'Software Component Analysis'
sh 'Static Code Analysis'
sh 'quality gate'
}
}
stage('artifactory') {
steps {
sh 'push to jfrog'
}
}
stage('deploy to System Test Env') {
agent { label 'terraform' }
steps {
sh 'terraform apply'
sh 'ansible-playbook' # virtual machines
or
sh 'kubectl apply -f <>' # container
}
}
stage ('test System Test Env') {
agent { label 'selenium test' }
steps {
sh 'selenium tests and publish results'
}
}
stage('deploy to Performance Test Env') {
agent { label 'terraform' }
steps {
sh 'terraform apply'
sh 'ansible-playbook' # virtual machines
or
sh 'kubectl apply -f <>' # container
}
}
stage ('test Performance Test Env') {
agent { label 'performance test' }
steps {
sh 'jmeter tests and publish results'
}
}
stage('deploy to Security Test Env') {
agent { label 'terraform' }
steps {
sh 'terraform apply'
sh 'ansible-playbook' # virtual machines
or
sh 'kubectl apply -f <>' # container
}
}
stage ('test Security Test Env') {
agent { label 'security test' }
steps {
sh 'burpsuite tests and publish results'
}
}
}
post {
failed {
# send mail to author in to and rest in CC
}
}
}
Like this:
Like Loading...