Merge branch 'upstream/stabilization/2106' into genewalt/gitflow_210628

This commit is contained in:
Gene Walters
2021-06-28 19:09:20 -07:00
18674 changed files with 87627 additions and 179297 deletions
+3 -7
View File
@@ -1,12 +1,8 @@
#
# All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
# its licensors.
# Copyright (c) Contributors to the Open 3D Engine Project
#
# SPDX-License-Identifier: Apache-2.0 OR MIT
#
# For complete copyright and license terms please see the LICENSE at the root of this
# distribution (the "License"). All use of this software is governed by the License,
# or, if provided, by the license below or the license accompanying this file. Do not
# remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#
import boto3
+3 -7
View File
@@ -1,12 +1,8 @@
#
# All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
# its licensors.
# Copyright (c) Contributors to the Open 3D Engine Project
#
# SPDX-License-Identifier: Apache-2.0 OR MIT
#
# For complete copyright and license terms please see the LICENSE at the root of this
# distribution (the "License"). All use of this software is governed by the License,
# or, if provided, by the license below or the license accompanying this file. Do not
# remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#
import os
+3 -7
View File
@@ -1,12 +1,8 @@
#
# All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
# its licensors.
# Copyright (c) Contributors to the Open 3D Engine Project
#
# SPDX-License-Identifier: Apache-2.0 OR MIT
#
# For complete copyright and license terms please see the LICENSE at the root of this
# distribution (the "License"). All use of this software is governed by the License,
# or, if provided, by the license below or the license accompanying this file. Do not
# remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#
'''
+69
View File
@@ -0,0 +1,69 @@
#
# Copyright (c) Contributors to the Open 3D Engine Project
#
# SPDX-License-Identifier: Apache-2.0 OR MIT
#
#
import argparse
import os
import pathlib
import shutil
import subprocess
import sys
def run_git_command(args, repo_root):
process = subprocess.run(['git', *args],
stdout=subprocess.PIPE,
stderr=subprocess.PIPE,
cwd=repo_root,
env=os.environ.copy(),
universal_newlines=True,
)
if process.returncode != 0:
print(
f'An error occurred while running a command\n'
f'Command: git {subprocess.list2cmdline(args)}\n'
f'Return Code: {process.returncode}\n'
f'Error: {process.stderr}',
file=sys.stderr
)
exit(1)
output = process.stdout.splitlines()
if not output:
print(f'No output received for command: git {subprocess.list2cmdline(args)}.')
output
return output[0].strip('"')
if __name__ == "__main__":
'''
Generates a build ID based on the state of the git repository. Will first attempt to use
existing environment variable (e.g. BRANCH_NAME, CHANGE_ID, CHANGE_DATE) before falling
back to running git commands directly
'''
repo_root = os.path.realpath(os.path.join(os.path.dirname(__file__), '..', '..'))
branch = os.environ.get('BRANCH_NAME')
if not branch:
branch = run_git_command(['rev-parse', '--abbrev-ref', 'HEAD'], repo_root)
branch = branch.replace('/', '-')
commit_hash = os.environ.get('CHANGE_ID')
if not commit_hash:
commit_hash = run_git_command(['rev-parse', 'HEAD'], repo_root)
commit_hash = commit_hash[0:9]
# include the commit date to allow some sensible way of sorting
commit_date = os.environ.get('CHANGE_DATE')
if not commit_date:
commit_date = run_git_command(['show', '-s', '--format=%cI', commit_hash], repo_root)
commit_date = commit_date[0:10]
print(f'{branch}/{commit_date}-{commit_hash}')
exit(0)
+3 -7
View File
@@ -1,12 +1,8 @@
#
# All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
# its licensors.
# Copyright (c) Contributors to the Open 3D Engine Project
#
# SPDX-License-Identifier: Apache-2.0 OR MIT
#
# For complete copyright and license terms please see the LICENSE at the root of this
# distribution (the "License"). All use of this software is governed by the License,
# or, if provided, by the license below or the license accompanying this file. Do not
# remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#
import argparse
+3 -7
View File
@@ -1,12 +1,8 @@
#
# All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
# its licensors.
# Copyright (c) Contributors to the Open 3D Engine Project
#
# SPDX-License-Identifier: Apache-2.0 OR MIT
#
# For complete copyright and license terms please see the LICENSE at the root of this
# distribution (the "License"). All use of this software is governed by the License,
# or, if provided, by the license below or the license accompanying this file. Do not
# remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#
'''