Bug 1085631 part2: Allow the use of a custom build script. r=lightsofapollo
authorWander Lairson Costa <wcosta@mozilla.com>
Tue, 16 Dec 2014 12:24:55 -0200
changeset 239062 d4c985c6f85e5ef0db72e84e34964e31647fe09f
parent 239061 6a6ff39d1a7416e01eb4710694a2d951af97694a
child 239063 7bf1779553515286ef693db148f907098e1557fc
push id487
push userbcampen@mozilla.com
push dateMon, 26 Jan 2015 23:32:56 +0000
reviewerslightsofapollo
bugs1085631
milestone38.0a1
Bug 1085631 part2: Allow the use of a custom build script. r=lightsofapollo If the image folder contains an inner build.sh script, runs it to build the image. The tag value is passed through a "-t" argument. All arguments passed after the folder parameter are forwarded to the inner build script.
testing/docker/build.sh
--- a/testing/docker/build.sh
+++ b/testing/docker/build.sh
@@ -51,17 +51,24 @@ build() {
 
   local registry=$(cat $folder_reg)
   local version=$(cat $folder_ver)
 
   test -n "$registry" || usage_err "$folder_reg is empty aborting..."
   test -n "$version" || usage_err "$folder_ver is empty aborting..."
 
   local tag="$registry/$folder:$version"
-  docker build -t $tag $folder
+
+  if [ -f $folder/build.sh ]; then
+    shift
+    $folder/build.sh -t $tag $*
+  else
+    docker build -t $tag $folder
+  fi
+
   echo "Success built $folder and tagged with $tag"
   echo "If deploying now you can run 'docker push $tag'"
 }
 
 if ! which docker > /dev/null; then
   echo "Docker must be installed read installation instructions at docker.com"
   echo
   usage
@@ -73,9 +80,9 @@ if ! docker version > /dev/null;
 then
   echo "Docker server is unresponsive run 'docker ps' and check that docker is"
   echo "running"
   echo
   usage
   exit 1
 fi
 
-build $1
+build $*