File tree 1 file changed +20
-4
lines changed 1 file changed +20
-4
lines changed Original file line number Diff line number Diff line change @@ -15,6 +15,21 @@ set -e
15
15
LAYER_DIR=" .layers"
16
16
LAYER_FILES_PREFIX=" datadog_lambda_py"
17
17
AVAILABLE_PYTHON_VERSIONS=(" 3.8" " 3.9" " 3.10" " 3.11" " 3.12" )
18
+ AVAILABLE_ARCHS=(" arm64" " amd64" )
19
+
20
+ if [ -z " $ARCH " ]; then
21
+ echo " No architectures specified, building layers for all architectures."
22
+ ARCHS=(" ${AVAILABLE_ARCHS[@]} " )
23
+ else
24
+ echo " Architecture specified: $ARCH "
25
+ if [[ ! " ${AVAILABLE_ARCHS[@]} " =~ " ${ARCH} " ]]; then
26
+ echo " Architecture $ARCH is not a valid option. Choose from: ${AVAILABLE_ARCHS[@]} "
27
+ echo " "
28
+ echo " EXITING SCRIPT."
29
+ exit 1
30
+ fi
31
+ ARCHS=$ARCH
32
+ fi
18
33
19
34
# Determine which Python versions to build layers for
20
35
if [ -z " $PYTHON_VERSION " ]; then
@@ -64,10 +79,11 @@ mkdir $LAYER_DIR
64
79
65
80
for python_version in " ${PYTHON_VERSIONS[@]} "
66
81
do
67
- echo " Building layer for Python ${python_version} arch=arm64"
68
- docker_build_zip ${python_version} $LAYER_DIR /${LAYER_FILES_PREFIX} -arm64-${python_version} .zip arm64
69
- echo " Building layer for Python ${python_version} arch=amd64"
70
- docker_build_zip ${python_version} $LAYER_DIR /${LAYER_FILES_PREFIX} -amd64-${python_version} .zip amd64
82
+ for architecture in " ${ARCHS[@]} "
83
+ do
84
+ echo " Building layer for Python ${python_version} arch=${architecture} "
85
+ docker_build_zip ${python_version} $LAYER_DIR /${LAYER_FILES_PREFIX} -${architecture} -${python_version} .zip ${architecture}
86
+ done
71
87
done
72
88
73
89
echo " Done creating layers:"
You can’t perform that action at this time.
0 commit comments