mirror of
https://github.com/game-ci/unity-builder.git
synced 2026-02-02 14:49:08 +08:00
Compare commits
6 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0c82a58873 | ||
|
|
1d4ee0697f | ||
|
|
3a2abf9037 | ||
|
|
cfdebb67c1 | ||
|
|
ab64768ceb | ||
|
|
00fa0d3772 |
@@ -14,7 +14,8 @@
|
|||||||
"env": {
|
"env": {
|
||||||
"node": true,
|
"node": true,
|
||||||
"es6": true,
|
"es6": true,
|
||||||
"jest/globals": true
|
"jest/globals": true,
|
||||||
|
"es2020": true
|
||||||
},
|
},
|
||||||
"rules": {
|
"rules": {
|
||||||
// Error out for code formatting errors
|
// Error out for code formatting errors
|
||||||
|
|||||||
@@ -66,10 +66,6 @@ namespace UnityBuilderAction
|
|||||||
var buildProfile = AssetDatabase.LoadAssetAtPath<BuildProfile>(buildProfilePath)
|
var buildProfile = AssetDatabase.LoadAssetAtPath<BuildProfile>(buildProfilePath)
|
||||||
?? throw new Exception("Build profile file not found at path: " + buildProfilePath);
|
?? throw new Exception("Build profile file not found at path: " + buildProfilePath);
|
||||||
|
|
||||||
#if !BUILD_PROFILE_LOADED
|
|
||||||
throw new Exception("Build profile's define symbol not present before script execution; shouldn't happen");
|
|
||||||
#endif // BUILD_PROFILE_LOADED
|
|
||||||
|
|
||||||
// no need to set active profile, as already set by `-activeBuildProfile` CLI argument
|
// no need to set active profile, as already set by `-activeBuildProfile` CLI argument
|
||||||
// BuildProfile.SetActiveBuildProfile(buildProfile);
|
// BuildProfile.SetActiveBuildProfile(buildProfile);
|
||||||
Debug.Log($"build profile: {buildProfile.name}");
|
Debug.Log($"build profile: {buildProfile.name}");
|
||||||
|
|||||||
@@ -115,6 +115,7 @@ namespace UnityBuilderAction.Input
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if UNITY_6000_0_OR_NEWER
|
||||||
private static void SetDebugSymbols(string enumValueName)
|
private static void SetDebugSymbols(string enumValueName)
|
||||||
{
|
{
|
||||||
// UnityEditor.Android.UserBuildSettings and Unity.Android.Types.DebugSymbolLevel are part of the Unity Android module.
|
// UnityEditor.Android.UserBuildSettings and Unity.Android.Types.DebugSymbolLevel are part of the Unity Android module.
|
||||||
@@ -144,5 +145,6 @@ namespace UnityBuilderAction.Input
|
|||||||
}
|
}
|
||||||
levelProp.SetValue(null, enumValue);
|
levelProp.SetValue(null, enumValue);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
12
dist/index.js
generated
vendored
12
dist/index.js
generated
vendored
@@ -331,6 +331,7 @@ class BuildParameters {
|
|||||||
kubeConfig: cloud_runner_options_1.default.kubeConfig,
|
kubeConfig: cloud_runner_options_1.default.kubeConfig,
|
||||||
containerMemory: cloud_runner_options_1.default.containerMemory,
|
containerMemory: cloud_runner_options_1.default.containerMemory,
|
||||||
containerCpu: cloud_runner_options_1.default.containerCpu,
|
containerCpu: cloud_runner_options_1.default.containerCpu,
|
||||||
|
containerNamespace: cloud_runner_options_1.default.containerNamespace,
|
||||||
kubeVolumeSize: cloud_runner_options_1.default.kubeVolumeSize,
|
kubeVolumeSize: cloud_runner_options_1.default.kubeVolumeSize,
|
||||||
kubeVolume: cloud_runner_options_1.default.kubeVolume,
|
kubeVolume: cloud_runner_options_1.default.kubeVolume,
|
||||||
postBuildContainerHooks: cloud_runner_options_1.default.postBuildContainerHooks,
|
postBuildContainerHooks: cloud_runner_options_1.default.postBuildContainerHooks,
|
||||||
@@ -1220,6 +1221,9 @@ class CloudRunnerOptions {
|
|||||||
static get containerMemory() {
|
static get containerMemory() {
|
||||||
return CloudRunnerOptions.getInput('containerMemory') || `3072`;
|
return CloudRunnerOptions.getInput('containerMemory') || `3072`;
|
||||||
}
|
}
|
||||||
|
static get containerNamespace() {
|
||||||
|
return CloudRunnerOptions.getInput('containerNamespace') || `default`;
|
||||||
|
}
|
||||||
static get customJob() {
|
static get customJob() {
|
||||||
return CloudRunnerOptions.getInput('customJob') || '';
|
return CloudRunnerOptions.getInput('customJob') || '';
|
||||||
}
|
}
|
||||||
@@ -3372,7 +3376,6 @@ const remote_client_logger_1 = __nccwpck_require__(59412);
|
|||||||
const kubernetes_role_1 = __nccwpck_require__(88231);
|
const kubernetes_role_1 = __nccwpck_require__(88231);
|
||||||
const cloud_runner_system_1 = __nccwpck_require__(4197);
|
const cloud_runner_system_1 = __nccwpck_require__(4197);
|
||||||
class Kubernetes {
|
class Kubernetes {
|
||||||
// eslint-disable-next-line no-unused-vars
|
|
||||||
constructor(buildParameters) {
|
constructor(buildParameters) {
|
||||||
this.buildGuid = '';
|
this.buildGuid = '';
|
||||||
this.pvcName = '';
|
this.pvcName = '';
|
||||||
@@ -3390,7 +3393,7 @@ class Kubernetes {
|
|||||||
this.kubeClientApps = this.kubeConfig.makeApiClient(k8s.AppsV1Api);
|
this.kubeClientApps = this.kubeConfig.makeApiClient(k8s.AppsV1Api);
|
||||||
this.kubeClientBatch = this.kubeConfig.makeApiClient(k8s.BatchV1Api);
|
this.kubeClientBatch = this.kubeConfig.makeApiClient(k8s.BatchV1Api);
|
||||||
this.rbacAuthorizationV1Api = this.kubeConfig.makeApiClient(k8s.RbacAuthorizationV1Api);
|
this.rbacAuthorizationV1Api = this.kubeConfig.makeApiClient(k8s.RbacAuthorizationV1Api);
|
||||||
this.namespace = 'default';
|
this.namespace = buildParameters.containerNamespace ? buildParameters.containerNamespace : 'default';
|
||||||
cloud_runner_logger_1.default.log('Loaded default Kubernetes configuration for this environment');
|
cloud_runner_logger_1.default.log('Loaded default Kubernetes configuration for this environment');
|
||||||
}
|
}
|
||||||
async PushLogUpdate(logs) {
|
async PushLogUpdate(logs) {
|
||||||
@@ -4070,8 +4073,8 @@ class KubernetesTaskRunner {
|
|||||||
cloud_runner_logger_1.default.log(`Streaming logs from pod: ${podName} container: ${containerName} namespace: ${namespace} ${cloud_runner_1.default.buildParameters.kubeVolumeSize}/${cloud_runner_1.default.buildParameters.containerCpu}/${cloud_runner_1.default.buildParameters.containerMemory}`);
|
cloud_runner_logger_1.default.log(`Streaming logs from pod: ${podName} container: ${containerName} namespace: ${namespace} ${cloud_runner_1.default.buildParameters.kubeVolumeSize}/${cloud_runner_1.default.buildParameters.containerCpu}/${cloud_runner_1.default.buildParameters.containerMemory}`);
|
||||||
let extraFlags = ``;
|
let extraFlags = ``;
|
||||||
extraFlags += (await kubernetes_pods_1.default.IsPodRunning(podName, namespace, kubeClient))
|
extraFlags += (await kubernetes_pods_1.default.IsPodRunning(podName, namespace, kubeClient))
|
||||||
? ` -f -c ${containerName}`
|
? ` -f -c ${containerName} -n ${namespace}`
|
||||||
: ` --previous`;
|
: ` --previous -n ${namespace}`;
|
||||||
const callback = (outputChunk) => {
|
const callback = (outputChunk) => {
|
||||||
output += outputChunk;
|
output += outputChunk;
|
||||||
// split output chunk and handle per line
|
// split output chunk and handle per line
|
||||||
@@ -6111,6 +6114,7 @@ class Docker {
|
|||||||
--workdir c:${dockerWorkspacePath} \
|
--workdir c:${dockerWorkspacePath} \
|
||||||
--rm \
|
--rm \
|
||||||
${image_environment_factory_1.default.getEnvVarString(parameters)} \
|
${image_environment_factory_1.default.getEnvVarString(parameters)} \
|
||||||
|
--env BEE_CACHE_DIRECTORY=c:${dockerWorkspacePath}/Library/bee_cache \
|
||||||
--env GITHUB_WORKSPACE=c:${dockerWorkspacePath} \
|
--env GITHUB_WORKSPACE=c:${dockerWorkspacePath} \
|
||||||
${gitPrivateToken ? `--env GIT_PRIVATE_TOKEN="${gitPrivateToken}"` : ''} \
|
${gitPrivateToken ? `--env GIT_PRIVATE_TOKEN="${gitPrivateToken}"` : ''} \
|
||||||
--volume "${workspace}":"c:${dockerWorkspacePath}" \
|
--volume "${workspace}":"c:${dockerWorkspacePath}" \
|
||||||
|
|||||||
2
dist/index.js.map
generated
vendored
2
dist/index.js.map
generated
vendored
File diff suppressed because one or more lines are too long
74
dist/platforms/mac/steps/activate.sh
vendored
74
dist/platforms/mac/steps/activate.sh
vendored
@@ -4,21 +4,69 @@
|
|||||||
echo "Changing to \"$ACTIVATE_LICENSE_PATH\" directory."
|
echo "Changing to \"$ACTIVATE_LICENSE_PATH\" directory."
|
||||||
pushd "$ACTIVATE_LICENSE_PATH"
|
pushd "$ACTIVATE_LICENSE_PATH"
|
||||||
|
|
||||||
echo "Requesting activation"
|
if [[ -n "$UNITY_SERIAL" && -n "$UNITY_EMAIL" && -n "$UNITY_PASSWORD" ]]; then
|
||||||
|
#
|
||||||
|
# SERIAL LICENSE MODE
|
||||||
|
#
|
||||||
|
# This will activate unity, using the serial activation process.
|
||||||
|
#
|
||||||
|
|
||||||
# Activate license
|
echo "Requesting activation"
|
||||||
/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
|
# Activate license
|
||||||
UNITY_EXIT_CODE=$?
|
/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=$?
|
||||||
|
|
||||||
|
elif [[ -n "$UNITY_LICENSING_SERVER" ]]; then
|
||||||
|
#
|
||||||
|
# Custom Unity License Server
|
||||||
|
#
|
||||||
|
echo "Adding licensing server config"
|
||||||
|
mkdir -p "$UNITY_LICENSE_PATH/config/"
|
||||||
|
cp "$ACTION_FOLDER/unity-config/services-config.json" "$UNITY_LICENSE_PATH/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
|
||||||
|
|
||||||
|
# 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
|
||||||
|
#
|
||||||
|
# NO LICENSE ACTIVATION STRATEGY MATCHED
|
||||||
|
#
|
||||||
|
# This will exit since no activation strategies could be matched.
|
||||||
|
#
|
||||||
|
echo "License activation strategy could not be determined."
|
||||||
|
echo ""
|
||||||
|
echo "Visit https://game.ci/docs/github/activation for more"
|
||||||
|
echo "details on how to set up one of the possible activation strategies."
|
||||||
|
|
||||||
|
echo "::error ::No valid license activation strategy could be determined. Make sure to provide UNITY_EMAIL, UNITY_PASSWORD, and either a UNITY_SERIAL \
|
||||||
|
or UNITY_LICENSE. Otherwise please use UNITY_LICENSING_SERVER. See more info at https://game.ci/docs/github/activation"
|
||||||
|
|
||||||
|
# Immediately exit as no UNITY_EXIT_CODE can be derived.
|
||||||
|
exit 1;
|
||||||
|
|
||||||
|
fi
|
||||||
|
|
||||||
#
|
#
|
||||||
# Display information about the result
|
# Display information about the result
|
||||||
|
|||||||
2
dist/platforms/mac/steps/build.sh
vendored
2
dist/platforms/mac/steps/build.sh
vendored
@@ -149,8 +149,6 @@ echo ""
|
|||||||
$( [ "${MANUAL_EXIT}" == "true" ] || echo "-quit" ) \
|
$( [ "${MANUAL_EXIT}" == "true" ] || echo "-quit" ) \
|
||||||
-batchmode \
|
-batchmode \
|
||||||
$( [ "${ENABLE_GPU}" == "true" ] || echo "-nographics" ) \
|
$( [ "${ENABLE_GPU}" == "true" ] || echo "-nographics" ) \
|
||||||
-username "$UNITY_EMAIL" \
|
|
||||||
-password "$UNITY_PASSWORD" \
|
|
||||||
-customBuildName "$BUILD_NAME" \
|
-customBuildName "$BUILD_NAME" \
|
||||||
-projectPath "$UNITY_PROJECT_PATH" \
|
-projectPath "$UNITY_PROJECT_PATH" \
|
||||||
$( [ -z "$BUILD_PROFILE" ] && echo "-buildTarget $BUILD_TARGET") \
|
$( [ -z "$BUILD_PROFILE" ] && echo "-buildTarget $BUILD_TARGET") \
|
||||||
|
|||||||
32
dist/platforms/mac/steps/return_license.sh
vendored
32
dist/platforms/mac/steps/return_license.sh
vendored
@@ -4,15 +4,29 @@
|
|||||||
echo "Changing to \"$ACTIVATE_LICENSE_PATH\" directory."
|
echo "Changing to \"$ACTIVATE_LICENSE_PATH\" directory."
|
||||||
pushd "$ACTIVATE_LICENSE_PATH"
|
pushd "$ACTIVATE_LICENSE_PATH"
|
||||||
|
|
||||||
/Applications/Unity/Hub/Editor/$UNITY_VERSION/Unity.app/Contents/MacOS/Unity \
|
if [[ -n "$UNITY_LICENSING_SERVER" ]]; then
|
||||||
-logFile - \
|
#
|
||||||
-batchmode \
|
# Return any floating license used.
|
||||||
-nographics \
|
#
|
||||||
-quit \
|
echo "Returning floating license: \"$FLOATING_LICENSE\""
|
||||||
-username "$UNITY_EMAIL" \
|
/Applications/Unity/Hub/Editor/$UNITY_VERSION/Unity.app/Contents/Frameworks/UnityLicensingClient.app/Contents/MacOS/Unity.Licensing.Client \
|
||||||
-password "$UNITY_PASSWORD" \
|
--return-floating "$FLOATING_LICENSE"
|
||||||
-returnlicense \
|
elif [[ -n "$UNITY_SERIAL" ]]; then
|
||||||
-projectPath "$ACTIVATE_LICENSE_PATH"
|
#
|
||||||
|
# SERIAL LICENSE MODE
|
||||||
|
#
|
||||||
|
# This will return the license that is currently in use.
|
||||||
|
#
|
||||||
|
/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"
|
||||||
|
fi
|
||||||
|
|
||||||
# Return to previous working directory
|
# Return to previous working directory
|
||||||
popd
|
popd
|
||||||
|
|||||||
14
dist/platforms/ubuntu/steps/activate.sh
vendored
14
dist/platforms/ubuntu/steps/activate.sh
vendored
@@ -68,14 +68,18 @@ elif [[ -n "$UNITY_LICENSING_SERVER" ]]; then
|
|||||||
echo "Adding licensing server config"
|
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?
|
/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
|
# Store the exit code from the verify command
|
||||||
UNITY_EXIT_CODE=$?
|
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
|
else
|
||||||
#
|
#
|
||||||
# NO LICENSE ACTIVATION STRATEGY MATCHED
|
# NO LICENSE ACTIVATION STRATEGY MATCHED
|
||||||
|
|||||||
3
dist/platforms/windows/entrypoint.ps1
vendored
3
dist/platforms/windows/entrypoint.ps1
vendored
@@ -18,6 +18,9 @@ regsvr32 C:\ProgramData\Microsoft\VisualStudio\Setup\x64\Microsoft.VisualStudio.
|
|||||||
# Kill the regsvr process
|
# Kill the regsvr process
|
||||||
Get-Process -Name regsvr32 | ForEach-Object { Stop-Process -Id $_.Id -Force }
|
Get-Process -Name regsvr32 | ForEach-Object { Stop-Process -Id $_.Id -Force }
|
||||||
|
|
||||||
|
# Install Visual C++ 2013 Redistributables
|
||||||
|
. "c:\steps\install_vcredist13.ps1"
|
||||||
|
|
||||||
# Setup Git Credentials
|
# Setup Git Credentials
|
||||||
. "c:\steps\set_gitcredential.ps1"
|
. "c:\steps\set_gitcredential.ps1"
|
||||||
|
|
||||||
|
|||||||
11
dist/platforms/windows/install_vcredist13.ps1
vendored
Normal file
11
dist/platforms/windows/install_vcredist13.ps1
vendored
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
# For some reason, Unity is failing in github actions windows runners
|
||||||
|
# due to missing Visual C++ 2013 redistributables.
|
||||||
|
# This script downloads and installs the required redistributables.
|
||||||
|
Write-Output ""
|
||||||
|
Write-Output "#########################################################"
|
||||||
|
Write-Output "# Installing Visual C++ Redistributables (2013) #"
|
||||||
|
Write-Output "#########################################################"
|
||||||
|
Write-Output ""
|
||||||
|
|
||||||
|
|
||||||
|
choco install vcredist2013 -y --no-progress
|
||||||
@@ -59,6 +59,7 @@ class BuildParameters {
|
|||||||
public kubeConfig!: string;
|
public kubeConfig!: string;
|
||||||
public containerMemory!: string;
|
public containerMemory!: string;
|
||||||
public containerCpu!: string;
|
public containerCpu!: string;
|
||||||
|
public containerNamespace!: string;
|
||||||
public kubeVolumeSize!: string;
|
public kubeVolumeSize!: string;
|
||||||
public kubeVolume!: string;
|
public kubeVolume!: string;
|
||||||
public kubeStorageClass!: string;
|
public kubeStorageClass!: string;
|
||||||
@@ -187,6 +188,7 @@ class BuildParameters {
|
|||||||
kubeConfig: CloudRunnerOptions.kubeConfig,
|
kubeConfig: CloudRunnerOptions.kubeConfig,
|
||||||
containerMemory: CloudRunnerOptions.containerMemory,
|
containerMemory: CloudRunnerOptions.containerMemory,
|
||||||
containerCpu: CloudRunnerOptions.containerCpu,
|
containerCpu: CloudRunnerOptions.containerCpu,
|
||||||
|
containerNamespace: CloudRunnerOptions.containerNamespace,
|
||||||
kubeVolumeSize: CloudRunnerOptions.kubeVolumeSize,
|
kubeVolumeSize: CloudRunnerOptions.kubeVolumeSize,
|
||||||
kubeVolume: CloudRunnerOptions.kubeVolume,
|
kubeVolume: CloudRunnerOptions.kubeVolume,
|
||||||
postBuildContainerHooks: CloudRunnerOptions.postBuildContainerHooks,
|
postBuildContainerHooks: CloudRunnerOptions.postBuildContainerHooks,
|
||||||
|
|||||||
@@ -135,6 +135,10 @@ class CloudRunnerOptions {
|
|||||||
return CloudRunnerOptions.getInput('containerMemory') || `3072`;
|
return CloudRunnerOptions.getInput('containerMemory') || `3072`;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static get containerNamespace(): string {
|
||||||
|
return CloudRunnerOptions.getInput('containerNamespace') || `default`;
|
||||||
|
}
|
||||||
|
|
||||||
static get customJob(): string {
|
static get customJob(): string {
|
||||||
return CloudRunnerOptions.getInput('customJob') || '';
|
return CloudRunnerOptions.getInput('customJob') || '';
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -37,7 +37,6 @@ class Kubernetes implements ProviderInterface {
|
|||||||
public serviceAccountName: string = '';
|
public serviceAccountName: string = '';
|
||||||
public ip: string = '';
|
public ip: string = '';
|
||||||
|
|
||||||
// eslint-disable-next-line no-unused-vars
|
|
||||||
constructor(buildParameters: BuildParameters) {
|
constructor(buildParameters: BuildParameters) {
|
||||||
Kubernetes.Instance = this;
|
Kubernetes.Instance = this;
|
||||||
this.kubeConfig = new k8s.KubeConfig();
|
this.kubeConfig = new k8s.KubeConfig();
|
||||||
@@ -46,7 +45,7 @@ class Kubernetes implements ProviderInterface {
|
|||||||
this.kubeClientApps = this.kubeConfig.makeApiClient(k8s.AppsV1Api);
|
this.kubeClientApps = this.kubeConfig.makeApiClient(k8s.AppsV1Api);
|
||||||
this.kubeClientBatch = this.kubeConfig.makeApiClient(k8s.BatchV1Api);
|
this.kubeClientBatch = this.kubeConfig.makeApiClient(k8s.BatchV1Api);
|
||||||
this.rbacAuthorizationV1Api = this.kubeConfig.makeApiClient(k8s.RbacAuthorizationV1Api);
|
this.rbacAuthorizationV1Api = this.kubeConfig.makeApiClient(k8s.RbacAuthorizationV1Api);
|
||||||
this.namespace = 'default';
|
this.namespace = buildParameters.containerNamespace ? buildParameters.containerNamespace : 'default';
|
||||||
CloudRunnerLogger.log('Loaded default Kubernetes configuration for this environment');
|
CloudRunnerLogger.log('Loaded default Kubernetes configuration for this environment');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -30,8 +30,8 @@ class KubernetesTaskRunner {
|
|||||||
);
|
);
|
||||||
let extraFlags = ``;
|
let extraFlags = ``;
|
||||||
extraFlags += (await KubernetesPods.IsPodRunning(podName, namespace, kubeClient))
|
extraFlags += (await KubernetesPods.IsPodRunning(podName, namespace, kubeClient))
|
||||||
? ` -f -c ${containerName}`
|
? ` -f -c ${containerName} -n ${namespace}`
|
||||||
: ` --previous`;
|
: ` --previous -n ${namespace}`;
|
||||||
|
|
||||||
const callback = (outputChunk: string) => {
|
const callback = (outputChunk: string) => {
|
||||||
output += outputChunk;
|
output += outputChunk;
|
||||||
|
|||||||
@@ -17,6 +17,7 @@ describe('Cloud Runner Github Checks', () => {
|
|||||||
status: 200,
|
status: 200,
|
||||||
data: {},
|
data: {},
|
||||||
});
|
});
|
||||||
|
// eslint-disable-next-line unicorn/no-useless-undefined
|
||||||
jest.spyOn(GitHub as any, 'runUpdateAsyncChecksWorkflow').mockResolvedValue(undefined);
|
jest.spyOn(GitHub as any, 'runUpdateAsyncChecksWorkflow').mockResolvedValue(undefined);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -107,6 +107,7 @@ class Docker {
|
|||||||
--workdir c:${dockerWorkspacePath} \
|
--workdir c:${dockerWorkspacePath} \
|
||||||
--rm \
|
--rm \
|
||||||
${ImageEnvironmentFactory.getEnvVarString(parameters)} \
|
${ImageEnvironmentFactory.getEnvVarString(parameters)} \
|
||||||
|
--env BEE_CACHE_DIRECTORY=c:${dockerWorkspacePath}/Library/bee_cache \
|
||||||
--env GITHUB_WORKSPACE=c:${dockerWorkspacePath} \
|
--env GITHUB_WORKSPACE=c:${dockerWorkspacePath} \
|
||||||
${gitPrivateToken ? `--env GIT_PRIVATE_TOKEN="${gitPrivateToken}"` : ''} \
|
${gitPrivateToken ? `--env GIT_PRIVATE_TOKEN="${gitPrivateToken}"` : ''} \
|
||||||
--volume "${workspace}":"c:${dockerWorkspacePath}" \
|
--volume "${workspace}":"c:${dockerWorkspacePath}" \
|
||||||
|
|||||||
Reference in New Issue
Block a user