NotesWhat is notes.io?

Notes brand slogan

Notes - notes.io

/**

This groovy script is to build and deploy payments application.
Change log
Date - Author - psid - description

08-03-2019 - Karthik - 1600036 - To enable zero manual touch deployment
*/

node('linux7 && uk') {
//node('UKLVAPAPP622') {
def direct_uat_build="N"
def buildType1="BUILD_PARAM"
def BUILD_ID1=""
def triggered_by=""
def citaccess=""
def sitaccess=""
def ptaccess=""
def oataccess=""
def build_status1=""
def master_build_only="N"




try{
wrap([$class: 'BuildUser']) {
sh 'echo "${BUILD_USER}"'
sh 'echo "${BUILD_USER_ID}"'
sh 'echo "${BUILD_USER_EMAIL}"'
user = env.BUILD_USER_ID
user_email=env.BUILD_USER_EMAIL
triggered_by="${BUILD_USER}"
jobUserId= env.BUILD_USER_ID
}
}catch(exc){
echo "******************************************************************************"
echo "*******************Build failed unable to identify the resource***************"
echo "******************************************************************************"
throw exc
}





switch (Application_Deployment_Env){
case "Select" :
echo "*************************************************************************************************************************************************************"
echo "*******************Build failed because no Environment selected, kindly select the environment to build and deploy before you trigger this job***************"
echo "*************************************************************************************************************************************************************"
throw new GroovyRuntimeException("***Job Failed for above highlighted reason****")
break;
case "CIT-QA" :
sh 'curl https://bitbucket.global.standardchartered.com/projects/S2BV4/repos/s2bv4-ansible/raw/S2BV4NextGen/CIT_access_BD.txt?at=refs%2Fheads%2Ffeature%2Ftestcicd > cit_access.txt'
citaccess = readFile "${env.WORKSPACE}/cit_access.txt"
if (!(citaccess.trim().contains("${jobUserId}"))){
echo "*************************************************************************************************************************************************************"
echo "*******************Sorry you are not authorized person to trigger CIT Build and Deployments. Only Scrum masters are authorized*******************************"
echo "*************************************************************************************************************************************************************"
throw new GroovyRuntimeException("***Job Failed for above highlighted reason****")}
else {
println "*******Approved***********"
}
break;
case "CIT-GOLD" :
sh 'curl https://bitbucket.global.standardchartered.com/projects/S2BV4/repos/s2bv4-ansible/raw/S2BV4NextGen/CIT_access_BD.txt?at=refs%2Fheads%2Ffeature%2Ftestcicd > cit_access.txt'
citaccess = readFile "${env.WORKSPACE}/cit_access.txt"
if (!(citaccess.trim().contains("${jobUserId}"))){
echo "*************************************************************************************************************************************************************"
echo "*******************Sorry you are not authorized person to trigger CIT Build and Deployments. Only Scrum masters are authorized*******************************"
echo "*************************************************************************************************************************************************************"
throw new GroovyRuntimeException("***Job Failed for above highlighted reason****")}
println "*******Approved***********"
break;
case "UAT" :
sh 'curl https://bitbucket.global.standardchartered.com/projects/S2BV4/repos/s2bv4-ansible/raw/S2BV4NextGen/SIT_access_BD.txt?at=refs%2Fheads%2Ffeature%2Ftestcicd > sit_access.txt'
sitaccess = readFile "${env.WORKSPACE}/sit_access.txt"
if (!(sitaccess.trim().contains("${jobUserId}"))){
echo "*************************************************************************************************************************************************************"
echo "*******************Sorry you are not authorized person to trigger SIT Build and Deployments. ****************************************************************"
echo "*************************************************************************************************************************************************************"
throw new GroovyRuntimeException("***Job Failed for above highlighted reason****")}
println "*******Approved***********"

break;
case "GOLD-QA" :
sh 'curl https://bitbucket.global.standardchartered.com/projects/S2BV4/repos/s2bv4-ansible/raw/S2BV4NextGen/SIT_access_BD.txt?at=refs%2Fheads%2Ffeature%2Ftestcicd > sit_access.txt'
sitaccess = readFile "${env.WORKSPACE}/sit_access.txt"
if (!(sitaccess.trim().contains("${jobUserId}"))){
echo "*************************************************************************************************************************************************************"
echo "*******************Sorry you are not authorized person to trigger SIT Build and Deployments. ****************************************************************"
echo "*************************************************************************************************************************************************************"
throw new GroovyRuntimeException("***Job Failed for above highlighted reason****")}
println "*******Approved***********"
break;
case "PT" :
sh 'curl https://bitbucket.global.standardchartered.com/projects/S2BV4/repos/s2bv4-ansible/raw/S2BV4NextGen/PT_access_BD.txt?at=refs%2Fheads%2Ffeature%2Ftestcicd > pt_access.txt'
ptaccess = readFile "${env.WORKSPACE}/pt_access.txt"
if (!(ptaccess.trim().contains("${jobUserId}"))){
echo "*************************************************************************************************************************************************************"
echo "*******************Sorry you are not authorized person to trigger PT Build and Deployments. ****************************************************************"
echo "*************************************************************************************************************************************************************"
throw new GroovyRuntimeException("***Job Failed for above highlighted reason****")}
println "*******Approved***********"
break;
case "OAT" :
sh 'curl https://bitbucket.global.standardchartered.com/projects/S2BV4/repos/s2bv4-ansible/raw/S2BV4NextGen/OAT_access_BD.txt?at=refs%2Fheads%2Ffeature%2Ftestcicd > oat_access.txt'
oataccess = readFile "${env.WORKSPACE}/oat_access.txt"
if (!(oataccess.trim().contains("${jobUserId}"))){
echo "*************************************************************************************************************************************************************"
echo "*******************Sorry you are not authorized person to trigger OAT Build and Deployments. ****************************************************************"
echo "*************************************************************************************************************************************************************"
throw new GroovyRuntimeException("***Job Failed for above highlighted reason****")}
println "*******Approved***********"
break;

}
     
 
what is notes.io
 

Notes.io is a web-based application for taking notes. You can take your notes and share with others people. If you like taking long notes, notes.io is designed for you. To date, over 8,000,000,000 notes created and continuing...

With notes.io;

  • * You can take a note from anywhere and any device with internet connection.
  • * You can share the notes in social platforms (YouTube, Facebook, Twitter, instagram etc.).
  • * You can quickly share your contents without website, blog and e-mail.
  • * You don't need to create any Account to share a note. As you wish you can use quick, easy and best shortened notes with sms, websites, e-mail, or messaging services (WhatsApp, iMessage, Telegram, Signal).
  • * Notes.io has fabulous infrastructure design for a short link and allows you to share the note as an easy and understandable link.

Fast: Notes.io is built for speed and performance. You can take a notes quickly and browse your archive.

Easy: Notes.io doesn’t require installation. Just write and share note!

Short: Notes.io’s url just 8 character. You’ll get shorten link of your note when you want to share. (Ex: notes.io/q )

Free: Notes.io works for 12 years and has been free since the day it was started.


You immediately create your first note and start sharing with the ones you wish. If you want to contact us, you can use the following communication channels;


Email: [email protected]

Twitter: http://twitter.com/notesio

Instagram: http://instagram.com/notes.io

Facebook: http://facebook.com/notesio



Regards;
Notes.io Team

     
 
Shortened Note Link
 
 
Looding Image
 
     
 
Long File
 
 

For written notes was greater than 18KB Unable to shorten.

To be smaller than 18KB, please organize your notes, or sign in.