From 427b91938270bb91cc1d66fb740091fa56b66881 Mon Sep 17 00:00:00 2001 From: Pablo Date: Fri, 26 Apr 2024 14:47:09 +0200 Subject: [PATCH] browserstack build tag (#3610) --- Jenkinsfile | 3 +++ scripts/browserstackJenkins.sh | 5 +++-- scripts/browserstackJenkinsCompose.sh | 3 ++- scripts/browserstackJenkinsForm.sh | 3 ++- 4 files changed, 10 insertions(+), 4 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index c9ac08f86d..5c8ba67d08 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -55,6 +55,7 @@ pipeline { BROWSERSTACK = credentials('android-browserstack') form_apk = sh(returnStdout: true, script: 'find form/build/outputs -iname "*.apk" | sed -n 1p') form_apk_path = "${env.WORKSPACE}/${form_apk}" + buildTag = "${env.GIT_BRANCH} - form" } steps { dir("${env.WORKSPACE}/scripts"){ @@ -71,6 +72,7 @@ pipeline { BROWSERSTACK = credentials('android-browserstack') compose_table_apk = sh(returnStdout: true, script: 'find compose-table/build/outputs -iname "*.apk" | sed -n 1p') compose_table_apk_path = "${env.WORKSPACE}/${compose_table_apk}" + buildTag = "${env.GIT_BRANCH} - table" } steps { dir("${env.WORKSPACE}/scripts"){ @@ -89,6 +91,7 @@ pipeline { test_apk = sh(returnStdout: true, script: 'find app/build/outputs -iname "*.apk" | sed -n 2p') app_apk_path = "${env.WORKSPACE}/${app_apk}" test_apk_path = "${env.WORKSPACE}/${test_apk}" + buildTag = "${env.GIT_BRANCH}" } steps { dir("${env.WORKSPACE}/scripts"){ diff --git a/scripts/browserstackJenkins.sh b/scripts/browserstackJenkins.sh index 1b8adebcd8..9cd300663a 100644 --- a/scripts/browserstackJenkins.sh +++ b/scripts/browserstackJenkins.sh @@ -30,9 +30,10 @@ json=$(jq -n \ --arg language "$browserstack_language" \ --arg locale "$browserstack_locale" \ --arg deviceLogs "$browserstack_deviceLogs" \ - --arg allowDeviceMockServer "$browserstack_allowDeviceMockServer" \ + --arg allowDeviceMockServer "$browserstack_allowDeviceMockServer" \ --argjson shards "$shards" \ - '{devices: $devices, app: $app_url, testSuite: $test_url, class: $class, logs: $logs, video: $video, local: $loc, localIdentifier: $locId, gpsLocation: $gpsLocation, language: $language, locale: $locale, deviceLogs: $deviceLogs, allowDeviceMockServer: $allowDeviceMockServer, shards: $shards}') + --arg buildTag "$buildTag" \ + '{devices: $devices, app: $app_url, testSuite: $test_url, class: $class, logs: $logs, video: $video, local: $loc, localIdentifier: $locId, gpsLocation: $gpsLocation, language: $language, locale: $locale, deviceLogs: $deviceLogs, allowDeviceMockServer: $allowDeviceMockServer, shards: $shards, buildTag: $buildTag}') test_execution_response="$(curl -X POST https://api-cloud.browserstack.com/app-automate/espresso/v2/build -d \ "$json" -H "Content-Type: application/json" -u "$BROWSERSTACK_USR:$BROWSERSTACK_PSW")" diff --git a/scripts/browserstackJenkinsCompose.sh b/scripts/browserstackJenkinsCompose.sh index c1565649b1..e23271abf3 100644 --- a/scripts/browserstackJenkinsCompose.sh +++ b/scripts/browserstackJenkinsCompose.sh @@ -13,7 +13,8 @@ json=$(jq -n \ --argjson devices ["$browserstack_device_list"] \ --arg video "$browserstack_video" \ --arg deviceLogs "$browserstack_deviceLogs" \ - '{devices: $devices, testSuite: $module_url, video: $video, deviceLogs: $deviceLogs'}) + --arg buildTag "$buildTag" \ + '{devices: $devices, testSuite: $module_url, video: $video, deviceLogs: $deviceLogs, buildTag: $buildTag}') test_execution_response="$(curl -X POST https://api-cloud.browserstack.com/app-automate/espresso/v2/module-build -d \ "$json" -H "Content-Type: application/json" -u "$BROWSERSTACK_USR:$BROWSERSTACK_PSW")" diff --git a/scripts/browserstackJenkinsForm.sh b/scripts/browserstackJenkinsForm.sh index c486265641..1864b5452a 100644 --- a/scripts/browserstackJenkinsForm.sh +++ b/scripts/browserstackJenkinsForm.sh @@ -15,7 +15,8 @@ json=$(jq -n \ --argjson devices ["$browserstack_device_list"] \ --arg video "$browserstack_video" \ --arg deviceLogs "$browserstack_deviceLogs" \ - '{devices: $devices, testSuite: $module_url, video: $video, deviceLogs: $deviceLogs'}) + --arg buildTag "$buildTag" \ + '{devices: $devices, testSuite: $module_url, video: $video, deviceLogs: $deviceLogs, buildTag: $buildTag}') test_execution_response="$(curl -X POST https://api-cloud.browserstack.com/app-automate/espresso/v2/module-build -d \ "$json" -H "Content-Type: application/json" -u "$BROWSERSTACK_USR:$BROWSERSTACK_PSW")"