@@ -61,9 +61,8 @@ GIT_SHA=$(get_git_sha $REPO_DIR $BRANCH)
6161SHORT_SHA=${GIT_SHA: 0: 8}
6262
6363# define image names
64- TMP_IMAGE=" ${APP_NAME} :git-${SHORT_SHA} "
65- TARGET_IMAGE=" {{ .deis_registry_host }}:{{ .deis_registry_port }}/${APP_NAME} "
66- IMAGE_REFERENCE=$APP_NAME
64+ IMAGE_NAME=" $APP_NAME :git-$SHORT_SHA "
65+ TMP_IMAGE=" {{ .deis_registry_host }}:{{ .deis_registry_port }}/$IMAGE_NAME "
6766
6867# create app directories
6968mkdir -p $BUILD_DIR $CACHE_DIR
142141echo
143142puts-step " Building Docker image"
144143docker build -t $TMP_IMAGE . 2>&1
145- docker tag $TMP_IMAGE $TARGET_IMAGE
146-
147144puts-step " Pushing image to private registry"
148- docker push $TARGET_IMAGE & > /dev/null
145+ docker push $TMP_IMAGE & > /dev/null
149146echo
150147
151148if [ -f $TMP_DIR /slug.tgz ]; then
@@ -169,7 +166,7 @@ DOCKERFILE=$(echo $DOCKERFILE | sed -e 's/\"/\\\"/g')
169166
170167puts-step " Launching... "
171168URL=" {{ .deis_controller_protocol }}://{{ .deis_controller_host }}:{{ .deis_controller_port }}/api/hooks/build"
172- DATA=" {\" sha\" :\" $GIT_SHA \" ,\" receive_user\" :\" $USER \" ,\" receive_repo\" :\" $APP_NAME \" ,\" image\" :\" $IMAGE_REFERENCE \" ,\" procfile\" :\" $RELEASE_INFO \" ,\" dockerfile\" :\" $DOCKERFILE \" }"
169+ DATA=" {\" sha\" :\" $SHORT_SHA \" ,\" receive_user\" :\" $USER \" ,\" receive_repo\" :\" $APP_NAME \" ,\" image\" :\" $APP_NAME \" ,\" procfile\" :\" $RELEASE_INFO \" ,\" dockerfile\" :\" $DOCKERFILE \" }"
173170
174171# notify the controller that the push was successful
175172RESPONSE=$( curl -s -XPOST \
199196cd $REPO_DIR
200197git gc & > /dev/null
201198docker rm -f $JOB & > /dev/null
202- docker rmi -f $TMP_IMAGE $TARGET_IMAGE & > /dev/null
199+ docker rmi -f $TMP_IMAGE & > /dev/null
0 commit comments