brooklyn-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From henev...@apache.org
Subject [15/29] incubator-brooklyn 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
Date Sat, 30 Jan 2016 03:38:40 GMT
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/incubator-brooklyn/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/commit/43833863
Tree: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/tree/43833863
Diff: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/diff/43833863

Branch: refs/heads/master
Commit: 43833863b2f9b5663059df170de2ab5dd74e739c
Parents: b3c222c
Author: John McCabe <john@johnmccabe.net>
Authored: Sun Jan 24 23:41:26 2016 +0000
Committer: John McCabe <john@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/incubator-brooklyn/blob/43833863/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/incubator-brooklyn/blob/43833863/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"]


Mime
View raw message