mirror of
https://github.com/game-ci/unity-builder.git
synced 2025-07-04 12:25:19 -04:00
Chown files to a custom user after building (fix file ownership) (#250)
* Chown files to a custom user after building * Better describe `chownFilesTo` input As suggested by @webbertakken: https://github.com/game-ci/unity-builder/pull/250#discussion_r624575666 Co-authored-by: Webber Takken <webber@takken.io> * Simplify chown step in `build.sh` Co-authored-by: Webber Takken <webber@takken.io> Co-authored-by: Webber Takken <webber@takken.io>
This commit is contained in:
parent
a1f68ab26c
commit
e31af20466
@ -106,6 +106,10 @@ inputs:
|
||||
|
||||
Parameters must start with a hyphen (-) and may be followed by a value (without hyphen).
|
||||
Parameters without a value will be considered booleans (with a value of true).
|
||||
chownFilesTo:
|
||||
required: false
|
||||
default: ''
|
||||
description: 'User and optionally group (user or user:group or uid:gid) to give ownership of the resulting build artifacts'
|
||||
allowDirtyBuild:
|
||||
required: false
|
||||
default: ''
|
||||
|
BIN
dist/index.js
generated
vendored
BIN
dist/index.js
generated
vendored
Binary file not shown.
BIN
dist/index.js.map
generated
vendored
BIN
dist/index.js.map
generated
vendored
Binary file not shown.
6
dist/steps/build.sh
vendored
6
dist/steps/build.sh
vendored
@ -143,6 +143,12 @@ if [[ "$BUILD_TARGET" == "StandaloneOSX" ]]; then
|
||||
chmod +x $ADD_PERMISSIONS_PATH
|
||||
fi
|
||||
|
||||
|
||||
if [[ -n "$CHOWN_FILES_TO" ]]; then
|
||||
chown -R $CHOWN_FILES_TO $BUILD_PATH_FULL
|
||||
chown -R $CHOWN_FILES_TO $UNITY_PROJECT_PATH
|
||||
fi
|
||||
|
||||
#
|
||||
# Results
|
||||
#
|
||||
|
@ -10,6 +10,7 @@ export const mockGetFromUser = jest.fn().mockResolvedValue({
|
||||
buildMethod: undefined,
|
||||
buildVersion: '1.3.37',
|
||||
customParameters: '',
|
||||
chownFilesTo: '',
|
||||
});
|
||||
|
||||
export default {
|
||||
|
@ -149,6 +149,10 @@ class AWS {
|
||||
name: 'CUSTOM_PARAMETERS',
|
||||
value: buildParameters.customParameters,
|
||||
},
|
||||
{
|
||||
name: 'CHOWN_FILES_TO',
|
||||
value: buildParameters.chownFilesTo,
|
||||
},
|
||||
{
|
||||
name: 'BUILD_TARGET',
|
||||
value: buildParameters.platform,
|
||||
|
@ -33,6 +33,7 @@ class BuildParameters {
|
||||
androidKeyaliasName: Input.androidKeyaliasName,
|
||||
androidKeyaliasPass: Input.androidKeyaliasPass,
|
||||
customParameters: Input.customParameters,
|
||||
chownFilesTo: Input.chownFilesTo,
|
||||
remoteBuildCluster: Input.remoteBuildCluster,
|
||||
awsStackName: Input.awsStackName,
|
||||
kubeConfig: Input.kubeConfig,
|
||||
|
@ -36,6 +36,7 @@ class Docker {
|
||||
androidKeyaliasName,
|
||||
androidKeyaliasPass,
|
||||
customParameters,
|
||||
chownFilesTo,
|
||||
} = parameters;
|
||||
|
||||
const command = `docker run \
|
||||
@ -62,6 +63,7 @@ class Docker {
|
||||
--env ANDROID_KEYALIAS_NAME="${androidKeyaliasName}" \
|
||||
--env ANDROID_KEYALIAS_PASS="${androidKeyaliasPass}" \
|
||||
--env CUSTOM_PARAMETERS="${customParameters}" \
|
||||
--env CHOWN_FILES_TO="${chownFilesTo}" \
|
||||
--env GITHUB_REF \
|
||||
--env GITHUB_SHA \
|
||||
--env GITHUB_REPOSITORY \
|
||||
|
@ -85,6 +85,10 @@ class Input {
|
||||
return core.getInput('customParameters') || '';
|
||||
}
|
||||
|
||||
static get chownFilesTo() {
|
||||
return core.getInput('chownFilesTo') || '';
|
||||
}
|
||||
|
||||
static get remoteBuildCluster() {
|
||||
return core.getInput('remoteBuildCluster') || '';
|
||||
}
|
||||
|
@ -222,6 +222,10 @@ class Kubernetes {
|
||||
name: 'CUSTOM_PARAMETERS',
|
||||
value: this.buildParameters.customParameters,
|
||||
},
|
||||
{
|
||||
name: 'CHOWN_FILES_TO',
|
||||
value: this.buildParameters.chownFilesTo,
|
||||
},
|
||||
{
|
||||
name: 'BUILD_TARGET',
|
||||
value: this.buildParameters.platform,
|
||||
|
Loading…
Reference in New Issue
Block a user