You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@brooklyn.apache.org by ge...@apache.org on 2017/04/25 08:10:28 UTC

[1/4] brooklyn-client git commit: set sensible defaults (`.` is not a valid GOPATH)

Repository: brooklyn-client
Updated Branches:
  refs/heads/master 3486f6ff4 -> d705af1f4


set sensible defaults (`.` is not a valid GOPATH)


Project: http://git-wip-us.apache.org/repos/asf/brooklyn-client/repo
Commit: http://git-wip-us.apache.org/repos/asf/brooklyn-client/commit/98b22913
Tree: http://git-wip-us.apache.org/repos/asf/brooklyn-client/tree/98b22913
Diff: http://git-wip-us.apache.org/repos/asf/brooklyn-client/diff/98b22913

Branch: refs/heads/master
Commit: 98b22913f9bd1095c49ce8eb78e0bcfc04a3abb5
Parents: 95d1fb0
Author: Alex Heneveld <al...@cloudsoftcorp.com>
Authored: Mon Apr 24 11:42:58 2017 +0100
Committer: Alex Heneveld <al...@cloudsoftcorp.com>
Committed: Mon Apr 24 11:42:58 2017 +0100

----------------------------------------------------------------------
 cli/release/build.sh | 11 +++--------
 1 file changed, 3 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/brooklyn-client/blob/98b22913/cli/release/build.sh
----------------------------------------------------------------------
diff --git a/cli/release/build.sh b/cli/release/build.sh
index 6f91ed4..c8089b4 100755
--- a/cli/release/build.sh
+++ b/cli/release/build.sh
@@ -36,8 +36,8 @@ START_TIME=$(date +%s)
 os=""
 arch=""
 all=""
-outdir="."
-sourcedir="."
+outdir=`pwd`/target
+sourcedir=`pwd`
 label=""
 timestamp=""
 
@@ -174,12 +174,7 @@ See golang.org for more information, or run maven with '-Dno-go-client' to skip.
   exit 1
 fi
 
-
-if [ -n "$outdir" -a ! -d "$outdir" ]; then
-	show_help
-	echo "No such directory: $outdir"
-	exit 1
-fi
+mkdir -p $outdir
 
 # Set GOPATH to $outdir and link to source code.
 export GOPATH=${outdir}


[3/4] brooklyn-client git commit: code review

Posted by ge...@apache.org.
code review


Project: http://git-wip-us.apache.org/repos/asf/brooklyn-client/repo
Commit: http://git-wip-us.apache.org/repos/asf/brooklyn-client/commit/b6657c7a
Tree: http://git-wip-us.apache.org/repos/asf/brooklyn-client/tree/b6657c7a
Diff: http://git-wip-us.apache.org/repos/asf/brooklyn-client/diff/b6657c7a

Branch: refs/heads/master
Commit: b6657c7ae4595faf4088778468343f33cb9a754c
Parents: 1e0268d
Author: Alex Heneveld <al...@cloudsoftcorp.com>
Authored: Mon Apr 24 13:30:40 2017 +0100
Committer: Alex Heneveld <al...@cloudsoftcorp.com>
Committed: Mon Apr 24 13:30:40 2017 +0100

----------------------------------------------------------------------
 cli/README.md | 23 +++++++++++++++--------
 1 file changed, 15 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/brooklyn-client/blob/b6657c7a/cli/README.md
----------------------------------------------------------------------
diff --git a/cli/README.md b/cli/README.md
index 4039061..532711a 100644
--- a/cli/README.md
+++ b/cli/README.md
@@ -24,21 +24,28 @@ Optional:
 
 Go is very particular about the layout of a source tree and the source repository, 
 as it relies on this in the naming of packages.  
