You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@brooklyn.apache.org by he...@apache.org on 2016/02/01 18:35:11 UTC

[31/51] [abbrv] brooklyn-dist git commit: add -SNAPSHOT handling - aborts starting brooklyn VM with a warning and pointer to README - README describes how to update the Vagrantfile to point at the desired -SNAPSHOT source

add -SNAPSHOT handling
- aborts starting brooklyn VM with a warning and pointer to README
- README describes how to update the Vagrantfile to point at the desired -SNAPSHOT source


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

Branch: refs/heads/master
Commit: dcb2e2581a8fa46993bc658ceb49d00657ba350a
Parents: b1f392c
Author: John McCabe <jo...@johnmccabe.net>
Authored: Sun Jan 24 23:41:26 2016 +0000
Committer: John McCabe <jo...@johnmccabe.net>
Committed: Sun Jan 24 23:41:26 2016 +0000

----------------------------------------------------------------------
 .../vagrant/src/main/vagrant/README.md          | 63 ++++++++++++++++++++
 .../vagrant/src/main/vagrant/Vagrantfile        |  5 ++
 2 files changed, 68 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/brooklyn-dist/blob/dcb2e258/brooklyn-dist/vagrant/src/main/vagrant/README.md
----------------------------------------------------------------------
diff --git a/brooklyn-dist/vagrant/src/main/vagrant/README.md b/brooklyn-dist/vagrant/src/main/vagrant/README.md
new file mode 100644
index 0000000..b446ab8
--- /dev/null
+++ b/brooklyn-dist/vagrant/src/main/vagrant/README.md
@@ -0,0 +1,63 @@
+
+# [![**Brooklyn**](https://brooklyn.apache.org/style/img/apache-brooklyn-logo-244px-wide.png)](http://brooklyn.apache.org/)
+
+### Using Vagrant with Brooklyn -SNAPSHOT releases
+Due to the absence of a single source for snapshots (i.e. locally built vs. [periodically published archives](https://brooklyn.apache.org/v/0.9.0-SNAPSHOT/misc/download.html)), we require that you override the supplied `servers.yaml` to explicitly point at your desired `-SNAPSHOT` release.
+
+Full releases use the `BROOKLYN_VERSION` environment variable to download the associated `-bin` artifact from the closest Apache mirror, if this environment variable is set to a `-SNAPSHOT` we abort creating the Brooklyn Vagrant VM.
+
+##### Installing from local file
+For example to install from a locally built `-dist` archive:
+
+1. Copy the SNAPSHOT `-dist` archive to the same directory as the `Vagrantfile`
+
+   ```
+   cp  ~/Workspaces/incubator-brooklyn/brooklyn-dist/dist/target/brooklyn-dist-0.9.0-SNAPSHOT-dist.tar.gz .
+   ```
+
+2. Delete the `BROOKLYN_VERSION:` environment variable from `servers.yaml`. For example:
+
+   ```
+   env:
+     BROOKLYN_VERSION: 0.9.0-SNAPSHOT
+   ```
+
+3. Update `servers.yaml` to install from the `-dist` archive. For example, replace:
+   ```
+   - curl -s -S -J -O -L "https://www.apache.org/dyn/closer.cgi?action=download&filename=brooklyn/apache-brooklyn-${BROOKLYN_VERSION}/apache-brooklyn-${BROOKLYN_VERSION}-bin.tar.gz"
+   - tar zxf apache-brooklyn-${BROOKLYN_VERSION}-bin.tar.gz
+   - ln -s apache-brooklyn-${BROOKLYN_VERSION}-bin apache-brooklyn
+   ```
+   with:
+   ```
+   - cp /vagrant/brooklyn-dist-0.9.0-SNAPSHOT-dist.tar.gz .
+   - tar zxf brooklyn-dist-0.9.0-SNAPSHOT-dist.tar.gz
+   - ln -s brooklyn-dist-0.9.0-SNAPSHOT apache-brooklyn
+   ```
+
+4. You may proceed to use the `Vagrantfile` as normal; `vagrant up`, `vagrant destroy` etc.
+
+##### Installing from URL
+For example to install from a published `-SHAPSHOT` archive:
+
+1. Delete the `BROOKLYN_VERSION:` environment variable from `servers.yaml`. For example:
+
+   ```
+   env:
+     BROOKLYN_VERSION: 0.9.0-SNAPSHOT
+   ```
+
+2. Update `servers.yaml` to install from URL. For example, replace:
+   ```
+   - curl -s -S -J -O -L "https://www.apache.org/dyn/closer.cgi?action=download&filename=brooklyn/apache-brooklyn-${BROOKLYN_VERSION}/apache-brooklyn-${BROOKLYN_VERSION}-bin.tar.gz"
+   - tar zxf apache-brooklyn-${BROOKLYN_VERSION}-bin.tar.gz
+   - ln -s apache-brooklyn-${BROOKLYN_VERSION}-bin apache-brooklyn
+   ```
+   with:
+   ```
+   - curl -s -S -J -O -L "https://repository.apache.org/service/local/artifact/maven/redirect?r=snapshots&g=org.apache.brooklyn&a=brooklyn-dist&v=0.9.0-SNAPSHOT&c=dist&e=tar.gz"
+   - tar zxf brooklyn-dist-0.9.0-SNAPSHOT-dist.tar.gz
+   - ln -s brooklyn-dist-0.9.0-SNAPSHOT apache-brooklyn
+   ```
+
+3. You may proceed to use the `Vagrantfile` as normal; `vagrant up`, `vagrant destroy` etc.
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/brooklyn-dist/blob/dcb2e258/brooklyn-dist/vagrant/src/main/vagrant/Vagrantfile
----------------------------------------------------------------------
diff --git a/brooklyn-dist/vagrant/src/main/vagrant/Vagrantfile b/brooklyn-dist/vagrant/src/main/vagrant/Vagrantfile
index 395e8bc..7f5dbb0 100644
--- a/brooklyn-dist/vagrant/src/main/vagrant/Vagrantfile
+++ b/brooklyn-dist/vagrant/src/main/vagrant/Vagrantfile
@@ -38,6 +38,11 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
   # Iterate through server entries in YAML file
   yaml_cfg["servers"].each do |server|
     config.vm.define server["name"] do |server_config|
+
+      if server["shell"] && server["shell"]["env"]["BROOKLYN_VERSION"] =~ /SNAPSHOT/i
+        raise Vagrant::Errors::VagrantError.new, "Deploying Brooklyn SNAPSHOTS is not supported without a manual update to servers.yaml. See README for instructions."
+      end
+
       server_config.vm.box = server["box"]
 
       server_config.vm.box_check_update = yaml_cfg["default_config"]["check_newer_vagrant_box"]