You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@brooklyn.apache.org by sv...@apache.org on 2016/04/05 17:36:45 UTC
[1/3] brooklyn-client git commit: Update build so that it includes
only the files that we want.
Repository: brooklyn-client
Updated Branches:
refs/heads/master 99daadcbc -> 23421fcf0
Update build so that it includes only the files that we want.
Reduces build time and distribution size.
This was discussed in relation to previous commits, see
https://github.com/apache/brooklyn-docs/pull/25#discussion_r55650931
Project: http://git-wip-us.apache.org/repos/asf/brooklyn-client/repo
Commit: http://git-wip-us.apache.org/repos/asf/brooklyn-client/commit/98c4f985
Tree: http://git-wip-us.apache.org/repos/asf/brooklyn-client/tree/98c4f985
Diff: http://git-wip-us.apache.org/repos/asf/brooklyn-client/diff/98c4f985
Branch: refs/heads/master
Commit: 98c4f985c43f6d06806f03b61c67d47951ca3d85
Parents: 5194b68
Author: Geoff Macartney <ge...@cloudsoftcorp.com>
Authored: Mon Apr 4 17:13:26 2016 +0100
Committer: Geoff Macartney <ge...@cloudsoftcorp.com>
Committed: Mon Apr 4 17:13:26 2016 +0100
----------------------------------------------------------------------
release/assembly.xml | 2 +-
release/build.sh | 50 +++++++++++++++++++++++++++++++++++------------
2 files changed, 38 insertions(+), 14 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/brooklyn-client/blob/98c4f985/release/assembly.xml
----------------------------------------------------------------------
diff --git a/release/assembly.xml b/release/assembly.xml
index 893d2c8..8a32f91 100644
--- a/release/assembly.xml
+++ b/release/assembly.xml
@@ -36,7 +36,7 @@
<directory>${project.build.directory}/bin</directory>
<outputDirectory><!-- leave blank, meaning 'root of archive' --></outputDirectory>
<includes>
- <include>**/br</include>
+ <include>**/br*</include>
</includes>
</fileSet>
</fileSets>
http://git-wip-us.apache.org/repos/asf/brooklyn-client/blob/98c4f985/release/build.sh
----------------------------------------------------------------------
diff --git a/release/build.sh b/release/build.sh
index e524f17..f7cf01c 100755
--- a/release/build.sh
+++ b/release/build.sh
@@ -20,7 +20,7 @@
#
# Constants
#
-OSVALUES="darwin freebsd linux netbsd openbsd windows"
+OSVALUES="darwin linux windows"
ARCHVALUES="386 amd64"
BRNAME="br"
GOPACKAGE="github.com/apache/brooklyn-client/${BRNAME}"
@@ -42,6 +42,18 @@ sourcedir="."
label=""
timestamp=""
+declare -a builds
+function add_build () {
+ builds[${#builds[@]}]=$1
+}
+
+add_build darwin/amd64
+add_build linux/386
+add_build linux/amd64
+add_build windows/386
+add_build windows/amd64
+
+
show_help() {
#
# -A Build for all OS/ARCH combinations
@@ -210,10 +222,28 @@ mkdir -p ${GOPATH}/bin
# Disable use of C code modules (causes problems with cross-compiling)
export CGO_ENABLED=0
+# build requested file
+function build_cli () {
+ local filepath=$1
+ mkdir -p ${filepath%/*}
+ $GODEP $GOBIN build -ldflags "-s" -o $filepath $CLI_PACKAGE || return $?
+}
+
+# Do a build for one platorm, usage like: build_for_platform darwin/amd64
+function build_for_platform () {
+ local os=${1%/*}
+ local arch=${1#*/}
+ local BINARY=${BRNAME}
+ if [ "windows" = $os ] ; then
+ BINARY=${BINARY}.exe
+ fi
+ GOOS="$os" GOARCH="$arch" build_cli "${GOPATH}/bin/$os.$arch/${BINARY}${label}" || return $?
+}
+
# Build as instructed
if [ -z "$os" -a -z "$all" ]; then
echo "Building $BRNAME for native OS/ARCH"
- $GODEP $GOBIN build -ldflags "-s" -o "${GOPATH}/bin/${BRNAME}${label}${timestamp}" $CLI_PACKAGE || exit $?
+ build_cli "${GOPATH}/bin/${BRNAME}${label}${timestamp}" || exit $?
elif [ -z "$all" ]; then
validos=`expr " $OSVALUES " : ".* $os "`
if [ "$validos" -eq 0 ]; then
@@ -227,19 +257,13 @@ elif [ -z "$all" ]; then
echo "Unrecognised ARCH: $arch"
exit 1
fi
- echo "Building $BRNAME for $os/$arch"
- mkdir -p ${GOPATH}/bin/$os.$arch
- GOOS="$os" GOARCH="$arch" $GODEP $GOBIN build -ldflags "-s" -o "${GOPATH}/bin/$os.$arch/${BRNAME}${label}" $CLI_PACKAGE || exit $?
+ echo "Building $BRNAME for $os/$arch:"
+ build_for_platform $os/$arch || exit $?
else
echo "Building $BRNAME for all OS/ARCH:"
- os="$OSVALUES"
- arch="$ARCHVALUES"
- for archv in $arch; do
- for osv in $os; do
- echo " $osv/$archv"
- mkdir -p ${GOPATH}/bin/$osv.$archv
- GOOS="$osv" GOARCH="$archv" $GODEP $GOBIN build -ldflags "-s" -o "${GOPATH}/bin/$osv.$archv/${BRNAME}${label}" $CLI_PACKAGE || exit $?
- done
+ for build in ${builds[@]}; do
+ echo " $build"
+ build_for_platform $build || exit $?
done
fi
[2/3] brooklyn-client git commit: Just build 32 bit binaries on linux
& windows.
Posted by sv...@apache.org.
Just build 32 bit binaries on linux & windows.
Will work for both 32 & 64 bit OSes.
Project: http://git-wip-us.apache.org/repos/asf/brooklyn-client/repo
Commit: http://git-wip-us.apache.org/repos/asf/brooklyn-client/commit/ed878922
Tree: http://git-wip-us.apache.org/repos/asf/brooklyn-client/tree/ed878922
Diff: http://git-wip-us.apache.org/repos/asf/brooklyn-client/diff/ed878922
Branch: refs/heads/master
Commit: ed878922e6c3e6e38a9eba4e1a4c7cc10e695358
Parents: 98c4f98
Author: Geoff Macartney <ge...@cloudsoftcorp.com>
Authored: Tue Apr 5 16:23:56 2016 +0100
Committer: Geoff Macartney <ge...@cloudsoftcorp.com>
Committed: Tue Apr 5 16:23:56 2016 +0100
----------------------------------------------------------------------
release/build.sh | 51 ++++++++++++++++++++++++++-------------------------
1 file changed, 26 insertions(+), 25 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/brooklyn-client/blob/ed878922/release/build.sh
----------------------------------------------------------------------
diff --git a/release/build.sh b/release/build.sh
index f7cf01c..6561641 100755
--- a/release/build.sh
+++ b/release/build.sh
@@ -20,7 +20,7 @@
#
# Constants
#
-OSVALUES="darwin linux windows"
+OSVALUES="darwin freebsd linux netbsd openbsd windows"
ARCHVALUES="386 amd64"
BRNAME="br"
GOPACKAGE="github.com/apache/brooklyn-client/${BRNAME}"
@@ -42,35 +42,36 @@ sourcedir="."
label=""
timestamp=""
-declare -a builds
-function add_build () {
- builds[${#builds[@]}]=$1
-}
-
-add_build darwin/amd64
-add_build linux/386
-add_build linux/amd64
-add_build windows/386
-add_build windows/amd64
-
+builds=(
+ darwin/amd64
+ linux/386
+ windows/386
+)
show_help() {
-#
-# -A Build for all OS/ARCH combinations
-# -a Set ARCH to build for
-# -d Set output directory
-# -h Show help
-# -l Set label text for including in filename
-# -o Set OS to build for
-# -t Set timestamp for including in filename
-# -s Source directory
echo "Usage: $0 [-d <OUTPUTDIR>] [-l <LABEL>] [-t] -s <SOURCEDIR>"
echo " $0 -o <OS> -a <ARCH> [-d <DIRECTORY>] [-l <LABEL>] [-t] -s <SOURCEDIR>"
echo " $0 -A [-d <OUTPUTDIR>] [-l <LABEL>] [-t] -s <SOURCEDIR>"
echo " $0 -h"
- echo $OSVALUES | awk 'BEGIN{printf("OS:\n")};{for(i=1;i<=NF;i++){printf("\t%s\n",$i)}}'
- echo $ARCHVALUES | awk 'BEGIN{printf("ARCH:\n")};{for(i=1;i<=NF;i++){printf("\t%s\n",$i)}}'
echo
+ cat <<-EOH
+ -A Build for default OS/ARCH combinations
+ -a Set ARCH to build for
+ -d Set output directory
+ -h Show help
+ -l Set label text for including in filename
+ -o Set OS to build for
+ -t Set timestamp for including in filename
+ -s Source directory
+
+EOH
+
+ echo $OSVALUES | awk 'BEGIN{printf("Supported OS:\n")};{for(i=1;i<=NF;i++){printf("\t%s\n",$i)}}'
+ echo $ARCHVALUES | awk 'BEGIN{printf("Supported ARCH:\n")};{for(i=1;i<=NF;i++){printf("\t%s\n",$i)}}'
+ echo Default build:
+ for build in ${builds[@]} ; do
+ printf "\t%s\n" $build
+ done
}
while [ $# -gt 0 ]; do
@@ -260,7 +261,7 @@ elif [ -z "$all" ]; then
echo "Building $BRNAME for $os/$arch:"
build_for_platform $os/$arch || exit $?
else
- echo "Building $BRNAME for all OS/ARCH:"
+ echo "Building $BRNAME for default OS/ARCH:"
for build in ${builds[@]}; do
echo " $build"
build_for_platform $build || exit $?
@@ -270,7 +271,7 @@ fi
echo
echo Successfully built the following binaries:
echo
-ls -alR ${GOPATH}/bin/
+ls -lR ${GOPATH}/bin
echo
END_TIME=$(date +%s)
[3/3] brooklyn-client git commit: Closes #14
Posted by sv...@apache.org.
Closes #14
Update build so that it includes only the files that we want.
Reduces build time and distribution size.
This was discussed in relation to previous commits, see
https://github.com/apache/brooklyn-docs/pull/25#discussion_r55650931
Also builds executables called "br.exe" when building for Windows.
Project: http://git-wip-us.apache.org/repos/asf/brooklyn-client/repo
Commit: http://git-wip-us.apache.org/repos/asf/brooklyn-client/commit/23421fcf
Tree: http://git-wip-us.apache.org/repos/asf/brooklyn-client/tree/23421fcf
Diff: http://git-wip-us.apache.org/repos/asf/brooklyn-client/diff/23421fcf
Branch: refs/heads/master
Commit: 23421fcf01024ebb7f05d16748d13120713eaa1e
Parents: 99daadc ed87892
Author: Svetoslav Neykov <sv...@cloudsoftcorp.com>
Authored: Tue Apr 5 18:35:29 2016 +0300
Committer: Svetoslav Neykov <sv...@cloudsoftcorp.com>
Committed: Tue Apr 5 18:35:29 2016 +0300
----------------------------------------------------------------------
release/assembly.xml | 2 +-
release/build.sh | 75 +++++++++++++++++++++++++++++++----------------
2 files changed, 51 insertions(+), 26 deletions(-)
----------------------------------------------------------------------