|
2 | 2 |
|
3 | 3 | set -euo pipefail |
4 | 4 |
|
5 | | -echo --- Download handler.zip |
6 | | -buildkite-agent artifact download handler.zip . |
| 5 | +echo --- Download handler zips |
| 6 | +buildkite-agent artifact download "handler*.zip" . |
7 | 7 |
|
8 | | -echo --- Create template for Serverless Application Repository |
9 | | -sam package --region us-east-1 --s3-bucket buildkite-serverless-apps-us-east-1 --s3-prefix elastic-ci/agent-scaler --output-template-file packaged.yml |
| 8 | +# Package x86_64 version (default - handler.zip is already x86_64) |
| 9 | +echo "--- Create x86_64 template for Serverless Application Repository" |
| 10 | +sam package \ |
| 11 | + --template-file template.yaml \ |
| 12 | + --region us-east-1 \ |
| 13 | + --s3-bucket buildkite-serverless-apps-us-east-1 \ |
| 14 | + --s3-prefix elastic-ci/agent-scaler \ |
| 15 | + --output-template-file packaged.yml |
10 | 16 | buildkite-agent artifact upload packaged.yml |
11 | 17 |
|
12 | | -echo --- Print template for Serverless Application Repository |
| 18 | +# Package arm64 version |
| 19 | +echo "--- Create arm64 template for Serverless Application Repository" |
| 20 | +# Temporarily rename files to avoid overwriting handler.zip |
| 21 | +mv handler.zip handler-x86_64-backup.zip |
| 22 | +mv handler-arm64.zip handler.zip |
| 23 | +sam package \ |
| 24 | + --template-file template.yaml \ |
| 25 | + --region us-east-1 \ |
| 26 | + --s3-bucket buildkite-serverless-apps-us-east-1 \ |
| 27 | + --s3-prefix elastic-ci/agent-scaler-arm64 \ |
| 28 | + --output-template-file packaged-arm64.yml |
| 29 | +# Restore original filenames |
| 30 | +mv handler.zip handler-arm64.zip |
| 31 | +mv handler-x86_64-backup.zip handler.zip |
| 32 | +# Update the hardcoded architecture from x86_64 to arm64 |
| 33 | +echo "Updating Lambda architecture to arm64..." |
| 34 | +sed -i.bak 's/- x86_64/- arm64/' packaged-arm64.yml && rm packaged-arm64.yml.bak |
| 35 | +buildkite-agent artifact upload packaged-arm64.yml |
| 36 | + |
| 37 | +echo --- Print x86_64 template for Serverless Application Repository |
13 | 38 | echo "$(< packaged.yml)" |
| 39 | + |
| 40 | +echo --- Print arm64 template for Serverless Application Repository |
| 41 | +echo "$(< packaged-arm64.yml)" |
0 commit comments