Skip to content

Commit 51a2db8

Browse files
committed
ACR
Address code review. - Added apply_tags to post_push - Verified output for versions
1 parent 6fb9921 commit 51a2db8

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

datascience-notebook/hooks/apply_tags

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ GIT_SHA_TAG=${SOURCE_COMMIT:0:12}
77
docker tag $IMAGE_NAME "$DOCKER_REPO:$GIT_SHA_TAG"
88
PY_VERSION_TAG="python-$(docker run --rm ${IMAGE_NAME} python --version 2>&1 | awk '{print $2}')"
99
docker tag $IMAGE_NAME "$DOCKER_REPO:$PY_VERSION_TAG"
10-
R_VERSION_TAG=="hub-$(docker run --rm -a STDOUT ${IMAGE_NAME} R --version | tr -d '\r')"
10+
R_VERSION_TAG=="hub-$(docker run --rm -a STDOUT ${IMAGE_NAME} R --version | sed -n 1p | awk '{print $3}')"
1111
docker tag $IMAGE_NAME "$DOCKER_REPO:${R_VERSION_TAG%%\r}"
12-
JULIA_VERSION_TAG=="hub-$(docker run --rm -a STDOUT ${IMAGE_NAME} julia --version | tr -d '\r' | tr -d '[a-z| ]')"
12+
JULIA_VERSION_TAG=="hub-$(docker run --rm -a STDOUT ${IMAGE_NAME} julia --version | tr -d '\r' | awk '{print $3}')"
1313
docker tag $IMAGE_NAME "$DOCKER_REPO:${JULIA_VERSION_TAG%%\r}"
1414
NB_VERSION_TAG="notebook-$(docker run --rm -a STDOUT ${IMAGE_NAME} jupyter-notebook --version | tr -d '\r')"
1515
docker tag $IMAGE_NAME "$DOCKER_REPO:${NB_VERSION_TAG%% }"

datascience-notebook/hooks/post_push

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
#!/bin/bash
22
set -e
33

4+
# Apply and push all tags
5+
source hooks/apply_tags
6+
docker push $DOCKER_REPO
7+
48
# Tag the latest build with the short git sha. Push the tag in addition
59
# to the "latest" tag already pushed.
610
GIT_SHA_TAG=${SOURCE_COMMIT:0:12}
@@ -48,4 +52,4 @@ set +e
4852
for url in $(echo $NEXT_BUILD_TRIGGERS | sed "s/,/ /g")
4953
do
5054
curl -X POST $url
51-
done
55+
done

0 commit comments

Comments
 (0)