feat: set activate command to always return exit code 0

This change will allow pipelines with shell that exit on error
to run the activate script.
pull/371/head
Eric Ribeiro 2022-03-31 11:02:33 -07:00
parent ca9d445c3c
commit c62f2498b6
No known key found for this signature in database
GPG Key ID: EAC31B55CD1B46F5
3 changed files with 11 additions and 20 deletions

15
dist/index.js vendored
View File

@ -48,7 +48,7 @@ function runMain() {
try { try {
model_1.Action.checkCompatibility(); model_1.Action.checkCompatibility();
model_1.Cache.verify(); model_1.Cache.verify();
const { dockerfile, workspace, actionFolder } = model_1.Action; const { workspace, actionFolder } = model_1.Action;
const buildParameters = yield model_1.BuildParameters.create(); const buildParameters = yield model_1.BuildParameters.create();
const baseImage = new model_1.ImageTag(buildParameters); const baseImage = new model_1.ImageTag(buildParameters);
if (buildParameters.cloudRunnerCluster && if (buildParameters.cloudRunnerCluster &&
@ -117,19 +117,6 @@ class Action {
static get actionFolder() { static get actionFolder() {
return `${Action.rootFolder}/dist`; return `${Action.rootFolder}/dist`;
} }
static get dockerfile() {
const currentPlatform = process.platform;
switch (currentPlatform) {
case 'linux':
return `${Action.actionFolder}/platforms/ubuntu/Dockerfile`;
case 'win32':
return `${Action.actionFolder}/platforms/windows/Dockerfile`;
case 'darwin':
return 'unused'; //Mac doesn't use a container
default:
throw new Error(`No Dockerfile for currently unsupported platform: ${currentPlatform}`);
}
}
static get workspace() { static get workspace() {
return process.env.GITHUB_WORKSPACE; return process.env.GITHUB_WORKSPACE;
} }

2
dist/index.js.map vendored

File diff suppressed because one or more lines are too long

View File

@ -28,10 +28,14 @@ if [[ -n "$UNITY_LICENSE" ]] || [[ -n "$UNITY_LICENSE_FILE" ]]; then
fi fi
# Activate license # Activate license
ACTIVATION_OUTPUT=$(unity-editor \ # Set to always return true, otherwise the shell will exit on pipelines set to fail on error
-logFile /dev/stdout \ ACTIVATION_OUTPUT=UnityActivation.log
unity-editor \
-logFile "$ACTIVATION_OUTPUT" \
-quit \ -quit \
-manualLicenseFile $FILE_PATH) -manualLicenseFile $FILE_PATH \
|| true
# Store the exit code from the verify command # Store the exit code from the verify command
UNITY_EXIT_CODE=$? UNITY_EXIT_CODE=$?
@ -43,7 +47,7 @@ if [[ -n "$UNITY_LICENSE" ]] || [[ -n "$UNITY_LICENSE_FILE" ]]; then
# #
# "LICENSE SYSTEM [2020120 18:51:20] Next license update check is after 2019-11-25T18:23:38" # "LICENSE SYSTEM [2020120 18:51:20] Next license update check is after 2019-11-25T18:23:38"
# #
ACTIVATION_SUCCESSFUL=$(echo $ACTIVATION_OUTPUT | grep 'Next license update check is after' | wc -l) ACTIVATION_SUCCESSFUL=$(cat $ACTIVATION_OUTPUT | grep 'Next license update check is after' | wc -l)
# Set exit code to 0 if activation was successful # Set exit code to 0 if activation was successful
if [[ $ACTIVATION_SUCCESSFUL -eq 1 ]]; then if [[ $ACTIVATION_SUCCESSFUL -eq 1 ]]; then