         withCredentials([
           string(credentialsId: 'NPM_TOKEN', variable: 'NPM_TOKEN')
         ]) {
-          sh '''#!/bin/bash -ex
+          sh '''#!/bin/bash -e
             set +x
             rm .nvmrc
             curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.29.0/install.sh | bash
             ~/.nvm/nvm.sh
             echo \'//registry.npmjs.org/:_authToken=${NPM_TOKEN}\' >> .npmrc
             source ~/.bashrc || true
-            source ~/.profile || true'''
-          sh '''#!/bin/bash -ex
-            source ~/.nvm/nvm.sh
+            source ~/.profile || true
             nvm install 8.11.1
             nvm use 8.11.1
             npm install

  stages {
    stage('Checkout') {
        steps{
            checkout poll: false, scm: [$class: 'GitSCM', branches: [[name: '*/master']], doGenerateSubmoduleConfigurations: false, extensions: [], submoduleCfg: [], userRemoteConfigs: [[credentialsId: 'a8c27fc2-52cd-499c-b648-0355ed5ca72a', url: 'https://github.com/webex/react-ciscospark']]]
        }
    }


            usernamePassword(credentialsId: 'SAUCE_LABS_VALIDATED_MERGE_CREDENTIALS', passwordVariable: 'SAUCE_ACCESS_KEY', usernameVariable: 'SAUCE_USERNAME'),
            string(credentialsId: 'CISCOSPARK_APPID_SECRET', variable: 'CISCOSPARK_APPID_SECRET'),
        ]) {
            sh '''#!/bin/bash -e
              source ~/.nvm/nvm.sh
              nvm use 8.11.1
              NODE_ENV=test npm run build:package widget-space && npm run build:package widget-recents
              set -m
              (
                (CISCOSPARK_CLIENT_ID=C873b64d70536ed26df6d5f81e01dafccbd0a0af2e25323f7f69c7fe46a7be340 SAUCE=true PORT=4569 SAUCE_CONNECT_PORT=5006 BROWSER=firefox VERSION=beta npm run test:integration || kill 0) &
                (sleep 60; CISCOSPARK_CLIENT_ID=C873b64d70536ed26df6d5f81e01dafccbd0a0af2e25323f7f69c7fe46a7be340 SAUCE=true PORT=4568 SAUCE_CONNECT_PORT=5005 BROWSER=chrome VERSION=beta npm run test:integration || kill 0) &
                (sleep 120; CISCOSPARK_CLIENT_ID=C873b64d70536ed26df6d5f81e01dafccbd0a0af2e25323f7f69c7fe46a7be340 SAUCE=true PORT=4567 SAUCE_CONNECT_PORT=5004 BROWSER=chrome PLATFORM="windows 10" VERSION=beta npm run test:integration || kill 0) &
                wait
              )
            '''
        }
      }
