From 191e47a73f360f6ed51b6165d2af14773cc98370 Mon Sep 17 00:00:00 2001
From: Keshav Prasad <msknext@gmail.com>
Date: Tue, 9 Jul 2019 15:31:26 +0530
Subject: [PATCH] feat: Player build optimizations (#598)

* fix: optimize build times

* fix: Moving nvm to build-cdn.sh

* fix: indentation fix
---
 pipelines/deploy/player-cdn/Jenkinsfile | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/pipelines/deploy/player-cdn/Jenkinsfile b/pipelines/deploy/player-cdn/Jenkinsfile
index 8a7e23bfa..9983938de 100644
--- a/pipelines/deploy/player-cdn/Jenkinsfile
+++ b/pipelines/deploy/player-cdn/Jenkinsfile
@@ -1,6 +1,7 @@
 @Library('deploy-conf') _
 node() {
     try {
+     timestamps {
         ansiColor('xterm') {
             String ANSI_GREEN = "\u001B[32m"
             String ANSI_NORMAL = "\u001B[0m"
@@ -34,10 +35,8 @@ node() {
                         commitHash = sh(script: "jq -r '.commit_hash' metadata.json", returnStdout: true).trim()
                         dir('sunbird-portal') {
                             sunbirdPortalUrl = 'https://github.com/Sunbird-Ed/SunbirdEd-portal.git'
-                            checkout([$class: 'GitSCM', branches: [[name: "$commitHash"]], userRemoteConfigs: [[url: "$sunbirdPortalUrl"]]])
-                            timestamps {
-                                sh("docker run -v /etc/passwd:/etc/passwd -u `id -u`:`id -g` -v `pwd`:/var/lib/jenkins -w /var/lib/jenkins circleci/node:8.11-stretch sh ./build-cdn.sh ${cdnUrl} ${commitHash} ")
-                            }
+                            checkout changelog: false, poll: false, scm: [$class: 'GitSCM', branches: [[name: "$commitHash"]], doGenerateSubmoduleConfigurations: false, extensions: [[$class: 'CloneOption', depth: 0, noTags: true, reference: '', shallow: true]], submoduleCfg: [], userRemoteConfigs: [[url: "$sunbirdPortalUrl"]]]
+                            sh "./build-cdn.sh ${cdnUrl} ${commitHash}"
                         }
                         ansibleExtraArgs = "--extra-vars assets=$currentWs/sunbird-portal/src/app/dist --extra-vars cdn_file_path=$currentWs/sunbird-portal/src/app/dist/index_cdn.ejs --vault-password-file /var/lib/jenkins/secrets/vault-pass"
                         values.put('ansibleExtraArgs', ansibleExtraArgs)
@@ -55,6 +54,7 @@ node() {
             }
         }
     }
+}
     catch (err) {
         currentBuild.result = "FAILURE"
         throw err
-- 
GitLab