From 93c76326ba02eede576ee2d2164bb49bfc456f16 Mon Sep 17 00:00:00 2001 From: Ritika Date: Fri, 7 Feb 2020 09:41:44 +0530 Subject: [PATCH 01/22] Update Jenkinsfile --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 6176ffd4..1043f61a 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -32,7 +32,7 @@ node { // ------------------------------------------------------------------------- stage('Authorize to Salesforce') { - rc = command "${toolbelt}/sfdx force:auth:jwt:grant --instanceurl https://test.salesforce.com --clientid ${SF_CONSUMER_KEY} --jwtkeyfile ${server_key_file} --username ${SF_USERNAME} --setalias UAT" + rc = command "${toolbelt}/sfdx force:auth:jwt:grant --instanceurl https://login.salesforce.com --clientid ${SF_CONSUMER_KEY} --jwtkeyfile ${server_key_file} --username ${SF_USERNAME} --setalias UAT" if (rc != 0) { error 'Salesforce org authorization failed.' } From 6f0879a43a4662d4b9be5a645b6a48ae7e2c0281 Mon Sep 17 00:00:00 2001 From: Ritika Date: Fri, 7 Feb 2020 10:39:10 +0530 Subject: [PATCH 02/22] Update Jenkinsfile --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 1043f61a..b234f6e2 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -44,7 +44,7 @@ node { // ------------------------------------------------------------------------- stage('Deploy and Run Tests') { - rc = command "${toolbelt}/sfdx force:mdapi:deploy --wait 10 --deploydir ${DEPLOYDIR} --targetusername UAT --testlevel ${TEST_LEVEL}" + rc = command "${toolbelt}/sfdx force:mdapi:deploy --wait 10 --deploydir ${DEPLOYDIR} --targetusername ${SF_USERNAME} --testlevel ${TEST_LEVEL}" if (rc != 0) { error 'Salesforce deploy and test run failed.' } From f823f937df7e21ff06f13961c389944c1c31c633 Mon Sep 17 00:00:00 2001 From: Ritika Date: Fri, 7 Feb 2020 10:54:49 +0530 Subject: [PATCH 03/22] Update Jenkinsfile --- Jenkinsfile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index b234f6e2..5053d814 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -25,7 +25,7 @@ node { // Run all the enclosed stages with access to the Salesforce // JWT key credentials. // ------------------------------------------------------------------------- - +withEnv(["HOME=${env.WORKSPACE}"]) { withCredentials([file(credentialsId: SERVER_KEY_CREDENTIALS_ID, variable: 'server_key_file')]) { // ------------------------------------------------------------------------- // Authenticate to Salesforce using the server key. @@ -63,6 +63,8 @@ node { //} } } +} + def command(script) { if (isUnix()) { From 63dce631a9faa35a60a464130cf0405edea00a5e Mon Sep 17 00:00:00 2001 From: Ritika Date: Fri, 7 Feb 2020 10:58:08 +0530 Subject: [PATCH 04/22] Update Jenkinsfile --- Jenkinsfile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 5053d814..cfe2554e 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -6,7 +6,7 @@ node { def SF_USERNAME=env.SF_USERNAME def SERVER_KEY_CREDENTIALS_ID=env.SERVER_KEY_CREDENTIALS_ID def DEPLOYDIR='src' - def TEST_LEVEL='RunLocalTests' + def TEST_LEVEL='NoTestRun' def toolbelt = tool 'toolbelt' @@ -25,7 +25,7 @@ node { // Run all the enclosed stages with access to the Salesforce // JWT key credentials. // ------------------------------------------------------------------------- -withEnv(["HOME=${env.WORKSPACE}"]) { + withCredentials([file(credentialsId: SERVER_KEY_CREDENTIALS_ID, variable: 'server_key_file')]) { // ------------------------------------------------------------------------- // Authenticate to Salesforce using the server key. @@ -62,7 +62,7 @@ withEnv(["HOME=${env.WORKSPACE}"]) { // } //} } -} + } From 28db680f7f50238ec238bd62f0d3ef6c0d64edff Mon Sep 17 00:00:00 2001 From: Ritika Date: Fri, 7 Feb 2020 12:00:26 +0530 Subject: [PATCH 05/22] Update Jenkinsfile --- Jenkinsfile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index cfe2554e..c55191b9 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -32,7 +32,9 @@ node { // ------------------------------------------------------------------------- stage('Authorize to Salesforce') { - rc = command "${toolbelt}/sfdx force:auth:jwt:grant --instanceurl https://login.salesforce.com --clientid ${SF_CONSUMER_KEY} --jwtkeyfile ${server_key_file} --username ${SF_USERNAME} --setalias UAT" + rc = command "${toolbelt}/sfdx force:auth:logout --username ${SF_USERNAME}" + + rc = command "${toolbelt}/sfdx force:auth:jwt:grant --instanceurl https://login.salesforce.com --clientid ${SF_CONSUMER_KEY} --jwtkeyfile ${server_key_file} --username ${SF_USERNAME} --setalias UAT" if (rc != 0) { error 'Salesforce org authorization failed.' } From 4422522cb415c594fe1543e4ec74f0de5c738b49 Mon Sep 17 00:00:00 2001 From: Ritika Date: Fri, 7 Feb 2020 17:05:50 +0530 Subject: [PATCH 06/22] Update Jenkinsfile --- Jenkinsfile | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index c55191b9..f1e446d0 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -7,10 +7,14 @@ node { def SERVER_KEY_CREDENTIALS_ID=env.SERVER_KEY_CREDENTIALS_ID def DEPLOYDIR='src' def TEST_LEVEL='NoTestRun' + def WORKSPACE = env.WORKSPACE def toolbelt = tool 'toolbelt' + + + // ------------------------------------------------------------------------- // Check out code from source control. @@ -20,6 +24,11 @@ node { checkout scm } + stage('copy files to local workspace'){ + //sh label: '', script: 'mkdir ${WORKSPACE}/${env.JOB_NAME}/srcCopy + sh label: '', script: 'cp -r ${DEPLOYDIR} srcCopy' + } + // ------------------------------------------------------------------------- // Run all the enclosed stages with access to the Salesforce @@ -46,7 +55,7 @@ node { // ------------------------------------------------------------------------- stage('Deploy and Run Tests') { - rc = command "${toolbelt}/sfdx force:mdapi:deploy --wait 10 --deploydir ${DEPLOYDIR} --targetusername ${SF_USERNAME} --testlevel ${TEST_LEVEL}" + rc = command "${toolbelt}/sfdx force:mdapi:deploy --wait 10 --deploydir srcCopy --targetusername ${SF_USERNAME} --testlevel ${TEST_LEVEL}" if (rc != 0) { error 'Salesforce deploy and test run failed.' } From 0493f451e35a7c9c07dc925f75f42c3f63db6104 Mon Sep 17 00:00:00 2001 From: Ritika Date: Fri, 7 Feb 2020 17:09:46 +0530 Subject: [PATCH 07/22] Update Jenkinsfile --- Jenkinsfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index f1e446d0..5d3631d0 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -25,8 +25,8 @@ node { } stage('copy files to local workspace'){ - //sh label: '', script: 'mkdir ${WORKSPACE}/${env.JOB_NAME}/srcCopy - sh label: '', script: 'cp -r ${DEPLOYDIR} srcCopy' + sh label: '', script: 'mkdir ${WORKSPACE}/${env.JOB_NAME}/srcCopy + //sh label: '', script: 'cp -r ${DEPLOYDIR} srcCopy' } From f4c01bb33c2e94ff2d4c4f6d2d2d5e7cb551d78e Mon Sep 17 00:00:00 2001 From: Ritika Date: Fri, 7 Feb 2020 17:10:17 +0530 Subject: [PATCH 08/22] Update Jenkinsfile --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 5d3631d0..9a410338 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -25,7 +25,7 @@ node { } stage('copy files to local workspace'){ - sh label: '', script: 'mkdir ${WORKSPACE}/${env.JOB_NAME}/srcCopy + sh label: '', script: 'mkdir ${WORKSPACE}/${env.JOB_NAME}/srcCopy' //sh label: '', script: 'cp -r ${DEPLOYDIR} srcCopy' } From ea55543fea35ea1c8b5907b5b8a24bf654f72cba Mon Sep 17 00:00:00 2001 From: Ritika Date: Fri, 7 Feb 2020 17:11:27 +0530 Subject: [PATCH 09/22] Update Jenkinsfile --- Jenkinsfile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 9a410338..8217a9d2 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -25,7 +25,9 @@ node { } stage('copy files to local workspace'){ - sh label: '', script: 'mkdir ${WORKSPACE}/${env.JOB_NAME}/srcCopy' + debug ${env.JOB_NAME} + debug ${WORKSPACE} + //sh label: '', script: 'mkdir ${WORKSPACE}/${env.JOB_NAME}/srcCopy' //sh label: '', script: 'cp -r ${DEPLOYDIR} srcCopy' } From a99de411c8b0ba4f62b67173039fa8173bf759e9 Mon Sep 17 00:00:00 2001 From: Ritika Date: Fri, 7 Feb 2020 17:13:34 +0530 Subject: [PATCH 10/22] Update Jenkinsfile --- Jenkinsfile | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 8217a9d2..e83178d0 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -25,8 +25,8 @@ node { } stage('copy files to local workspace'){ - debug ${env.JOB_NAME} - debug ${WORKSPACE} + echo "${env.JOB_NAME}" + echo "${WORKSPACE}" //sh label: '', script: 'mkdir ${WORKSPACE}/${env.JOB_NAME}/srcCopy' //sh label: '', script: 'cp -r ${DEPLOYDIR} srcCopy' } @@ -57,7 +57,7 @@ node { // ------------------------------------------------------------------------- stage('Deploy and Run Tests') { - rc = command "${toolbelt}/sfdx force:mdapi:deploy --wait 10 --deploydir srcCopy --targetusername ${SF_USERNAME} --testlevel ${TEST_LEVEL}" + rc = command "${toolbelt}/sfdx force:mdapi:deploy --wait 10 --deploydir src --targetusername ${SF_USERNAME} --testlevel ${TEST_LEVEL}" if (rc != 0) { error 'Salesforce deploy and test run failed.' } @@ -83,6 +83,6 @@ def command(script) { if (isUnix()) { return sh(returnStatus: true, script: script); } else { - return bat(returnStatus: true, script: script); + return bat(returnStatus: true, script: script); } } From ab80b04344016c1528c23f854a27e1b084545c29 Mon Sep 17 00:00:00 2001 From: Ritika Date: Fri, 7 Feb 2020 17:15:59 +0530 Subject: [PATCH 11/22] Update Jenkinsfile --- Jenkinsfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index e83178d0..51309817 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -27,8 +27,8 @@ node { stage('copy files to local workspace'){ echo "${env.JOB_NAME}" echo "${WORKSPACE}" - //sh label: '', script: 'mkdir ${WORKSPACE}/${env.JOB_NAME}/srcCopy' - //sh label: '', script: 'cp -r ${DEPLOYDIR} srcCopy' + sh 'mkdir ${WORKSPACE}/srcCopy' + sh 'cp -r ${DEPLOYDIR} srcCopy' } From f6fc15450f4bbd84fe2a475f47a41bced1293840 Mon Sep 17 00:00:00 2001 From: Ritika Date: Fri, 7 Feb 2020 17:19:11 +0530 Subject: [PATCH 12/22] Update Jenkinsfile --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 51309817..ea99a334 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -28,7 +28,7 @@ node { echo "${env.JOB_NAME}" echo "${WORKSPACE}" sh 'mkdir ${WORKSPACE}/srcCopy' - sh 'cp -r ${DEPLOYDIR} srcCopy' + sh 'cp -R ${DEPLOYDIR} srcCopy' } From 4341f5f3cfa34fe0f595aaa9b2111174db440f3d Mon Sep 17 00:00:00 2001 From: Ritika Date: Fri, 7 Feb 2020 17:24:58 +0530 Subject: [PATCH 13/22] Update Jenkinsfile --- Jenkinsfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index ea99a334..5737cb7c 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -27,8 +27,8 @@ node { stage('copy files to local workspace'){ echo "${env.JOB_NAME}" echo "${WORKSPACE}" - sh 'mkdir ${WORKSPACE}/srcCopy' - sh 'cp -R ${DEPLOYDIR} srcCopy' + sh 'mkdir ${WORKSPACE}/srccopy' + sh 'cp -R src srccopy' } From b2e4e219e507169292659ac91db8cbaa9b5dd1a4 Mon Sep 17 00:00:00 2001 From: Ritika Date: Fri, 7 Feb 2020 17:26:01 +0530 Subject: [PATCH 14/22] Update Jenkinsfile --- Jenkinsfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 5737cb7c..230aa4c6 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -27,8 +27,8 @@ node { stage('copy files to local workspace'){ echo "${env.JOB_NAME}" echo "${WORKSPACE}" - sh 'mkdir ${WORKSPACE}/srccopy' - sh 'cp -R src srccopy' + sh 'mkdir ${WORKSPACE}/src_copy' + sh 'cp -R src src_copy' } From 8b057080fcc7e548bc58e26781e1deaeec1d0f9a Mon Sep 17 00:00:00 2001 From: Ritika Date: Fri, 7 Feb 2020 17:27:14 +0530 Subject: [PATCH 15/22] Update Jenkinsfile --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 230aa4c6..36cce603 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -28,7 +28,7 @@ node { echo "${env.JOB_NAME}" echo "${WORKSPACE}" sh 'mkdir ${WORKSPACE}/src_copy' - sh 'cp -R src src_copy' + sh 'cp -R ${DEPLOYDIR} src_copy' } From 1a4110f55fe788459b352f07bf4f96b529d5d8d5 Mon Sep 17 00:00:00 2001 From: Ritika Date: Fri, 7 Feb 2020 17:28:55 +0530 Subject: [PATCH 16/22] Update Jenkinsfile --- Jenkinsfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 36cce603..12961be9 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -27,7 +27,7 @@ node { stage('copy files to local workspace'){ echo "${env.JOB_NAME}" echo "${WORKSPACE}" - sh 'mkdir ${WORKSPACE}/src_copy' + sh 'mkdir -p ${WORKSPACE}/src_copy' sh 'cp -R ${DEPLOYDIR} src_copy' } @@ -57,7 +57,7 @@ node { // ------------------------------------------------------------------------- stage('Deploy and Run Tests') { - rc = command "${toolbelt}/sfdx force:mdapi:deploy --wait 10 --deploydir src --targetusername ${SF_USERNAME} --testlevel ${TEST_LEVEL}" + rc = command "${toolbelt}/sfdx force:mdapi:deploy --wait 10 --deploydir src_copy/${DEPLOYDIR} --targetusername ${SF_USERNAME} --testlevel ${TEST_LEVEL}" if (rc != 0) { error 'Salesforce deploy and test run failed.' } From 0ddbd2a247322bf2de520488bea6dbe2f24da861 Mon Sep 17 00:00:00 2001 From: Ritika Date: Fri, 7 Feb 2020 17:48:00 +0530 Subject: [PATCH 17/22] Update Jenkinsfile --- Jenkinsfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 12961be9..024870bd 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -27,8 +27,8 @@ node { stage('copy files to local workspace'){ echo "${env.JOB_NAME}" echo "${WORKSPACE}" - sh 'mkdir -p ${WORKSPACE}/src_copy' - sh 'cp -R ${DEPLOYDIR} src_copy' + sh "mkdir -p ${WORKSPACE}/src_copy" + sh "cp -R ${DEPLOYDIR} src_copy" } From bb3a2dd36a5c0d73b768f2c9289eb8228a8ebff5 Mon Sep 17 00:00:00 2001 From: Ritika Date: Fri, 7 Feb 2020 17:49:55 +0530 Subject: [PATCH 18/22] Update Jenkinsfile --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 024870bd..60bdeedd 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -43,7 +43,7 @@ node { // ------------------------------------------------------------------------- stage('Authorize to Salesforce') { - rc = command "${toolbelt}/sfdx force:auth:logout --username ${SF_USERNAME}" + rl = command "${toolbelt}/sfdx force:auth:logout --u ${SF_USERNAME}" rc = command "${toolbelt}/sfdx force:auth:jwt:grant --instanceurl https://login.salesforce.com --clientid ${SF_CONSUMER_KEY} --jwtkeyfile ${server_key_file} --username ${SF_USERNAME} --setalias UAT" if (rc != 0) { From 630d66d9fcdb1da7abe707c5b0f9448b44181299 Mon Sep 17 00:00:00 2001 From: Ritika Date: Fri, 7 Feb 2020 17:50:35 +0530 Subject: [PATCH 19/22] Update Jenkinsfile --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 60bdeedd..c24e36e1 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -43,7 +43,7 @@ node { // ------------------------------------------------------------------------- stage('Authorize to Salesforce') { - rl = command "${toolbelt}/sfdx force:auth:logout --u ${SF_USERNAME}" + rl = command "${toolbelt}/sfdx force:auth:logout -u ${SF_USERNAME}" rc = command "${toolbelt}/sfdx force:auth:jwt:grant --instanceurl https://login.salesforce.com --clientid ${SF_CONSUMER_KEY} --jwtkeyfile ${server_key_file} --username ${SF_USERNAME} --setalias UAT" if (rc != 0) { From 27f7b6efa42cb11cbd8ad79c1ff813a4c52f0afd Mon Sep 17 00:00:00 2001 From: Ritika Date: Fri, 7 Feb 2020 17:54:07 +0530 Subject: [PATCH 20/22] Update Jenkinsfile --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index c24e36e1..a466b3a4 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -43,7 +43,7 @@ node { // ------------------------------------------------------------------------- stage('Authorize to Salesforce') { - rl = command "${toolbelt}/sfdx force:auth:logout -u ${SF_USERNAME}" + rl = command "${toolbelt}/sfdx force:auth:logout -p -u ${SF_USERNAME}" rc = command "${toolbelt}/sfdx force:auth:jwt:grant --instanceurl https://login.salesforce.com --clientid ${SF_CONSUMER_KEY} --jwtkeyfile ${server_key_file} --username ${SF_USERNAME} --setalias UAT" if (rc != 0) { From 004067f3c041edcf5fb4b5c8425bedd2b32b23f6 Mon Sep 17 00:00:00 2001 From: Ritika Date: Fri, 7 Feb 2020 19:45:01 +0530 Subject: [PATCH 21/22] Update MyClass.cls --- src/classes/MyClass.cls | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/classes/MyClass.cls b/src/classes/MyClass.cls index 51e359d4..15f23dcc 100644 --- a/src/classes/MyClass.cls +++ b/src/classes/MyClass.cls @@ -4,6 +4,6 @@ public with sharing class MyClass { } public String getAppVersion() { - return '1.0.0'; + return '2.0.0'; } } From f4888ec6029d2aa84ab4f3d9d981e7f97bc729bf Mon Sep 17 00:00:00 2001 From: Ritika Date: Tue, 11 Feb 2020 12:54:01 +0530 Subject: [PATCH 22/22] Update MyClass.cls --- src/classes/MyClass.cls | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/classes/MyClass.cls b/src/classes/MyClass.cls index 15f23dcc..1b3a8f35 100644 --- a/src/classes/MyClass.cls +++ b/src/classes/MyClass.cls @@ -1,6 +1,6 @@ public with sharing class MyClass { public MyClass() { - + system.debug('cons'); } public String getAppVersion() {