Skip to content

Instantly share code, notes, and snippets.

💭
CICD in ABAP

mdali_1 forpix

💭
CICD in ABAP
View GitHub Profile
@forpix
forpix / gist:07b695a6426109b512a3b6d2e391f890
Created Sep 6, 2018
How to get the commit Id and other meta data of GitHub
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
@forpix
forpix / gist:17af8b98e4593dbb0f96fb8cfcfb865e
Last active Sep 6, 2018
How to clean and delete the directories and workspace
View gist:17af8b98e4593dbb0f96fb8cfcfb865e
deleteDir() /// to delete the Directory
cleanWs() ///cleaning the workspace
@forpix
forpix / gist:91defc5acc30749b880ee11f185f4f9f
Created Sep 6, 2018
Post action for each stage in Jenkinsfile
View gist:91defc5acc30749b880ee11f185f4f9f
pipeline {
agent any
stages {
stage('Stage 1') {
steps {
cleanWs()
sh 'pwd'
sh 'date'
}
post {
@forpix
forpix / gist:5967cd0d69822810b4ac30e566d42ab7
Last active Sep 7, 2018
Try n Catch in Scripted Pipeline
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
@forpix
forpix / gist:5d7f83f5cdecf831eb000affc41e21f1
Created Sep 11, 2018
How to create a folder in WS of Jenkins
View gist:5d7f83f5cdecf831eb000affc41e21f1
def dir = pwd()
sh "mkdir -p ${dir}/db"
sh "chmod 0777 ${dir}/db"
@forpix
forpix / gist:29d043e427fd52094fe627c265d65b64
Created Sep 12, 2018
To get the Developers report in Git
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
@forpix
forpix / gist:2e5e75f3035ad4f732992c8087ba9cc8
Created Sep 12, 2018
To get the Developers report in Git
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
@forpix
forpix / gist:0d3db4ec08aeae167434462386496f84
Created Sep 12, 2018
To get the Developers report in Git
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
@forpix
forpix / gist:5ba82a26797ae63164971e9e117e04aa
Last active Sep 14, 2018
To get the last Build result in Gihub
View gist:5ba82a26797ae63164971e9e117e04aa
[![Build Status](https://jenkins-server:808/job/Job-Name/lastBuild/buildStatus)](https://jenkins-server:8080/job/Job-Name/lastBuild/)
@forpix
forpix / Jenkinsfile
Created Sep 19, 2018 — forked from abayer/Jenkinsfile
An example Declarative Pipeline Jenkinsfile for Feb 15 2017 demo
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',
You can’t perform that action at this time.