From 79133b2bd8bf241db777683e39b23811f91361fe Mon Sep 17 00:00:00 2001 From: Simen Sandvaer Date: Sun, 17 Sep 2023 22:02:43 +0200 Subject: [PATCH 01/12] Add first take on porting over licensing server support from ubuntu --- dist/platforms/mac/steps/activate.sh | 40 +++++++++++++++++++--------- 1 file changed, 28 insertions(+), 12 deletions(-) diff --git a/dist/platforms/mac/steps/activate.sh b/dist/platforms/mac/steps/activate.sh index c9511eb50..5e271e8a9 100755 --- a/dist/platforms/mac/steps/activate.sh +++ b/dist/platforms/mac/steps/activate.sh @@ -6,20 +6,36 @@ pushd "$ACTIVATE_LICENSE_PATH" echo "Requesting activation" -# Activate license -/Applications/Unity/Hub/Editor/$UNITY_VERSION/Unity.app/Contents/MacOS/Unity \ - -logFile - \ - -batchmode \ - -nographics \ - -quit \ - -serial "$UNITY_SERIAL" \ - -username "$UNITY_EMAIL" \ - -password "$UNITY_PASSWORD" \ - -projectPath "$ACTIVATE_LICENSE_PATH" +if [[ -n "$UNITY_LICENSING_SERVER" ]]; then + # + # Custom Unity License Server + # + echo "Adding licensing server config" -# Store the exit code from the verify command -UNITY_EXIT_CODE=$? + /Applications/Unity/Hub/Editor/$UNITY_VERSION/Unity.app/Contents/Frameworks/UnityLicensingClient.app/Contents/MacOS/Unity.Licensing.Client --acquire-floating > license.txt #is this accessible in a env variable? + PARSEDFILE=$(grep -oP '\".*?\"' < license.txt | tr -d '"') + export FLOATING_LICENSE + FLOATING_LICENSE=$(sed -n 2p <<< "$PARSEDFILE") + FLOATING_LICENSE_TIMEOUT=$(sed -n 4p <<< "$PARSEDFILE") + echo "Acquired floating license: \"$FLOATING_LICENSE\" with timeout $FLOATING_LICENSE_TIMEOUT" + # Store the exit code from the verify command + UNITY_EXIT_CODE=$? +else + # Activate license + /Applications/Unity/Hub/Editor/$UNITY_VERSION/Unity.app/Contents/MacOS/Unity \ + -logFile - \ + -batchmode \ + -nographics \ + -quit \ + -serial "$UNITY_SERIAL" \ + -username "$UNITY_EMAIL" \ + -password "$UNITY_PASSWORD" \ + -projectPath "$ACTIVATE_LICENSE_PATH" + + # Store the exit code from the verify command + UNITY_EXIT_CODE=$? +fi # # Display information about the result # From d65cb6db5738f22aa261ee49ef7649343f4cab62 Mon Sep 17 00:00:00 2001 From: simensan Date: Mon, 18 Sep 2023 10:36:38 +0200 Subject: [PATCH 02/12] Add releasing license when using licensing server --- dist/platforms/mac/steps/return_license.sh | 30 ++++++++++++++-------- 1 file changed, 20 insertions(+), 10 deletions(-) diff --git a/dist/platforms/mac/steps/return_license.sh b/dist/platforms/mac/steps/return_license.sh index 1749f9e74..5ff44768e 100755 --- a/dist/platforms/mac/steps/return_license.sh +++ b/dist/platforms/mac/steps/return_license.sh @@ -4,15 +4,25 @@ echo "Changing to \"$ACTIVATE_LICENSE_PATH\" directory." pushd "$ACTIVATE_LICENSE_PATH" -/Applications/Unity/Hub/Editor/$UNITY_VERSION/Unity.app/Contents/MacOS/Unity \ - -logFile - \ - -batchmode \ - -nographics \ - -quit \ - -username "$UNITY_EMAIL" \ - -password "$UNITY_PASSWORD" \ - -returnlicense \ - -projectPath "$ACTIVATE_LICENSE_PATH" -# Return to previous working directory +if [[ -n "$UNITY_LICENSING_SERVER" ]]; then # + # + # Return any floating license used. + # + echo "Returning floating license: \"$FLOATING_LICENSE\"" + /Applications/Unity/Hub/Editor/$UNITY_VERSION/Unity.app/Contents/Frameworks/UnityLicensingClient.app/Contents/MacOS/Unity.Licensing.Client --return-floating "$FLOATING_LICENSE" +else + /Applications/Unity/Hub/Editor/$UNITY_VERSION/Unity.app/Contents/MacOS/Unity \ + -logFile - \ + -batchmode \ + -nographics \ + -quit \ + -username "$UNITY_EMAIL" \ + -password "$UNITY_PASSWORD" \ + -returnlicense \ + -projectPath "$ACTIVATE_LICENSE_PATH" + + # Return to previous working directory +fi + popd From e13946d8f97544f05f6b978837d214198a12c127 Mon Sep 17 00:00:00 2001 From: simensan Date: Mon, 18 Sep 2023 10:40:36 +0200 Subject: [PATCH 03/12] Update grep command for mac os --- dist/platforms/mac/steps/activate.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dist/platforms/mac/steps/activate.sh b/dist/platforms/mac/steps/activate.sh index 5e271e8a9..d660c0833 100755 --- a/dist/platforms/mac/steps/activate.sh +++ b/dist/platforms/mac/steps/activate.sh @@ -13,7 +13,7 @@ if [[ -n "$UNITY_LICENSING_SERVER" ]]; then echo "Adding licensing server config" /Applications/Unity/Hub/Editor/$UNITY_VERSION/Unity.app/Contents/Frameworks/UnityLicensingClient.app/Contents/MacOS/Unity.Licensing.Client --acquire-floating > license.txt #is this accessible in a env variable? - PARSEDFILE=$(grep -oP '\".*?\"' < license.txt | tr -d '"') + PARSEDFILE=$(grep -oE '\".*?\"' < license.txt | tr -d '"') export FLOATING_LICENSE FLOATING_LICENSE=$(sed -n 2p <<< "$PARSEDFILE") FLOATING_LICENSE_TIMEOUT=$(sed -n 4p <<< "$PARSEDFILE") From b732f729398521299d13957ad10b3e99f1778c27 Mon Sep 17 00:00:00 2001 From: simensan Date: Mon, 18 Sep 2023 10:56:20 +0200 Subject: [PATCH 04/12] Debug output for license.txt --- dist/platforms/mac/steps/activate.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/dist/platforms/mac/steps/activate.sh b/dist/platforms/mac/steps/activate.sh index d660c0833..41c44c1c1 100755 --- a/dist/platforms/mac/steps/activate.sh +++ b/dist/platforms/mac/steps/activate.sh @@ -13,7 +13,9 @@ if [[ -n "$UNITY_LICENSING_SERVER" ]]; then echo "Adding licensing server config" /Applications/Unity/Hub/Editor/$UNITY_VERSION/Unity.app/Contents/Frameworks/UnityLicensingClient.app/Contents/MacOS/Unity.Licensing.Client --acquire-floating > license.txt #is this accessible in a env variable? + cat license.txt PARSEDFILE=$(grep -oE '\".*?\"' < license.txt | tr -d '"') + grep -oE '\".*?\"' < license.txt export FLOATING_LICENSE FLOATING_LICENSE=$(sed -n 2p <<< "$PARSEDFILE") FLOATING_LICENSE_TIMEOUT=$(sed -n 4p <<< "$PARSEDFILE") From 013aae0cb26007d4feec4bd6a995dd1ab32a1c39 Mon Sep 17 00:00:00 2001 From: simensan Date: Mon, 18 Sep 2023 12:01:44 +0200 Subject: [PATCH 05/12] Copy over licensing server config to correct directory --- dist/platforms/mac/steps/activate.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dist/platforms/mac/steps/activate.sh b/dist/platforms/mac/steps/activate.sh index 41c44c1c1..64a18d209 100755 --- a/dist/platforms/mac/steps/activate.sh +++ b/dist/platforms/mac/steps/activate.sh @@ -11,7 +11,8 @@ if [[ -n "$UNITY_LICENSING_SERVER" ]]; then # Custom Unity License Server # echo "Adding licensing server config" - + cat "$ACTION_FOLDER/services-config.json" + cp "$ACTION_FOLDER/services-config.json" "/Library/Application Support/Unity/config/services-config.json" /Applications/Unity/Hub/Editor/$UNITY_VERSION/Unity.app/Contents/Frameworks/UnityLicensingClient.app/Contents/MacOS/Unity.Licensing.Client --acquire-floating > license.txt #is this accessible in a env variable? cat license.txt PARSEDFILE=$(grep -oE '\".*?\"' < license.txt | tr -d '"') From 851550c505a9e5e15085d284bc1728777fe40b25 Mon Sep 17 00:00:00 2001 From: simensan Date: Mon, 18 Sep 2023 12:06:54 +0200 Subject: [PATCH 06/12] Wrong directory for config --- dist/platforms/mac/steps/activate.sh | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/dist/platforms/mac/steps/activate.sh b/dist/platforms/mac/steps/activate.sh index 64a18d209..f50da3999 100755 --- a/dist/platforms/mac/steps/activate.sh +++ b/dist/platforms/mac/steps/activate.sh @@ -11,8 +11,11 @@ if [[ -n "$UNITY_LICENSING_SERVER" ]]; then # Custom Unity License Server # echo "Adding licensing server config" - cat "$ACTION_FOLDER/services-config.json" - cp "$ACTION_FOLDER/services-config.json" "/Library/Application Support/Unity/config/services-config.json" + pushd "$ACTION_FOLDER" + ls + popd + cat "$ACTION_FOLDER/unity-config/services-config.json" + cp "$ACTION_FOLDER//unity-config/services-config.json" "/Library/Application Support/Unity/config/services-config.json" /Applications/Unity/Hub/Editor/$UNITY_VERSION/Unity.app/Contents/Frameworks/UnityLicensingClient.app/Contents/MacOS/Unity.Licensing.Client --acquire-floating > license.txt #is this accessible in a env variable? cat license.txt PARSEDFILE=$(grep -oE '\".*?\"' < license.txt | tr -d '"') From e20eff800d8d79713916fb10d5284526fa30a988 Mon Sep 17 00:00:00 2001 From: simensan Date: Mon, 18 Sep 2023 12:20:35 +0200 Subject: [PATCH 07/12] Tweaks to mac build Create unity config dir if it doesnt exist Remove username password from build script on mac --- dist/platforms/mac/steps/activate.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dist/platforms/mac/steps/activate.sh b/dist/platforms/mac/steps/activate.sh index f50da3999..51f23d876 100755 --- a/dist/platforms/mac/steps/activate.sh +++ b/dist/platforms/mac/steps/activate.sh @@ -15,7 +15,8 @@ if [[ -n "$UNITY_LICENSING_SERVER" ]]; then ls popd cat "$ACTION_FOLDER/unity-config/services-config.json" - cp "$ACTION_FOLDER//unity-config/services-config.json" "/Library/Application Support/Unity/config/services-config.json" + mkdir -p "/Library/Application Support/Unity/config/" + cp "$ACTION_FOLDER/unity-config/services-config.json" "/Library/Application Support/Unity/config/services-config.json" /Applications/Unity/Hub/Editor/$UNITY_VERSION/Unity.app/Contents/Frameworks/UnityLicensingClient.app/Contents/MacOS/Unity.Licensing.Client --acquire-floating > license.txt #is this accessible in a env variable? cat license.txt PARSEDFILE=$(grep -oE '\".*?\"' < license.txt | tr -d '"') From 805125f3204944afef5bd6c9f3274dd7b3e17cfd Mon Sep 17 00:00:00 2001 From: simensan Date: Mon, 18 Sep 2023 12:33:23 +0200 Subject: [PATCH 08/12] Debug output --- dist/platforms/mac/steps/build.sh | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/dist/platforms/mac/steps/build.sh b/dist/platforms/mac/steps/build.sh index 8fd98f693..baee4ae51 100755 --- a/dist/platforms/mac/steps/build.sh +++ b/dist/platforms/mac/steps/build.sh @@ -127,13 +127,32 @@ echo "" # Reference: https://docs.unity3d.com/2019.3/Documentation/Manual/CommandLineArguments.html +cat << UnityString +/Applications/Unity/Hub/Editor/$UNITY_VERSION/Unity.app/Contents/MacOS/Unity \ + -logFile - \ + -quit \ + -customBuildName "$BUILD_NAME" \ + -projectPath "$UNITY_PROJECT_PATH" \ + -buildTarget "$BUILD_TARGET" \ + -customBuildTarget "$BUILD_TARGET" \ + -customBuildPath "$CUSTOM_BUILD_PATH" \ + -executeMethod "$BUILD_METHOD" \ + -buildVersion "$VERSION" \ + -androidVersionCode "$ANDROID_VERSION_CODE" \ + -androidKeystoreName "$ANDROID_KEYSTORE_NAME" \ + -androidKeystorePass "$ANDROID_KEYSTORE_PASS" \ + -androidKeyaliasName "$ANDROID_KEYALIAS_NAME" \ + -androidKeyaliasPass "$ANDROID_KEYALIAS_PASS" \ + -androidTargetSdkVersion "$ANDROID_TARGET_SDK_VERSION" \ + -androidExportType "$ANDROID_EXPORT_TYPE" \ + -androidSymbolType "$ANDROID_SYMBOL_TYPE" \ + $CUSTOM_PARAMETERS" +UnityString /Applications/Unity/Hub/Editor/$UNITY_VERSION/Unity.app/Contents/MacOS/Unity \ -logFile - \ -quit \ -batchmode \ -nographics \ - -username "$UNITY_EMAIL" \ - -password "$UNITY_PASSWORD" \ -customBuildName "$BUILD_NAME" \ -projectPath "$UNITY_PROJECT_PATH" \ -buildTarget "$BUILD_TARGET" \ From acfb318a4795b60eb48edf7777bcfd50d21187f4 Mon Sep 17 00:00:00 2001 From: Simen Sandvaer Date: Tue, 19 Sep 2023 19:50:03 +0200 Subject: [PATCH 09/12] Remove debug strings --- dist/platforms/mac/steps/activate.sh | 6 +----- dist/platforms/mac/steps/build.sh | 21 --------------------- 2 files changed, 1 insertion(+), 26 deletions(-) diff --git a/dist/platforms/mac/steps/activate.sh b/dist/platforms/mac/steps/activate.sh index 51f23d876..ee9953e70 100755 --- a/dist/platforms/mac/steps/activate.sh +++ b/dist/platforms/mac/steps/activate.sh @@ -11,14 +11,10 @@ if [[ -n "$UNITY_LICENSING_SERVER" ]]; then # Custom Unity License Server # echo "Adding licensing server config" - pushd "$ACTION_FOLDER" - ls - popd cat "$ACTION_FOLDER/unity-config/services-config.json" mkdir -p "/Library/Application Support/Unity/config/" cp "$ACTION_FOLDER/unity-config/services-config.json" "/Library/Application Support/Unity/config/services-config.json" - /Applications/Unity/Hub/Editor/$UNITY_VERSION/Unity.app/Contents/Frameworks/UnityLicensingClient.app/Contents/MacOS/Unity.Licensing.Client --acquire-floating > license.txt #is this accessible in a env variable? - cat license.txt + /Applications/Unity/Hub/Editor/$UNITY_VERSION/Unity.app/Contents/Frameworks/UnityLicensingClient.app/Contents/MacOS/Unity.Licensing.Client --acquire-floating > license.txt PARSEDFILE=$(grep -oE '\".*?\"' < license.txt | tr -d '"') grep -oE '\".*?\"' < license.txt export FLOATING_LICENSE diff --git a/dist/platforms/mac/steps/build.sh b/dist/platforms/mac/steps/build.sh index baee4ae51..507270592 100755 --- a/dist/platforms/mac/steps/build.sh +++ b/dist/platforms/mac/steps/build.sh @@ -127,27 +127,6 @@ echo "" # Reference: https://docs.unity3d.com/2019.3/Documentation/Manual/CommandLineArguments.html -cat << UnityString -/Applications/Unity/Hub/Editor/$UNITY_VERSION/Unity.app/Contents/MacOS/Unity \ - -logFile - \ - -quit \ - -customBuildName "$BUILD_NAME" \ - -projectPath "$UNITY_PROJECT_PATH" \ - -buildTarget "$BUILD_TARGET" \ - -customBuildTarget "$BUILD_TARGET" \ - -customBuildPath "$CUSTOM_BUILD_PATH" \ - -executeMethod "$BUILD_METHOD" \ - -buildVersion "$VERSION" \ - -androidVersionCode "$ANDROID_VERSION_CODE" \ - -androidKeystoreName "$ANDROID_KEYSTORE_NAME" \ - -androidKeystorePass "$ANDROID_KEYSTORE_PASS" \ - -androidKeyaliasName "$ANDROID_KEYALIAS_NAME" \ - -androidKeyaliasPass "$ANDROID_KEYALIAS_PASS" \ - -androidTargetSdkVersion "$ANDROID_TARGET_SDK_VERSION" \ - -androidExportType "$ANDROID_EXPORT_TYPE" \ - -androidSymbolType "$ANDROID_SYMBOL_TYPE" \ - $CUSTOM_PARAMETERS" -UnityString /Applications/Unity/Hub/Editor/$UNITY_VERSION/Unity.app/Contents/MacOS/Unity \ -logFile - \ -quit \ From cfe4a6236a9b9a83b0fb50de1323c69d6fcfecd1 Mon Sep 17 00:00:00 2001 From: Simen Sandvaer Date: Tue, 19 Sep 2023 20:00:29 +0200 Subject: [PATCH 10/12] Remove cat of config --- dist/platforms/mac/steps/activate.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/dist/platforms/mac/steps/activate.sh b/dist/platforms/mac/steps/activate.sh index ee9953e70..0451902b6 100755 --- a/dist/platforms/mac/steps/activate.sh +++ b/dist/platforms/mac/steps/activate.sh @@ -11,7 +11,6 @@ if [[ -n "$UNITY_LICENSING_SERVER" ]]; then # Custom Unity License Server # echo "Adding licensing server config" - cat "$ACTION_FOLDER/unity-config/services-config.json" mkdir -p "/Library/Application Support/Unity/config/" cp "$ACTION_FOLDER/unity-config/services-config.json" "/Library/Application Support/Unity/config/services-config.json" /Applications/Unity/Hub/Editor/$UNITY_VERSION/Unity.app/Contents/Frameworks/UnityLicensingClient.app/Contents/MacOS/Unity.Licensing.Client --acquire-floating > license.txt From 3bf512a9a60335c8e84c74a76eadb4d50a366ed3 Mon Sep 17 00:00:00 2001 From: Gabriel Le Breton Date: Tue, 19 Sep 2023 14:28:29 -0400 Subject: [PATCH 11/12] Fix indentation and slightly improve readability in activate.sh --- dist/platforms/mac/steps/activate.sh | 33 +++++++++++++++------------- 1 file changed, 18 insertions(+), 15 deletions(-) diff --git a/dist/platforms/mac/steps/activate.sh b/dist/platforms/mac/steps/activate.sh index 0451902b6..45b6f87ba 100755 --- a/dist/platforms/mac/steps/activate.sh +++ b/dist/platforms/mac/steps/activate.sh @@ -7,22 +7,25 @@ pushd "$ACTIVATE_LICENSE_PATH" echo "Requesting activation" if [[ -n "$UNITY_LICENSING_SERVER" ]]; then - # - # Custom Unity License Server - # - echo "Adding licensing server config" - mkdir -p "/Library/Application Support/Unity/config/" - cp "$ACTION_FOLDER/unity-config/services-config.json" "/Library/Application Support/Unity/config/services-config.json" - /Applications/Unity/Hub/Editor/$UNITY_VERSION/Unity.app/Contents/Frameworks/UnityLicensingClient.app/Contents/MacOS/Unity.Licensing.Client --acquire-floating > license.txt - PARSEDFILE=$(grep -oE '\".*?\"' < license.txt | tr -d '"') - grep -oE '\".*?\"' < license.txt - export FLOATING_LICENSE - FLOATING_LICENSE=$(sed -n 2p <<< "$PARSEDFILE") - FLOATING_LICENSE_TIMEOUT=$(sed -n 4p <<< "$PARSEDFILE") + # + # Custom Unity License Server + # + echo "Adding licensing server config" + mkdir -p "/Library/Application Support/Unity/config/" + cp \ + "$ACTION_FOLDER/unity-config/services-config.json" \ + "/Library/Application Support/Unity/config/services-config.json" + /Applications/Unity/Hub/Editor/$UNITY_VERSION/Unity.app/Contents/Frameworks/UnityLicensingClient.app/Contents/MacOS/Unity.Licensing.Client \ + --acquire-floating > license.txt + PARSEDFILE=$(grep -oE '\".*?\"' < license.txt | tr -d '"') + grep -oE '\".*?\"' < license.txt + export FLOATING_LICENSE + FLOATING_LICENSE=$(sed -n 2p <<< "$PARSEDFILE") + FLOATING_LICENSE_TIMEOUT=$(sed -n 4p <<< "$PARSEDFILE") - echo "Acquired floating license: \"$FLOATING_LICENSE\" with timeout $FLOATING_LICENSE_TIMEOUT" - # Store the exit code from the verify command - UNITY_EXIT_CODE=$? + echo "Acquired floating license: \"$FLOATING_LICENSE\" with timeout $FLOATING_LICENSE_TIMEOUT" + # Store the exit code from the verify command + UNITY_EXIT_CODE=$? else # Activate license /Applications/Unity/Hub/Editor/$UNITY_VERSION/Unity.app/Contents/MacOS/Unity \ From b1ead0cab55a535c5b0ddb3c40b73a4d0a5d9fbc Mon Sep 17 00:00:00 2001 From: Simen Sandvaer Date: Wed, 20 Sep 2023 19:47:02 +0200 Subject: [PATCH 12/12] Save exit code from Unity.Licensing.Client and only parse license if succesful --- dist/platforms/mac/steps/activate.sh | 17 +++++++++-------- dist/platforms/ubuntu/steps/activate.sh | 16 +++++++++------- 2 files changed, 18 insertions(+), 15 deletions(-) diff --git a/dist/platforms/mac/steps/activate.sh b/dist/platforms/mac/steps/activate.sh index 45b6f87ba..b43b0ddb7 100755 --- a/dist/platforms/mac/steps/activate.sh +++ b/dist/platforms/mac/steps/activate.sh @@ -17,15 +17,16 @@ if [[ -n "$UNITY_LICENSING_SERVER" ]]; then "/Library/Application Support/Unity/config/services-config.json" /Applications/Unity/Hub/Editor/$UNITY_VERSION/Unity.app/Contents/Frameworks/UnityLicensingClient.app/Contents/MacOS/Unity.Licensing.Client \ --acquire-floating > license.txt - PARSEDFILE=$(grep -oE '\".*?\"' < license.txt | tr -d '"') - grep -oE '\".*?\"' < license.txt - export FLOATING_LICENSE - FLOATING_LICENSE=$(sed -n 2p <<< "$PARSEDFILE") - FLOATING_LICENSE_TIMEOUT=$(sed -n 4p <<< "$PARSEDFILE") - - echo "Acquired floating license: \"$FLOATING_LICENSE\" with timeout $FLOATING_LICENSE_TIMEOUT" - # Store the exit code from the verify command UNITY_EXIT_CODE=$? + + if [ $UNITY_EXIT_CODE -eq 0 ]; then + PARSEDFILE=$(grep -oE '\".*?\"' < license.txt | tr -d '"') + export FLOATING_LICENSE + FLOATING_LICENSE=$(sed -n 2p <<< "$PARSEDFILE") + FLOATING_LICENSE_TIMEOUT=$(sed -n 4p <<< "$PARSEDFILE") + + echo "Acquired floating license: \"$FLOATING_LICENSE\" with timeout $FLOATING_LICENSE_TIMEOUT" + fi else # Activate license /Applications/Unity/Hub/Editor/$UNITY_VERSION/Unity.app/Contents/MacOS/Unity \ diff --git a/dist/platforms/ubuntu/steps/activate.sh b/dist/platforms/ubuntu/steps/activate.sh index 81eb2ffca..87e578527 100755 --- a/dist/platforms/ubuntu/steps/activate.sh +++ b/dist/platforms/ubuntu/steps/activate.sh @@ -81,14 +81,16 @@ elif [[ -n "$UNITY_LICENSING_SERVER" ]]; then echo "Adding licensing server config" /opt/unity/Editor/Data/Resources/Licensing/Client/Unity.Licensing.Client --acquire-floating > license.txt #is this accessible in a env variable? - PARSEDFILE=$(grep -oP '\".*?\"' < license.txt | tr -d '"') - export FLOATING_LICENSE - FLOATING_LICENSE=$(sed -n 2p <<< "$PARSEDFILE") - FLOATING_LICENSE_TIMEOUT=$(sed -n 4p <<< "$PARSEDFILE") - - echo "Acquired floating license: \"$FLOATING_LICENSE\" with timeout $FLOATING_LICENSE_TIMEOUT" - # Store the exit code from the verify command UNITY_EXIT_CODE=$? + + if [ $UNITY_EXIT_CODE -eq 0 ]; then + PARSEDFILE=$(grep -oP '\".*?\"' < license.txt | tr -d '"') + export FLOATING_LICENSE + FLOATING_LICENSE=$(sed -n 2p <<< "$PARSEDFILE") + FLOATING_LICENSE_TIMEOUT=$(sed -n 4p <<< "$PARSEDFILE") + + echo "Acquired floating license: \"$FLOATING_LICENSE\" with timeout $FLOATING_LICENSE_TIMEOUT" + fi else # # NO LICENSE ACTIVATION STRATEGY MATCHED