Skip to content
This repository was archived by the owner on Jan 18, 2022. It is now read-only.

Commit 40e771f

Browse files
author
Jamie Brynes
authored
Add worker sdk override env variables (#1369)
1 parent e0aead4 commit 40e771f

File tree

2 files changed

+16
-2
lines changed

2 files changed

+16
-2
lines changed

init.ps1

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,12 @@ $SdkPath = $PkgRoot + "/io.improbable.worker.sdk"
1515
$SdkMobilePath = $PkgRoot + "/io.improbable.worker.sdk.mobile"
1616
$TestSdkPath="test-project/Packages/io.improbable.worker.sdk.testschema"
1717

18-
$SdkVersion = Get-Content ($SdkPath + "/.sdk.version")
18+
if (Test-Path env:WORKER_SDK_OVERRIDE) {
19+
$SdkVersion = $env:WORKER_SDK_OVERRIDE;
20+
} else {
21+
$SdkVersion = Get-Content ($SdkPath + "/.sdk.version")
22+
}
23+
1924
$SpotVersion = Get-Content ($SdkPath + "/.spot.version")
2025

2126
function UpdatePackage($type, $identifier, $path, $removes)

init.sh

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
#!/usr/bin/env bash
22
set -e -u -o pipefail
33

4+
if [[ -n "${DEBUG-}" ]]; then
5+
set -x
6+
fi
7+
48
cd "$(dirname "$0")"
59

610
if [[ -n "${1:-}" ]]; then
@@ -21,7 +25,12 @@ SDK_PATH="${PKG_ROOT}/io.improbable.worker.sdk"
2125
SDK_MOBILE_PATH="${PKG_ROOT}/io.improbable.worker.sdk.mobile"
2226
TEST_SDK_PATH="test-project/Packages/io.improbable.worker.sdk.testschema"
2327

24-
SDK_VERSION="$(cat "${SDK_PATH}"/.sdk.version)"
28+
if [[ -n "${WORKER_SDK_OVERRIDE:-}" ]]; then
29+
SDK_VERSION="${WORKER_SDK_OVERRIDE}"
30+
else
31+
SDK_VERSION="$(cat "${SDK_PATH}"/.sdk.version)"
32+
fi
33+
2534
SPOT_VERSION="$(cat "${SDK_PATH}"/.spot.version)"
2635

2736
update_package() {

0 commit comments

Comments
 (0)