@commercetools-frontend/application-cli 6.0.1 → 6.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -432,8 +432,40 @@ set -e
|
|
|
432
432
|
# be overwritten
|
|
433
433
|
echo "Uploading static assets to Google Storage bucket ${bucketUrl}"
|
|
434
434
|
|
|
435
|
+
# List of required file types
|
|
436
|
+
required_files=("*.css" "*.js" "*.js.map" "*.html")
|
|
437
|
+
|
|
438
|
+
# List of optional file types
|
|
439
|
+
optional_files=("*.svg")
|
|
440
|
+
|
|
441
|
+
# Check for the existence of required files
|
|
442
|
+
for file_pattern in "\${required_files[@]}"; do
|
|
443
|
+
if ! find "${assetsPath}/public" -type f -name "$file_pattern" -print -quit | grep -q .; then
|
|
444
|
+
echo "Error: No required files matching $file_pattern found in ${assetsPath}/public."
|
|
445
|
+
exit 1
|
|
446
|
+
fi
|
|
447
|
+
done
|
|
448
|
+
|
|
449
|
+
# Initialize source_pattern with required files
|
|
450
|
+
source_pattern="${assetsPath}/public/{$(IFS=,; echo "\${required_files[*]}")"
|
|
451
|
+
|
|
452
|
+
# Check for optional files and add them to the source_pattern if they exist
|
|
453
|
+
for file_pattern in "\${optional_files[@]}"; do
|
|
454
|
+
if find "${assetsPath}/public" -type f -name "$file_pattern" -print -quit | grep -q .; then
|
|
455
|
+
source_pattern+=",\${file_pattern}"
|
|
456
|
+
fi
|
|
457
|
+
done
|
|
458
|
+
|
|
459
|
+
# Close the brace in source_pattern
|
|
460
|
+
source_pattern+="}"
|
|
461
|
+
|
|
462
|
+
echo "Uploading files using the following pattern: \${source_pattern}"
|
|
463
|
+
|
|
464
|
+
# Expand the source_pattern variable as the below command will not work if the variable is a string
|
|
465
|
+
expanded_source_pattern=$(eval echo $source_pattern)
|
|
466
|
+
|
|
435
467
|
gcloud storage cp \\
|
|
436
|
-
$
|
|
468
|
+
$expanded_source_pattern \\
|
|
437
469
|
"${bucketUrl}" \\
|
|
438
470
|
-n \\
|
|
439
471
|
-z js,css \\
|
|
@@ -549,6 +581,12 @@ echo "Uploading static assets to Amazon S3 bucket ${bucketUrl}"
|
|
|
549
581
|
|
|
550
582
|
set -e
|
|
551
583
|
|
|
584
|
+
# Check for the existence of the application required files types
|
|
585
|
+
if ! find "${assetsPath}" -type f -regex ".*\\.\\(css\\|js\\|html\\)" | grep -q .; then
|
|
586
|
+
echo "Error: No CSS, JS, or HTML files found in ${assetsPath}."
|
|
587
|
+
exit 1
|
|
588
|
+
fi
|
|
589
|
+
|
|
552
590
|
# NOTE:
|
|
553
591
|
# The sync command on the AWS CLI is different to the -n option on the gcloud CLI.
|
|
554
592
|
# Sync will only upload files that are not already in the bucket, but it will skip existing ones
|
|
@@ -566,6 +604,7 @@ aws s3 sync ${assetsPath}/public \\
|
|
|
566
604
|
--include "*.js" \\
|
|
567
605
|
--include "*.js.map" \\
|
|
568
606
|
--include "*.html" \\
|
|
607
|
+
--include "*.svg" \\
|
|
569
608
|
--cache-control="public,max-age=31536000,no-transform" \\
|
|
570
609
|
--profile ${_classPrivateFieldLooseBase(this, _bucketRegion2)[_bucketRegion2]}
|
|
571
610
|
|
|
@@ -1265,7 +1304,7 @@ async function command(cliFlags) {
|
|
|
1265
1304
|
|
|
1266
1305
|
var pkgJson = {
|
|
1267
1306
|
name: "@commercetools-frontend/application-cli",
|
|
1268
|
-
version: "6.
|
|
1307
|
+
version: "6.1.1",
|
|
1269
1308
|
description: "Internal CLI to manage Merchant Center application deployments across various environments.",
|
|
1270
1309
|
keywords: [
|
|
1271
1310
|
"commercetools",
|
|
@@ -432,8 +432,40 @@ set -e
|
|
|
432
432
|
# be overwritten
|
|
433
433
|
echo "Uploading static assets to Google Storage bucket ${bucketUrl}"
|
|
434
434
|
|
|
435
|
+
# List of required file types
|
|
436
|
+
required_files=("*.css" "*.js" "*.js.map" "*.html")
|
|
437
|
+
|
|
438
|
+
# List of optional file types
|
|
439
|
+
optional_files=("*.svg")
|
|
440
|
+
|
|
441
|
+
# Check for the existence of required files
|
|
442
|
+
for file_pattern in "\${required_files[@]}"; do
|
|
443
|
+
if ! find "${assetsPath}/public" -type f -name "$file_pattern" -print -quit | grep -q .; then
|
|
444
|
+
echo "Error: No required files matching $file_pattern found in ${assetsPath}/public."
|
|
445
|
+
exit 1
|
|
446
|
+
fi
|
|
447
|
+
done
|
|
448
|
+
|
|
449
|
+
# Initialize source_pattern with required files
|
|
450
|
+
source_pattern="${assetsPath}/public/{$(IFS=,; echo "\${required_files[*]}")"
|
|
451
|
+
|
|
452
|
+
# Check for optional files and add them to the source_pattern if they exist
|
|
453
|
+
for file_pattern in "\${optional_files[@]}"; do
|
|
454
|
+
if find "${assetsPath}/public" -type f -name "$file_pattern" -print -quit | grep -q .; then
|
|
455
|
+
source_pattern+=",\${file_pattern}"
|
|
456
|
+
fi
|
|
457
|
+
done
|
|
458
|
+
|
|
459
|
+
# Close the brace in source_pattern
|
|
460
|
+
source_pattern+="}"
|
|
461
|
+
|
|
462
|
+
echo "Uploading files using the following pattern: \${source_pattern}"
|
|
463
|
+
|
|
464
|
+
# Expand the source_pattern variable as the below command will not work if the variable is a string
|
|
465
|
+
expanded_source_pattern=$(eval echo $source_pattern)
|
|
466
|
+
|
|
435
467
|
gcloud storage cp \\
|
|
436
|
-
$
|
|
468
|
+
$expanded_source_pattern \\
|
|
437
469
|
"${bucketUrl}" \\
|
|
438
470
|
-n \\
|
|
439
471
|
-z js,css \\
|
|
@@ -549,6 +581,12 @@ echo "Uploading static assets to Amazon S3 bucket ${bucketUrl}"
|
|
|
549
581
|
|
|
550
582
|
set -e
|
|
551
583
|
|
|
584
|
+
# Check for the existence of the application required files types
|
|
585
|
+
if ! find "${assetsPath}" -type f -regex ".*\\.\\(css\\|js\\|html\\)" | grep -q .; then
|
|
586
|
+
echo "Error: No CSS, JS, or HTML files found in ${assetsPath}."
|
|
587
|
+
exit 1
|
|
588
|
+
fi
|
|
589
|
+
|
|
552
590
|
# NOTE:
|
|
553
591
|
# The sync command on the AWS CLI is different to the -n option on the gcloud CLI.
|
|
554
592
|
# Sync will only upload files that are not already in the bucket, but it will skip existing ones
|
|
@@ -566,6 +604,7 @@ aws s3 sync ${assetsPath}/public \\
|
|
|
566
604
|
--include "*.js" \\
|
|
567
605
|
--include "*.js.map" \\
|
|
568
606
|
--include "*.html" \\
|
|
607
|
+
--include "*.svg" \\
|
|
569
608
|
--cache-control="public,max-age=31536000,no-transform" \\
|
|
570
609
|
--profile ${_classPrivateFieldLooseBase(this, _bucketRegion2)[_bucketRegion2]}
|
|
571
610
|
|
|
@@ -1265,7 +1304,7 @@ async function command(cliFlags) {
|
|
|
1265
1304
|
|
|
1266
1305
|
var pkgJson = {
|
|
1267
1306
|
name: "@commercetools-frontend/application-cli",
|
|
1268
|
-
version: "6.
|
|
1307
|
+
version: "6.1.1",
|
|
1269
1308
|
description: "Internal CLI to manage Merchant Center application deployments across various environments.",
|
|
1270
1309
|
keywords: [
|
|
1271
1310
|
"commercetools",
|
|
@@ -396,8 +396,40 @@ set -e
|
|
|
396
396
|
# be overwritten
|
|
397
397
|
echo "Uploading static assets to Google Storage bucket ${bucketUrl}"
|
|
398
398
|
|
|
399
|
+
# List of required file types
|
|
400
|
+
required_files=("*.css" "*.js" "*.js.map" "*.html")
|
|
401
|
+
|
|
402
|
+
# List of optional file types
|
|
403
|
+
optional_files=("*.svg")
|
|
404
|
+
|
|
405
|
+
# Check for the existence of required files
|
|
406
|
+
for file_pattern in "\${required_files[@]}"; do
|
|
407
|
+
if ! find "${assetsPath}/public" -type f -name "$file_pattern" -print -quit | grep -q .; then
|
|
408
|
+
echo "Error: No required files matching $file_pattern found in ${assetsPath}/public."
|
|
409
|
+
exit 1
|
|
410
|
+
fi
|
|
411
|
+
done
|
|
412
|
+
|
|
413
|
+
# Initialize source_pattern with required files
|
|
414
|
+
source_pattern="${assetsPath}/public/{$(IFS=,; echo "\${required_files[*]}")"
|
|
415
|
+
|
|
416
|
+
# Check for optional files and add them to the source_pattern if they exist
|
|
417
|
+
for file_pattern in "\${optional_files[@]}"; do
|
|
418
|
+
if find "${assetsPath}/public" -type f -name "$file_pattern" -print -quit | grep -q .; then
|
|
419
|
+
source_pattern+=",\${file_pattern}"
|
|
420
|
+
fi
|
|
421
|
+
done
|
|
422
|
+
|
|
423
|
+
# Close the brace in source_pattern
|
|
424
|
+
source_pattern+="}"
|
|
425
|
+
|
|
426
|
+
echo "Uploading files using the following pattern: \${source_pattern}"
|
|
427
|
+
|
|
428
|
+
# Expand the source_pattern variable as the below command will not work if the variable is a string
|
|
429
|
+
expanded_source_pattern=$(eval echo $source_pattern)
|
|
430
|
+
|
|
399
431
|
gcloud storage cp \\
|
|
400
|
-
$
|
|
432
|
+
$expanded_source_pattern \\
|
|
401
433
|
"${bucketUrl}" \\
|
|
402
434
|
-n \\
|
|
403
435
|
-z js,css \\
|
|
@@ -513,6 +545,12 @@ echo "Uploading static assets to Amazon S3 bucket ${bucketUrl}"
|
|
|
513
545
|
|
|
514
546
|
set -e
|
|
515
547
|
|
|
548
|
+
# Check for the existence of the application required files types
|
|
549
|
+
if ! find "${assetsPath}" -type f -regex ".*\\.\\(css\\|js\\|html\\)" | grep -q .; then
|
|
550
|
+
echo "Error: No CSS, JS, or HTML files found in ${assetsPath}."
|
|
551
|
+
exit 1
|
|
552
|
+
fi
|
|
553
|
+
|
|
516
554
|
# NOTE:
|
|
517
555
|
# The sync command on the AWS CLI is different to the -n option on the gcloud CLI.
|
|
518
556
|
# Sync will only upload files that are not already in the bucket, but it will skip existing ones
|
|
@@ -530,6 +568,7 @@ aws s3 sync ${assetsPath}/public \\
|
|
|
530
568
|
--include "*.js" \\
|
|
531
569
|
--include "*.js.map" \\
|
|
532
570
|
--include "*.html" \\
|
|
571
|
+
--include "*.svg" \\
|
|
533
572
|
--cache-control="public,max-age=31536000,no-transform" \\
|
|
534
573
|
--profile ${_classPrivateFieldLooseBase(this, _bucketRegion2)[_bucketRegion2]}
|
|
535
574
|
|
|
@@ -1229,7 +1268,7 @@ async function command(cliFlags) {
|
|
|
1229
1268
|
|
|
1230
1269
|
var pkgJson = {
|
|
1231
1270
|
name: "@commercetools-frontend/application-cli",
|
|
1232
|
-
version: "6.
|
|
1271
|
+
version: "6.1.1",
|
|
1233
1272
|
description: "Internal CLI to manage Merchant Center application deployments across various environments.",
|
|
1234
1273
|
keywords: [
|
|
1235
1274
|
"commercetools",
|
package/package.json
CHANGED