-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathdeploy.bash
More file actions
executable file
·68 lines (56 loc) · 1.52 KB
/
deploy.bash
File metadata and controls
executable file
·68 lines (56 loc) · 1.52 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
#!/usr/bin/env bash
image_name="manylinux-cpp17-py"
version="2025.1"
push=""
latest=""
python_versions=(3.9 3.10 3.11 3.12 3.13)
architecture=x86_64
while [[ $# -gt 0 ]]; do
case $1 in
-v|--version)
version=$2
shift
shift
;;
-p|--push)
push="yes"
shift
;;
-l|--latest)
latest="yes"
shift
;;
-a|--arch)
architecture=$2
shift
shift
;;
esac
done
# Validate architecture
if [[ "$architecture" != "x86_64" && "$architecture" != "aarch64" ]]; then
echo "Error: Unsupported architecture '$architecture'. Supported architectures are: x86_64, aarch64"
exit 1
fi
for pyver in "${python_versions[@]}"; do
echo "Building $architecture manylinux Docker image for Python $pyver..."
dockerfile="Dockerfile-$pyver-$architecture"
pyver_no_dot=$(echo $pyver | tr -d '.')
sed -e "s/\${pyver_short}/$pyver/g" \
-e "s/\${pyver_short_no_dot}/$pyver_no_dot/g" \
-e "s/\${architecture}/$architecture/g" \
Dockerfile.template > $dockerfile
image_name_full="ghcr.io/klebert-engineering/$image_name$pyver-$architecture"
docker build -t "$image_name_full:$version" -f $dockerfile .
if [[ -n "$latest" ]]; then
echo "Tagging latest."
docker tag "$image_name_full:$version" "$image_name_full:latest"
fi
if [[ -n "$push" ]]; then
echo "Pushing."
docker push "$image_name_full:$version"
if [[ -n "$latest" ]]; then
docker push "$image_name_full:latest"
fi
fi
done