Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -405,7 +405,7 @@
"S3Bucket": {
"Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}"
},
"S3Key": "3423a042b818e31c1e34a19d6689ab2e5f9b70fcbe9e71df66f241b20a200bd9.zip"
"S3Key": "fbc0c6f6cf1d34be4fad26e77840e9068ff1f4e94fe80e26a0d6527bb8e6a9d1.zip"
},
"Environment": {
"Variables": {
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -162,10 +162,11 @@ const noEscapeFileWithMarker = Source.jsonData('my-json/secret-config-no-escape.
secret_value: param.stringValue,
});

// Deploy the large files
const deploymentSources = [largeJsonSource, largeTextSource, fileWithMarker, noEscapeFileWithMarker];

new BucketDeployment(stack, 'DeployWithLargeFiles', {
destinationBucket: bucket,
sources: [largeJsonSource, largeTextSource, fileWithMarker, noEscapeFileWithMarker],
sources: deploymentSources,
retainOnDelete: false,
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -336,6 +336,9 @@ def extract_and_replace_markers(archive, contents_dir, markers, markers_config):
with ZipFile(archive, "r") as zip:
zip.extractall(contents_dir)

if not markers:
return

# replace markers for this source
for file in zip.namelist():
file_path = os.path.join(contents_dir, file)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -725,6 +725,14 @@ def test_replace_markers(self):
else:
self.assertEqual(content, '{\n "root": {\n "key_with_quote": "prefixvalue"with"quotessuffix",\n "key_without_quote": "prefixboom-marker2-replacedsuffix"\n }\n}')

def test_extract_and_replace_markers_skips_sources_without_markers(self):
with tempfile.TemporaryDirectory() as outdir:
with patch.object(index, 'replace_markers') as replace_markers:
index.extract_and_replace_markers(os.path.join(scriptdir, "test.zip"), outdir, {}, {})

replace_markers.assert_not_called()
self.assertTrue(os.path.exists(os.path.join(outdir, "test.txt")))

def test_marker_substitution(self):
outdir = tempfile.mkdtemp()

Expand Down Expand Up @@ -846,4 +854,4 @@ def assert_field(name, expect=None):
return resp

if __name__ == '__main__':
unittest.main()
unittest.main()
Loading