File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -27,7 +27,7 @@ ifndef REGISTRY
2727 $(ERR)
2828endif
2929 docker build --pull -t ${REGISTRY}/cluster-autoscaler:${TAG} .
30- gcloud docker -- push ${REGISTRY}/cluster-autoscaler:${TAG}
30+ ./push_image.sh ${REGISTRY}/cluster-autoscaler:${TAG}
3131
3232clean :
3333 rm -f cluster-autoscaler
Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+
3+ # Copyright 2017 The Kubernetes Authors.
4+ #
5+ # Licensed under the Apache License, Version 2.0 (the "License");
6+ # you may not use this file except in compliance with the License.
7+ # You may obtain a copy of the License at
8+ #
9+ # http://www.apache.org/licenses/LICENSE-2.0
10+ #
11+ # Unless required by applicable law or agreed to in writing, software
12+ # distributed under the License is distributed on an "AS IS" BASIS,
13+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+ # See the License for the specific language governing permissions and
15+ # limitations under the License.
16+
17+ IMAGE_TO_PUSH=$1
18+ if [ -z $IMAGE_TO_PUSH ]; then
19+ echo No image passed
20+ exit 1
21+ fi
22+
23+ echo " About to push image $IMAGE_TO_PUSH "
24+ read -r -p " Are you sure? [y/N] " response
25+ if [[ " $response " =~ ^([yY])+$ ]]; then
26+ gcloud docker -- pull $IMAGE_TO_PUSH
27+ if [ $? -eq 0 ]; then
28+ echo $IMAGE_TO_PUSH already exists
29+ exit 1
30+ fi
31+ gcloud docker -- push $IMAGE_TO_PUSH
32+ else
33+ echo Aborted
34+ exit 1
35+ fi
You can’t perform that action at this time.
0 commit comments