-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.sh
More file actions
executable file
·31 lines (23 loc) · 1.07 KB
/
Copy pathbuild.sh
File metadata and controls
executable file
·31 lines (23 loc) · 1.07 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
PACKAGE_NAME=malta
# rm -r ./dist
pip3 install build
python3 -m build --wheel . -o ./dist
WHL_PATH=$(ls ./dist/malta-*.whl)
VERSION=$(echo $WHL_PATH | cut -d "-" -f 2)
ECR_REPO_URL=553593639791.dkr.ecr.us-west-2.amazonaws.com/$PACKAGE_NAME
aws ecr get-login-password --region us-west-2 --no-cli-auto-prompt | docker login --username AWS --password-stdin 553593639791.dkr.ecr.us-west-2.amazonaws.com
# # Build for AMD64
docker build --platform=linux/amd64 -t $ECR_REPO_URL:latest .
docker push $ECR_REPO_URL:latest
# # Build for ARM64
# docker build --platform=linux/arm64 -t $ECR_REPO_URL:$VERSION-arm64 -t $ECR_REPO_URL:latest-arm64 .
# docker push $ECR_REPO_URL:$VERSION-arm64
# docker push $ECR_REPO_URL:latest-arm64
# Try Docker BuildX
# docker buildx build \
# --push \
# --platform linux/arm/v7,linux/arm64/v8,linux/amd64 \
# --tag 553593639791.dkr.ecr.us-west-2.amazonaws.com/$PACKAGE_NAME:$VERSION .
# Delete old Malta pods to recreate with new image
MALTA_POD_NAME=$(kubectl get pods -n malta | grep malta- | cut -d " " -f 1)
kubectl delete pod -n malta $MALTA_POD_NAME