-Developers familiar with [`$GOPATH`](http://golang.org/cmd/go/#hdr-GOPATH_environment_variable) -- or on OS's that don't support soft links --
-may prefer to `go get github.com/apache/brooklyn-client/cli/br` and
-run github commands (branching and adding remote forks) in the that subdir
-under `$GOPATH/src`. However for new users we recommend the instructions here
-setting up Go to work against a normal checked-out project (not under the `GOPATH`).
 
-First ensure that your `GOPATH` is set, for example:
+If you're familiar with Go and just want to develop the `br` tool itself you may simply work in your usual `GOPATH`, 
+using `go get github.com/apache/brooklyn-client/cli/br` and adding your own fork as a remote. 
+If you know `glide` then you probably know what to do and can ignore these instructions;
+`br` is built just like any other Go project. 
+
+If you're new to Go and you want to work on the CLI alongside non-Go components in Apache Brooklyn,
+then the common Go setup -- where code lives under the `GOPATH` -- may be tedious to work with.
+A good pattern is to have the requisite `GOPATH` entry linking to the `brooklyn-client` project
+elsewhere on disk, so you have just one copy in the usual space and there is no need to touch the `GOPATH` thereafter.
+This is the recommended default described by the instructions below.
+
+First ensure that a `GOPATH` is set; this is where Go will store its files. 
+`~/go` is the default, and `~/.go` is acceptable also. For example:
 
 ```bash
 export GOPATH=$HOME/go
 ```
 
-These instructions assume you have `brooklyn-client` checked out and are
+These instructions now assume that you have `brooklyn-client` checked out and are
 in the `cli` subdirectory, where this file resides. 
-Tell Go to use this checked-out folder by linking to it under `GOPATH`:
+Tell Go to use this checked-out project by linking to it under `GOPATH`:
 
 ```bash
 rm -rf $GOPATH/src/github.com/apache/brooklyn-client


[2/4] brooklyn-client git commit: improve README instructions

Posted by ge...@apache.org.
improve README instructions

- clearer for new users
- the checked-out folder is used (no need for a second copy)
- glide doesn't have to be on the path (it wasn't for me)
- release/build.sh can be used directly


Project: http://git-wip-us.apache.org/repos/asf/brooklyn-client/repo
Commit: http://git-wip-us.apache.org/repos/asf/brooklyn-client/commit/1e0268de
Tree: http://git-wip-us.apache.org/repos/asf/brooklyn-client/tree/1e0268de
Diff: http://git-wip-us.apache.org/repos/asf/brooklyn-client/diff/1e0268de

Branch: refs/heads/master
Commit: 1e0268dea9c8b070171831da8df4b41598034f00
Parents: 98b2291
Author: Alex Heneveld <al...@cloudsoftcorp.com>
Authored: Mon Apr 24 11:53:50 2017 +0100
Committer: Alex Heneveld <al...@cloudsoftcorp.com>
Committed: Mon Apr 24 11:53:50 2017 +0100

----------------------------------------------------------------------
 cli/README.md | 70 +++++++++++++++++++++++++++++++++++++-----------------
 1 file changed, 48 insertions(+), 22 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/brooklyn-client/blob/1e0268de/cli/README.md
----------------------------------------------------------------------
diff --git a/cli/README.md b/cli/README.md
index 1602759..4039061 100644
--- a/cli/README.md
+++ b/cli/README.md
@@ -10,8 +10,9 @@ A command line client for [Apache Brooklyn](https://brooklyn.apache.org).
 The CLI tool is written in Go and should be obtained and built as a standard Go project. 
 You will need the following tools to build it:
 
-- Go (version 1.6.1 or higher), with full cross-compiler support (see https://golang.org/dl).
-  On Mac, if using Homebrew, use "brew install go --with-cc-all"
+- Go (version 1.6.1 or higher), with full cross-compiler support: 
+the standard [binary packages](https://golang.org/dl) include this,
+or you can use your favorite package managers (e.g. `brew install go --with-cc-all`).
 
 Optional:
 - Maven (used by the Brooklyn build process)
@@ -21,34 +22,54 @@ Optional:
 
 ## Workspace Setup
 
-Go is very particular about the layout of a source tree, and the naming of packages.  It is therefore important to 
-get the code from github.com/apache/brooklyn-client/cli and not your own fork. If you want to contribute to the 
-project, the procedure to follow is still to get the code from github.com/apache/brooklyn-client/cli, and then to add your
-own fork as a remote. 
+Go is very particular about the layout of a source tree and the source repository, 
+as it relies on this in the naming of packages.  
+Developers familiar with [`$GOPATH`](http://golang.org/cmd/go/#hdr-GOPATH_environment_variable) -- or on OS's that don't support soft links --
+may prefer to `go get github.com/apache/brooklyn-client/cli/br` and
+run github commands (branching and adding remote forks) in the that subdir
+under `$GOPATH/src`. However for new users we recommend the instructions here
+setting up Go to work against a normal checked-out project (not under the `GOPATH`).
 
-- Ensure your [$GOPATH](http://golang.org/cmd/go/#hdr-GOPATH_environment_variable) is set correctly 
-  to a suitable location for your Go code, for example, simply $HOME/go.
-- Get the Brooklyn CLI and dependencies. 
+First ensure that your `GOPATH` is set, for example:
 
 ```bash
-go get github.com/apache/brooklyn-client/cli/br
+export GOPATH=$HOME/go
 ```
 
-    
+These instructions assume you have `brooklyn-client` checked out and are
+in the `cli` subdirectory, where this file resides. 
+Tell Go to use this checked-out folder by linking to it under `GOPATH`:
+
+```bash
+rm -rf $GOPATH/src/github.com/apache/brooklyn-client
+cd ..
+ln -s `pwd` $GOPATH/src/github.com/apache/brooklyn-client
+cd cli
+```
+
+
 ## Installing Dependencies
 
-The CLI has a small number of dependencies, notably on `urfave/cli`.  To manage the version of dependencies, the CLI
-code currently uses [Glide](https://github.com/Masterminds/glide). The dependencies are installed to the top level 'vendor' directory.
+The CLI has a small number of dependencies, including the popular `urfave/cli`.
+To manage the version of dependencies, the CLI
+code currently uses [Glide](https://github.com/Masterminds/glide) to fetch
+and maintain these:
 
 ```bash
 go get github.com/Masterminds/glide
-cd $GOPATH/src/github.com/apache/brooklyn-client/cli
-glide install
+$GOPATH/bin/glide install
 ```
 
+
 ## Compiling the code with Go for development purposes
 
-Just use the regular Go build commands.
+Just use the regular Go build commands:
+
+```bash
+go build -o target/br ./br
+```
+
+The binary is now ready to use in `target/br`. 
 
 
 ## Testing 
@@ -64,11 +85,11 @@ sh test.sh  http://your-brooklyn-host:8081 myuser mypassword
 
 Note, the tests are not yet comprehensive, and contributions are welcome.
 
+
 ## Building the code as part of the Brooklyn build process
 
 For consistency with the other sub-projects of the overall [Brooklyn](https://github.com/apache/brooklyn) build, Maven
-is used to perform the build when brooklyn-client is built as one of the sub-modules of Brooklyn.  Most of the work is
-delegated to the release/build.sh script, which cross-compiles the code for a number of platform-architecture combinations.
+is used to perform the build when brooklyn-client is built as one of the sub-modules of Brooklyn, cross-compiling the code for a number of platform-architecture combinations.
 
 Invoke the build script via Maven with one of 
 
@@ -82,8 +103,8 @@ location, the Maven build makes no assumption about the location of the project
 `target` directory is used as the GOPATH, and a soft link is created as `target/src/github.com/apache/brooklyn-cli` to 
 the code in the root directory. 
 
-This builds the requested binaries into the "target" directory, each in its own subdirectory with a name that includes 
-the platform/architecture details, e.g. bin/linux.386/br.  The build installs a maven artifact to the maven repository,
+This builds the requested binaries into the `target/` directory, each in its own subdirectory with a name that includes 
+the platform/architecture details, e.g. `bin/linux.386/br`.  The build installs a maven artifact to the maven repository,
 consisting of a zip file containing all the binaries.  This artifact can be referenced in a POM as
 
 ```xml
@@ -91,14 +112,19 @@ consisting of a zip file containing all the binaries.  This artifact can be refe
 <artifactId>brooklyn-client-cli</artifactId>
 <classifier>bin</classifier>
 <type>zip</type>
-<version>...</version>
+<version>0.12.0-SNAPSHOT</version>  <!-- BROOKLYN_VERSION -->
 ```
 
+Most of the work is delegated to the `release/build.sh` script;
+it is not normally necessary to use this, but if you need to know more,
+try `release/build.sh -h` for more information.
+
 
-## Running
+## Usage
 
 See instructions in the included [Runtime README](release/files/README) file.
 
+
 ----
 Licensed to the Apache Software Foundation (ASF) under one 
 or more contributor license agreements.  See the NOTICE file


[4/4] brooklyn-client git commit: Closes #47

Posted by ge...@apache.org.
Closes #47

simpler go CLI project setup and tweaks to instructions for n00bs


Project: http://git-wip-us.apache.org/repos/asf/brooklyn-client/repo
Commit: http://git-wip-us.apache.org/repos/asf/brooklyn-client/commit/d705af1f
Tree: http://git-wip-us.apache.org/repos/asf/brooklyn-client/tree/d705af1f
Diff: http://git-wip-us.apache.org/repos/asf/brooklyn-client/diff/d705af1f

Branch: refs/heads/master
Commit: d705af1f4811d1d9bfa5c0dcb53d6a9a711be720
Parents: 3486f6f b6657c7
Author: Geoff Macartney <ge...@cloudsoftcorp.com>
Authored: Tue Apr 25 09:10:14 2017 +0100
Committer: Geoff Macartney <ge...@cloudsoftcorp.com>
Committed: Tue Apr 25 09:10:14 2017 +0100

----------------------------------------------------------------------
 cli/README.md        | 77 +++++++++++++++++++++++++++++++++--------------
 cli/release/build.sh | 11 ++-----
 2 files changed, 58 insertions(+), 30 deletions(-)
----------------------------------------------------------------------