You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficcontrol.apache.org by so...@apache.org on 2017/03/10 15:20:25 UTC

[11/14] incubator-trafficcontrol git commit: builds tarball when all rpms being built

builds tarball when all rpms being built


Project: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/commit/4cf95296
Tree: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/tree/4cf95296
Diff: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/diff/4cf95296

Branch: refs/heads/master
Commit: 4cf95296ede4a92959307b51b846ab888aa6da83
Parents: 1be9566
Author: Dan Kirkwood <da...@gmail.com>
Authored: Tue Mar 7 15:48:36 2017 -0700
Committer: Phil Sorber <so...@apache.org>
Committed: Fri Mar 10 08:18:25 2017 -0700

----------------------------------------------------------------------
 build/build.sh                                 | 22 ++++++++------
 build/functions.sh                             |  2 +-
 infrastructure/docker/build/Dockerfile-source  | 33 +++++++++++++++++++++
 infrastructure/docker/build/docker-compose.yml |  8 +++++
 4 files changed, 55 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/4cf95296/build/build.sh
----------------------------------------------------------------------
diff --git a/build/build.sh b/build/build.sh
index 558fb9e..472d1d8 100755
--- a/build/build.sh
+++ b/build/build.sh
@@ -27,30 +27,34 @@ export TC_DIR=$(dirname $(dirname "$topscript"))
 
 checkEnvironment
 
-# Create tarball first
-if isInGitTree; then
-	echo "-----  Building tarball ..."
-	tarball=$(createTarball "$TC_DIR")
-	ls -l $tarball
-else
-	echo "---- Skipping tarball creation"
-fi
 
 if [[ $# -gt 0 ]]; then
 	projects=( "$*" )
 else
 	# get all subdirs containing build/build_rpm.sh
 	projects_to_build=( */build/build_rpm.sh )
-	projects=()
+	# Always build tarball when building everything..
+	projects=(tarball)
 	for p in "${projects_to_build[@]}"; do
 	  p=${p%%/*}
 	  projects+=($p)
 	done
 fi
 
+
 declare -a badproj
 declare -a goodproj
 for p in "${projects[@]}"; do
+	if [[ $p == tarball ]]; then
+		if isInGitTree; then
+			echo "-----  Building tarball ..."
+			tarball=$(createTarball "$TC_DIR")
+			ls -l $tarball
+		else
+			echo "---- Skipping tarball creation"
+		fi
+		continue
+	fi
 	# strip trailing /
 	p=${p%/}
 	bldscript="$p/build/build_rpm.sh"

http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/4cf95296/build/functions.sh
----------------------------------------------------------------------
diff --git a/build/functions.sh b/build/functions.sh
index 8cbdbd5..54fc04c 100755
--- a/build/functions.sh
+++ b/build/functions.sh
@@ -103,7 +103,7 @@ function checkEnvironment {
 
 	# verify required tools available in path -- extra tools required by subsystem are passed in
 	for pgm in git rpmbuild "$@"; do
-		type $pgm 2>/dev/null || { echo "$pgm not found in PATH"; exit 1; }
+		type $pgm 2>/dev/null || { echo "$pgm not found in PATH"; }
 	done
 	# verify git version
 	requiredGitVersion=1.7.12

http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/4cf95296/infrastructure/docker/build/Dockerfile-source
----------------------------------------------------------------------
diff --git a/infrastructure/docker/build/Dockerfile-source b/infrastructure/docker/build/Dockerfile-source
new file mode 100644
index 0000000..5eb2c89
--- /dev/null
+++ b/infrastructure/docker/build/Dockerfile-source
@@ -0,0 +1,33 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+FROM centos:7
+
+MAINTAINER Dan Kirkwood
+
+###
+# top level of trafficcontrol directory must be mounted as a volume:
+# docker run --volume /trafficcontrol:$(pwd) ...
+VOLUME /trafficcontrol
+
+RUN	yum -y install \
+		git && \
+	yum -y clean all
+
+WORKDIR /trafficcontrol
+CMD ./build/build.sh tarball
+
+# vi:syntax=Dockerfile

http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/4cf95296/infrastructure/docker/build/docker-compose.yml
----------------------------------------------------------------------
diff --git a/infrastructure/docker/build/docker-compose.yml b/infrastructure/docker/build/docker-compose.yml
index a59d532..518ed86 100644
--- a/infrastructure/docker/build/docker-compose.yml
+++ b/infrastructure/docker/build/docker-compose.yml
@@ -18,6 +18,14 @@
 version: '2'
 
 services:
+  source:
+    image: trafficcontrol_tarball
+    build:
+      dockerfile: infrastructure/docker/build/Dockerfile-source
+      context: ../../..
+    volumes:
+      - ../../..:/trafficcontrol
+
   traffic_monitor_build:
     image: traffic_monitor_builder
     build: