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:
Gaeel Bradshaw-Rodriguez
2021-05-02 01:23:15 +02:00
committed by GitHub
parent a1f68ab26c
commit e31af20466
10 changed files with 532 additions and 493 deletions

View File

@@ -10,6 +10,7 @@ export const mockGetFromUser = jest.fn().mockResolvedValue({
buildMethod: undefined,
buildVersion: '1.3.37',
customParameters: '',
chownFilesTo: '',
});
export default {

View File

@@ -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,

View File

@@ -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,

View File

@@ -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 \

View File

@@ -85,6 +85,10 @@ class Input {
return core.getInput('customParameters') || '';
}
static get chownFilesTo() {
return core.getInput('chownFilesTo') || '';
}
static get remoteBuildCluster() {
return core.getInput('remoteBuildCluster') || '';
}

View File

@@ -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,