You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficcontrol.apache.org by mi...@apache.org on 2016/11/11 02:45:13 UTC

[1/4] incubator-trafficcontrol git commit: add building of tarball with BUILDNUMBER file into build.sh

Repository: incubator-trafficcontrol
Updated Branches:
  refs/heads/master b48bdf595 -> d3fc60fa4


add building of tarball with BUILDNUMBER file into build.sh


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

Branch: refs/heads/master
Commit: ff11f8fafad0651c1990b9b877fb6f86f848b74a
Parents: b48bdf5
Author: Dan Kirkwood <da...@gmail.com>
Authored: Thu Nov 10 13:35:53 2016 -0700
Committer: Dan Kirkwood <da...@gmail.com>
Committed: Thu Nov 10 16:38:32 2016 -0700

----------------------------------------------------------------------
 build/build.sh     | 13 +++++++++++--
 build/functions.sh | 25 +++++++++++++++++++++++--
 2 files changed, 34 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/ff11f8fa/build/build.sh
----------------------------------------------------------------------
diff --git a/build/build.sh b/build/build.sh
index d82d249..de00b0a 100755
--- a/build/build.sh
+++ b/build/build.sh
@@ -20,8 +20,17 @@
 
 # make sure we start out in traffic_control dir
 topscript=$(readlink -f $0)
-top=$(dirname $(dirname "$topscript"))
-[[ -n $top ]] && cd "$top" || { echo "Could not cd $top"; exit 1; }
+export TC_DIR=$(dirname $(dirname "$topscript"))
+[[ -n $TC_DIR ]] && cd "$TC_DIR" || { echo "Could not cd $TC_DIR"; exit 1; }
+
+. build/functions.sh
+
+checkEnvironment
+
+# Create tarball first
+projName=$(basename $(pwd))
+createTarball "$TC_DIR"
+
 
 if [[ $# -gt 0 ]]; then
 	projects=( "$*" )

http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/ff11f8fa/build/functions.sh
----------------------------------------------------------------------
diff --git a/build/functions.sh b/build/functions.sh
index bb63530..edd5649 100755
--- a/build/functions.sh
+++ b/build/functions.sh
@@ -60,8 +60,12 @@ function getBuildNumber() {
 		local sha=$(git rev-parse --short=8 HEAD)
 		echo "$commits.$sha"
 	else
-		# TODO: is this a good method for generating a build number in absence of git?
-		tar cf - . | sha1sum || { echo "Could not produce sha1sum of tar'd directory"; exit 1; }
+		# Expect it's from the released tarball -- if BUILD_NUMBER file is not present,  abort
+		if [[ ! -f $TC_DIR/BUILD_NUMBER ]]; then
+			echo "Not in git repository and no BUILD_NUMBER present -- aborting!"
+			exit 1
+		fi
+		grep -v '^#' $TC_DIR/BUILD_NUMBER
 	fi
 }
 
@@ -145,3 +149,20 @@ function buildRpm () {
 		cp "$RPMBUILD/SRPMS/$srpm" "$DIST/." || { echo "Could not copy $srpm to $DIST: $?"; exit 1; }
 	done
 }
+
+# ---------------------------------------
+function createTarball() {
+	local projDir=$(cd "$1"; pwd)
+	local projName=$(basename $projDir)
+	local version=$(getVersion "$TC_DIR")
+	local buildNum=$(getBuildNumber)
+	local tarball="dist/$projName-$version.$buildNum.tar.gz"
+
+	# Create a BULDNUMBER file and add to tarball
+	local bndir=$(mktemp -d)
+        echo "$buildNum" >"$bndir/BUILD_NUMBER"
+
+        # create the tarball only from files in repo and BUILD_NUMBER
+        tar -czf "$tarball" -C "$bndir" BUILD_NUMBER -C "$projDir" --exclude-vcs --transform "s@^@$projName/@" $(git ls-files)
+        rm -r "$bndir"
+}


[4/4] incubator-trafficcontrol git commit: This closes #71

Posted by mi...@apache.org.
This closes #71


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

Branch: refs/heads/master
Commit: d3fc60fa448eec069f554849feb11140aa0cf5c2
Parents: 2eceb78
Author: Jeremy Mitchell <mi...@gmail.com>
Authored: Thu Nov 10 19:45:11 2016 -0700
Committer: Jeremy Mitchell <mi...@gmail.com>
Committed: Thu Nov 10 19:45:11 2016 -0700

----------------------------------------------------------------------

----------------------------------------------------------------------



[3/4] incubator-trafficcontrol git commit: return name of tarball

Posted by mi...@apache.org.
return name of tarball


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

Branch: refs/heads/master
Commit: 2eceb78e01ebe0f71f9c8e389bba392280327b06
Parents: 502d052
Author: Dan Kirkwood <da...@gmail.com>
Authored: Thu Nov 10 16:44:42 2016 -0700
Committer: Dan Kirkwood <da...@gmail.com>
Committed: Thu Nov 10 16:44:42 2016 -0700

----------------------------------------------------------------------
 build/functions.sh | 1 +
 1 file changed, 1 insertion(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/2eceb78e/build/functions.sh
----------------------------------------------------------------------
diff --git a/build/functions.sh b/build/functions.sh
index edd5649..2132064 100755
--- a/build/functions.sh
+++ b/build/functions.sh
@@ -165,4 +165,5 @@ function createTarball() {
         # create the tarball only from files in repo and BUILD_NUMBER
         tar -czf "$tarball" -C "$bndir" BUILD_NUMBER -C "$projDir" --exclude-vcs --transform "s@^@$projName/@" $(git ls-files)
         rm -r "$bndir"
+        echo "$tarball"
 }


[2/4] incubator-trafficcontrol git commit: announce building tarball

Posted by mi...@apache.org.
announce building tarball


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

Branch: refs/heads/master
Commit: 502d0526adb2e4be2a404a7fbc93b3b6d6323695
Parents: ff11f8f
Author: Dan Kirkwood <da...@gmail.com>
Authored: Thu Nov 10 16:43:21 2016 -0700
Committer: Dan Kirkwood <da...@gmail.com>
Committed: Thu Nov 10 16:43:21 2016 -0700

----------------------------------------------------------------------
 build/build.sh | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/502d0526/build/build.sh
----------------------------------------------------------------------
diff --git a/build/build.sh b/build/build.sh
index de00b0a..1327280 100755
--- a/build/build.sh
+++ b/build/build.sh
@@ -29,7 +29,9 @@ checkEnvironment
 
 # Create tarball first
 projName=$(basename $(pwd))
-createTarball "$TC_DIR"
+echo "-----  Building tarball ..."
+tarball=$(createTarball "$TC_DIR")
+ls -l $tarball
 
 
 if [[ $# -gt 0 ]]; then