Add possibility to build a Release Docker image 25/25325/3
authorjose.lausuch <jose.lausuch@ericsson.com>
Thu, 1 Dec 2016 12:35:04 +0000 (13:35 +0100)
committerJose Lausuch <jose.lausuch@ericsson.com>
Thu, 1 Dec 2016 12:52:31 +0000 (12:52 +0000)
New flag that if it's not empty, it will build the
image with the given tag instead of using master/stable.
These release builds will need to be triggered manually
by a Jenkins user with rights to build jobs.
The respective projects take the responsability to
build the release docker image whenever they
consider it is the right time.

Change-Id: I49b087e80eb134b8b3ddef8399f61eeac9b29619
Signed-off-by: jose.lausuch <jose.lausuch@ericsson.com>
jjb/releng/opnfv-docker.sh
jjb/releng/opnfv-docker.yml

index e0fbb75..6f8d81a 100644 (file)
@@ -66,7 +66,13 @@ echo "Current branch: $branch"
 if [[ "$branch" == "master" ]]; then
     DOCKER_TAG="latest"
 else
-    DOCKER_TAG="stable"
+    if [[ "$RELEASE_VERSION" != "" ]]; then
+        release=$(echo $branch|sed 's/.*\///')
+        DOCKER_TAG=${release}.${RELEASE_VERSION}
+        # e.g. colorado.1.0, colorado.2.0, colorado.3.0
+    else:
+        DOCKER_TAG="stable"
+    fi
 fi
 
 # Start the build
index 0df0ddf..7a4c9af 100644 (file)
             name: DOCKER_REPO_NAME
             default: "opnfv/{project}"
             description: "Dockerhub repo to be pushed to."
+        - string:
+            name: RELEASE_VERSION
+            default: ""
+            description: "Release version, e.g. 1.0, 2.0, 3.0"
 
     scm:
         - git-scm: