Skip to content

Commit b3d611f

Browse files
authored
fix version path for tests (#349)
1 parent cb8d659 commit b3d611f

File tree

3 files changed

+7
-5
lines changed

3 files changed

+7
-5
lines changed

data-collection/utils/upload.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,6 @@ code_path=$(git rev-parse --show-toplevel)/data-collection/deploy
1313
version=$(jq -r '.version' data-collection/utils/version.json)
1414

1515
echo "Sync to $bucket"
16-
aws s3 sync $code_path/ s3://$bucket/cfn/data-collection/
17-
aws s3 sync $code_path/ s3://$bucket/cfn/data-collection/$version/ --delete
16+
#aws s3 sync $code_path/ s3://$bucket/cfn/data-collection/ --delete
17+
aws s3 sync $code_path/ s3://$bucket/cfn/data-collection/v$version/ --delete
1818
echo 'Done'

test/test_from_scratch.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@
4545
logger = logging.getLogger(__name__)
4646
region = boto3.session.Session().region_name
4747
account_id = boto3.client('sts').get_caller_identity()['Account']
48+
version = json.load(open('data-collection/utils/version.json'))['version']
4849

4950
COLLECTION_BUCKET = f'cid-data-{account_id}'
5051

test/utils.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99

1010

1111
logger = logging.getLogger(__name__)
12+
version = json.load(open('data-collection/utils/version.json'))['version']
1213

1314
HEADER = '\033[95m'
1415
BLUE = '\033[94m'
@@ -156,7 +157,7 @@ def deploy_stack(cloudformation, stack_name: str, url: str, parameters: list[dic
156157
TimeoutInMinutes=60,
157158
**options,
158159
)
159-
logger.info(f'{stack_name} started creation strarted {res}')
160+
logger.info(f'{stack_name} started creation started {res}')
160161
except cloudformation.exceptions.AlreadyExistsException:
161162
try:
162163
logger.info(f'{stack_name} exists')
@@ -178,7 +179,7 @@ def initial_deploy_stacks(cloudformation, account_id, org_unit_id, bucket):
178179
deploy_stack(
179180
cloudformation=cloudformation,
180181
stack_name=f'{PREFIX}OptimizationDataReadPermissionsStack',
181-
url=f'https://{bucket}.s3.amazonaws.com/cfn/data-collection/deploy-data-read-permissions.yaml',
182+
url=f'https://{bucket}.s3.amazonaws.com/cfn/data-collection/v{version}/deploy-data-read-permissions.yaml',
182183
parameters=[
183184
{'ParameterKey': 'CFNSourceBucket', 'ParameterValue': bucket},
184185
{'ParameterKey': 'DataCollectionAccountID', 'ParameterValue': account_id},
@@ -207,7 +208,7 @@ def initial_deploy_stacks(cloudformation, account_id, org_unit_id, bucket):
207208
deploy_stack(
208209
cloudformation=cloudformation,
209210
stack_name=f'{PREFIX}OptimizationDataCollectionStack',
210-
url=f'https://{bucket}.s3.amazonaws.com/cfn/data-collection/deploy-data-collection.yaml',
211+
url=f'https://{bucket}.s3.amazonaws.com/cfn/data-collection/v{version}/deploy-data-collection.yaml',
211212
parameters=[
212213
{'ParameterKey': 'CFNSourceBucket', 'ParameterValue': bucket},
213214
{'ParameterKey': 'RegionsInScope', 'ParameterValue': REGIONS},

0 commit comments

Comments
 (0)