diff --git a/Jenkinsfile b/Jenkinsfile index 64186b2..985bf59 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -12,6 +12,10 @@ pipeline { stage('Build & Test') { agent { label getAgentLabel() } + environment { + CHROME_BIN = "${getChromeBin()}" + } + stages { stage('Cleanup Workspace') { @@ -64,7 +68,7 @@ pipeline { } } steps { - sh 'npm run test -- --watch=false --browsers=ChromeHeadless' + sh 'npm run test -- --watch=false --browsers=ChromeHeadless --no-sandbox' } } @@ -173,4 +177,12 @@ def getHealthUrl() { } else { return "https://bangararaju-uat.kottedi.in/admin" } +} + +def getChromeBin() { + if (env.BRANCH_NAME == 'prod') { + return "/snap/bin/chromium" + } else { + return "/usr/bin/chromium" + } } \ No newline at end of file