dmvolod closed pull request #89: Add docker tag option for oc cluster up
URL: https://github.com/apache/camel-k/pull/89
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/README.md b/README.md
index 4bbdf09..4bb9df3 100644
--- a/README.md
+++ b/README.md
@@ -145,6 +145,12 @@ After a successful build, if you're connected to a Docker 
daemon, you can build
 make images
 ```
 
+In case of the OpenShift "oc cluster up" Wrapper script using, the docker 
images are storing inside the local store and its necessary to tag them by 
running:
+
+```
+make images-tag
+```
+
 ### Testing
 
 Unit tests are executed automatically as part of the build. They use the 
standard go testing framework.
diff --git a/build/Makefile b/build/Makefile
index 3bc099c..f52babb 100644
--- a/build/Makefile
+++ b/build/Makefile
@@ -52,7 +52,9 @@ images-build:
 images-push:
        ./build/images_push.sh
 
-install: install-minishift
+images-tag:
+       ./build/images_tag.sh
+
 install-minishift:
        ./build/install_minishift.sh
 
diff --git a/build/images_tag.sh b/build/images_tag.sh
new file mode 100755
index 0000000..f38b1a2
--- /dev/null
+++ b/build/images_tag.sh
@@ -0,0 +1,15 @@
+#!/bin/sh
+
+location=$(dirname $0)
+version=$($location/get_version.sh)
+IMAGE_NAME="camel-k"
+
+if [ -z "${DOCKER_REGISTRY}" ]; then
+       DOCKER_REGISTRY=$(oc get svc docker-registry -n default | awk '{b=$3 
":" substr($5, 1, match($5, "/") - 1); print b}' | tail -n+2)
+fi
+
+if [ -z "${PROJECT_NAME}" ]; then
+       PROJECT_NAME=$(oc project -q)
+fi
+
+docker tag docker.io/apache/${IMAGE_NAME}:${version} 
${DOCKER_REGISTRY}/${PROJECT_NAME}/${IMAGE_NAME}:${version}


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to