Skip to content

Commit 35e1e08

Browse files
committed
Move sync_to_s3 to shared helpers
1 parent 91b1ffd commit 35e1e08

11 files changed

Lines changed: 29 additions & 9 deletions

File tree

Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ test:
1010
pytest src/lambda_codebase/initial_commit/bootstrap_repository/adf-bootstrap/deployment/lambda_codebase -vvv -s -c src/lambda_codebase/initial_commit/bootstrap_repository/adf-bootstrap/deployment/lambda_codebase/pytest.ini
1111
pytest src/lambda_codebase/initial_commit/bootstrap_repository/adf-bootstrap/deployment/lambda_codebase/initial_commit -vvv -s -c src/lambda_codebase/initial_commit/bootstrap_repository/adf-bootstrap/deployment/lambda_codebase/initial_commit/pytest.ini
1212
pytest src/lambda_codebase/initial_commit/bootstrap_repository/adf-bootstrap/deployment/lambda_codebase/determine_default_branch -vvv -s -c src/lambda_codebase/initial_commit/bootstrap_repository/adf-bootstrap/deployment/lambda_codebase/determine_default_branch/pytest.ini
13+
pytest src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/helpers -vvv -s -c src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/helpers/pytest.ini
1314
pytest src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/python -vvv -s -c src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/python/pytest.ini
1415
pytest src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/cdk -vvv -s -c src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/cdk/pytest.ini
1516
pytest src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared -vvv -s -c src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/pytest.ini

src/lambda_codebase/initial_commit/bootstrap_repository/adf-bootstrap/deployment/global.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -767,10 +767,13 @@ Resources:
767767
- npm install cdk@1.169 -g -y --quiet --no-progress
768768
- aws s3 cp s3://$SHARED_MODULES_BUCKET/adf-build/ ./adf-build/ --recursive --quiet
769769
- pip install -r adf-build/requirements.txt -q -t ./adf-build
770+
pre_build:
771+
commands:
772+
- mkdir -p deployment_maps
770773
build:
771774
commands:
772-
- python adf-build/sync_to_s3.py --upload-with-metadata execution_id=${!CODEBUILD_BUILD_NUMBER} deployment_map.yml s3://$ADF_PIPELINES_BUCKET/deployment_map.yml
773-
- python adf-build/sync_to_s3.py --extension .yml --upload-with-metadata execution_id=${!CODEBUILD_BUILD_NUMBER} --recursive deployment_maps '**/*.yml' s3://$ADF_PIPELINES_BUCKET/deployment_maps
775+
- python adf-build/helpers/sync_to_s3.py --upload-with-metadata execution_id=${!CODEBUILD_BUILD_NUMBER} deployment_map.yml s3://$ADF_PIPELINES_BUCKET/deployment_map.yml
776+
- python adf-build/helpers/sync_to_s3.py --extension .yml --upload-with-metadata execution_id=${!CODEBUILD_BUILD_NUMBER} --recursive deployment_maps s3://$ADF_PIPELINES_BUCKET/deployment_maps
774777
post_build:
775778
commands:
776779
- echo "Pipelines are updated in the AWS Step Functions ADFPipelineManagementStateMachine."
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
boto3==1.18.2
1+
boto3==1.24.59
22
cfn-custom-resource~=1.0.1

src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/requirements.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ awscli==1.25.60
55
boto3==1.24.59
66
botocore==1.27.59
77
aws-sam-cli==1.55.0
8-
docopt~=0.6.2
98
mock~=4.0.3
109
pip~=21.3.1
1110
pylint~=2.13.9
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
2+
# SPDX-License-Identifier: MIT-0
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[pytest]
2+
testpaths = tests
3+
norecursedirs = terraform

src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/sync_to_s3.py renamed to src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/helpers/sync_to_s3.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -118,14 +118,15 @@
118118
import boto3
119119
from docopt import docopt
120120

121-
from logger import configure_logger
122-
123121

124122
ADF_VERSION = os.environ.get("ADF_VERSION")
125123
ADF_LOG_LEVEL = os.environ.get("ADF_LOG_LEVEL", "INFO")
126-
LOGGER = configure_logger(__name__)
127124
NON_RECURSIVE_KEY = '%%-single-match-%%'
128125

126+
logging.basicConfig(level=logging.INFO)
127+
LOGGER = logging.getLogger(__name__)
128+
LOGGER.setLevel(ADF_LOG_LEVEL)
129+
129130

130131
class GenericFileData(TypedDict):
131132
"""
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
2+
# SPDX-License-Identifier: MIT-0
3+
4+
"""
5+
__init__ for tests module
6+
"""
7+
8+
import sys
9+
import os
10+
11+
sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), '..')))

src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/tests/test_sync_to_s3.py renamed to src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/helpers/tests/test_sync_to_s3.py

File renamed without changes.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
[pytest]
22
testpaths = tests
3-
norecursedirs = python cdk
3+
norecursedirs = python cdk helpers

0 commit comments

Comments
 (0)