View gist:07b695a6426109b512a3b6d2e391f890
def scmVars = checkout scm | |
echo 'scm : the commit id is ' +scmVars.GIT_COMMIT | |
echo 'scm : the commit branch is ' +scmVars.GIT_BRANCH | |
echo 'scm : the previous commit id is ' +scmVars.GIT_PREVIOUS_COMMIT | |
def commitHasha = scmVars.GIT_COMMIT | |
def commitBranch = scmVars.GIT_BRANCH | |
def branch = checkout(scm).GIT_BRANCH | |
git config --list --> to get the name and email n other details of the commiter |
View gist:17af8b98e4593dbb0f96fb8cfcfb865e
deleteDir() /// to delete the Directory | |
cleanWs() ///cleaning the workspace |
View gist:91defc5acc30749b880ee11f185f4f9f
pipeline { | |
agent any | |
stages { | |
stage('Stage 1') { | |
steps { | |
cleanWs() | |
sh 'pwd' | |
sh 'date' | |
} | |
post { |
View gist:5967cd0d69822810b4ac30e566d42ab7
#!/usr/bin/env groovy | |
/* | |
* This for comment section only ! | |
* | |
*/ | |
import hudson.model.* | |
import hudson.EnvVars | |
import groovy.json.JsonSlurperClassic | |
import groovy.json.JsonBuilder | |
import groovy.json.JsonOutput |
View gist:5d7f83f5cdecf831eb000affc41e21f1
def dir = pwd() | |
sh "mkdir -p ${dir}/db" | |
sh "chmod 0777 ${dir}/db" |
View gist:29d043e427fd52094fe627c265d65b64
//gives the report commited locally | |
git log --author=YOURNAME --since="Last Friday" --oneline --no-merges --> | |
//Gives list of Contributers to the Git | |
git log --format='%aN' | sort -u | |
//To get the no.of commits made by each contributer of Git | |
git shortlog -sn | |
// To get the report from the Date |
View gist:2e5e75f3035ad4f732992c8087ba9cc8
//gives the report commited locally | |
git log --author=YOURNAME --since="Last Friday" --oneline --no-merges --> | |
//Gives list of Contributers to the Git | |
git log --format='%aN' | sort -u | |
//To get the no.of commits made by each contributer of Git | |
git shortlog -sn | |
// To get the report from the Date |
View gist:0d3db4ec08aeae167434462386496f84
//gives the report commited locally | |
git log --author=YOURNAME --since="Last Friday" --oneline --no-merges --> | |
//Gives list of Contributers to the Git | |
git log --format='%aN' | sort -u | |
//To get the no.of commits made by each contributer of Git | |
git shortlog -sn | |
// To get the report from the Date |
View gist:5ba82a26797ae63164971e9e117e04aa
[](https://jenkins-server:8080/job/Job-Name/lastBuild/) |
View Jenkinsfile
// A Declarative Pipeline is defined within a 'pipeline' block. | |
pipeline { | |
// agent defines where the pipeline will run. | |
agent { | |
// This also could have been 'agent any' - that has the same meaning. | |
label "" | |
// Other possible built-in agent types are 'agent none', for not running the | |
// top-level on any agent (which results in you needing to specify agents on | |
// each stage and do explicit checkouts of scm in those stages), 'docker', |
OlderNewer