Closed aldegoeij closed 1 year ago
100th issue 🎉
Thanks for your input.
As you said, if you run sed -i '' -e "s/%%BUCKET_NAME%%/$1/g" target.template
on Mac, it would create aws-waf-security-automations.template-e
file.
We would consider the better way as you mentioned.
Closing the old ticket due to inactivity
The current
deployment/build-s3-dist.sh
build file is usingsed
in MacOS style, not GNU style, resulting in compatibility issues when running in pipelines (see: https://github.com/awslabs/aws-waf-security-automations/issues/32, https://github.com/awslabs/aws-waf-security-automations/issues/30)For example
sed
is used here: https://github.com/awslabs/aws-waf-security-automations/blob/e504013c87bde6d6af434097f0c1147a4c1f86c0/deployment/build-s3-dist.sh#L57-L60 uses MacOS-i ''
notation which fails on GNU Linux (CentOS, Ubuntu, etc):Works with default MacOS, but not on any Linux flavour:
Works on Linux but fails on MacOS:
The best solution is for the AWS dev team to stop using MacOS default cli tools and do a
brew install sed
to fix Apple's mistakes 😜, however, the simplest solution is to move fromsed
toperl
.The above snippet becomes:
The replacement string is almost identical as is the command itself, and
perl
comes preinstalled on all flavours of MacOS, BSD, GNU Linux, etc.PR shortly.