forked from Mellanox/ib-kubernetes
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtag_build_and_push.sh
More file actions
33 lines (28 loc) · 962 Bytes
/
tag_build_and_push.sh
File metadata and controls
33 lines (28 loc) · 962 Bytes
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
#! /bin/bash
# if env var exists, use it - or else get short git commit hash
TAG=${TAG:-$(git rev-parse --short HEAD)}
echo "Going to build and push tag: $TAG"
set -eou pipefail
read -p "Have you logged in to aws and ecr? ([y]/n): " confirm
if [ "$confirm" == "n" ]; then
echo "Logging in to aws and ecr"
aws sso login
aws ecr-public get-login-password --region us-east-1 | docker login --username AWS --password-stdin public.ecr.aws
fi
echo "Building and deploying $TAG"
make build
# echo "Running tests"
# make test > /dev/null 2>&1
# if [ $? -ne 0 ]; then
# echo "Tests failed"
# exit 1
# fi
make image TAG=public.ecr.aws/k6t4m3l7/ib-kubernetes:$TAG
# ask to confirm
read -p "Are you sure you want to push and deploy $TAG? (y/[n]): " confirm
if [ "$confirm" != "y" ]; then
echo "Deployment cancelled"
exit 1
fi
make docker-push TAG=public.ecr.aws/k6t4m3l7/ib-kubernetes:$TAG
echo "To Deploy, install/upgrade via helm!"