brooklyn-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From henev...@apache.org
Subject [22/50] brooklyn-docs git commit: Some more improvements to the example bash snippets
Date Mon, 01 Feb 2016 17:28:56 GMT
Some more improvements to the example bash snippets

* Remove "%" form bash snippets. This allows users to use the "copy to clipboard" feature
of the site and paste in their bash terminal.
* Split long lines that don't fit in the site layout
* Move the all the redundant BROOKLYN_CLASSPATH exports to the top of the file


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

Branch: refs/heads/0.4.0
Commit: ea8fb02569d420585e6b97024c3521cde5061a69
Parents: 7d36a41
Author: Cosmin Dumitrache <cosmin.dumitrache@cloudsoftcorp.com>
Authored: Wed Jul 25 17:47:42 2012 +0100
Committer: Cosmin Dumitrache <cosmin.dumitrache@cloudsoftcorp.com>
Committed: Wed Jul 25 18:31:30 2012 +0100

----------------------------------------------------------------------
 docs/use/examples/before-begin.include.md       | 23 ++++++++++----------
 docs/use/examples/global-web-fabric/index.md    | 13 ++++++++---
 docs/use/examples/messaging/index.md            | 23 +++++++++++++-------
 .../use/examples/portable-cloudfoundry/index.md | 13 ++++++++---
 .../examples/webcluster/webcluster.include.md   | 21 ++++++++++++------
 .../examples/whirrhadoop/whirrhadoop.include.md | 17 ++++++++++-----
 6 files changed, 73 insertions(+), 37 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/brooklyn-docs/blob/ea8fb025/docs/use/examples/before-begin.include.md
----------------------------------------------------------------------
diff --git a/docs/use/examples/before-begin.include.md b/docs/use/examples/before-begin.include.md
index 8fa1aad..8947eb3 100644
--- a/docs/use/examples/before-begin.include.md
+++ b/docs/use/examples/before-begin.include.md
@@ -5,22 +5,23 @@ To use the examples, you'll need ``curl``, ``java``, and ``maven`` (v3)
installe
 First, grab a copy of the Brooklyn distribution:
 
 {% highlight bash %}
-% # download and unpack
-% curl -L http://developers.cloudsoftcorp.com/maven/releases/io/brooklyn/brooklyn-dist/0.4.0-M2/brooklyn-dist-0.4.0-M2-dist.tar.gz
| tar xzv
-% # set up an environment variable to point to it for convenience
-% export BROOKLYN_HOME=$(pwd)/brooklyn
+# download and unpack
+curl -L http://developers.cloudsoftcorp.com/maven/releases/io/brooklyn/brooklyn-dist/0.4.0-M2/\
+brooklyn-dist-0.4.0-M2-dist.tar.gz | tar xzf -
+# set up an environment variable to point to it for convenience
+export BROOKLYN_HOME=$(pwd)/brooklyn
 {% endhighlight %}
 
 Then, grab a copy of the brooklyn-examples source code and build with Maven:
 
 {% highlight bash %}
-% # download and unpack
-% curl -L https://github.com/brooklyncentral/brooklyn-examples/tarball/0.4.0-M2 | tar xzv
-% # set up an environment variable to point to it for convenience
-% export BROOKLYN_EXAMPLES_DIR=$(pwd)/brooklyncentral-brooklyn-examples-b296711
-% # build with Maven
-% cd ${BROOKLYN_EXAMPLES_DIR}
-% mvn clean install
+# download and unpack
+curl -L https://github.com/brooklyncentral/brooklyn-examples/tarball/0.4.0-M2 | tar xzf -
+# set up an environment variable to point to it for convenience
+export BROOKLYN_EXAMPLES_DIR=$(pwd)/brooklyncentral-brooklyn-examples-b296711
+# build with Maven
+cd ${BROOKLYN_EXAMPLES_DIR}
+mvn clean install
 {% endhighlight %}
 
 For more information about where to download brooklyn please

http://git-wip-us.apache.org/repos/asf/brooklyn-docs/blob/ea8fb025/docs/use/examples/global-web-fabric/index.md
----------------------------------------------------------------------
diff --git a/docs/use/examples/global-web-fabric/index.md b/docs/use/examples/global-web-fabric/index.md
index aa2270e..cde8006 100644
--- a/docs/use/examples/global-web-fabric/index.md
+++ b/docs/use/examples/global-web-fabric/index.md
@@ -14,7 +14,14 @@ but does not assume knowledge of either of these.
 
 {% readj ../before-begin.include.md %}
 
-The project ``examples/global-web-fabric`` contains the code used 
+The CLI needs to know where to find your compiled examples. You can set this up by exporting
+the ``BROOKLYN_CLASSPATH`` environment variable in the following way:
+
+{% highlight bash %}
+export BROOKLYN_CLASSPATH=${BROOKLYN_EXAMPLES_DIR}/global-web-fabric/target/classes
+{% endhighlight %}
+
+The project ``${BROOKLYN_EXAMPLES_DIR}/global-web-fabric`` contains the code used
 in this example under ``src/main/java``.
 
 
@@ -279,8 +286,8 @@ Now let's run this example.  You will need to specify increased heap size
and me
 as well as the appropriate classpath.
 
 {% highlight bash %}
-% BROOKLYN_CLASSPATH=$BROOKLYN_EXAMPLES/global-web-fabric/target/brooklyn-example-global-web-fabric-0.4.0-SNAPSHOT.jar
-% $BROOKLYN_HOME/bin/brooklyn -v launch --app brooklyn.demo.GlobalWebFabricExample --location
locahost
+${BROOKLYN_HOME}/bin/brooklyn launch --app brooklyn.demo.GlobalWebFabricExample \
+--location locahost
 {% endhighlight %}
 
 The management web console will start,

http://git-wip-us.apache.org/repos/asf/brooklyn-docs/blob/ea8fb025/docs/use/examples/messaging/index.md
----------------------------------------------------------------------
diff --git a/docs/use/examples/messaging/index.md b/docs/use/examples/messaging/index.md
index a2e4f96..42c4c9c 100644
--- a/docs/use/examples/messaging/index.md
+++ b/docs/use/examples/messaging/index.md
@@ -12,7 +12,14 @@ Java AMQP message broker and clients using the
 
 {% readj ../before-begin.include.md %}
 
-The project ``examples/simple-messaging-pubsub`` includes a deployment
+The CLI needs to know where to find your compiled examples. You can set this up by exporting
+the ``BROOKLYN_CLASSPATH`` environment variable in the following way:
+
+{% highlight bash %}
+export BROOKLYN_CLASSPATH=${BROOKLYN_EXAMPLES_DIR}/simple-messaging-pubsub/target/classes
+{% endhighlight %}
+
+The project ``${BROOKLYN_EXAMPLES_DIR}/simple-messaging-pubsub`` includes a deployment
 descriptor for our example messaging application and simple _Publish_
 and _Subscribe_ JMS test client scripts.
 
@@ -69,8 +76,8 @@ out the Brooklyn [repository](https://www.github.com/brooklyncentral/brooklyn)
 as follows:
 
 {% highlight bash %}
-% BROOKLYN_CLASSPATH=$EXAMPLES_HOME/simple-messaging-pubsub/target/brooklyn-example-simple-messaging-pubsub-0.4.0-SNAPSHOT.jar
-% $BROOKLYN_HOME/bin/brooklyn -v launch --app brooklyn.demo.StandaloneBrokerExample --location
localhost
+${BROOKLYN_HOME}/bin/brooklyn launch --app brooklyn.demo.StandaloneBrokerExample \
+--location localhost
 {% endhighlight %}
 
 Now, visit the the Brooklyn web console on port 8081 using credentials
@@ -110,9 +117,9 @@ below, and that any unquoted ``&`` characters *must* be escaped,
 if present.
 
 {% highlight bash %}
-% cd $EXAMPLES_DIR/simple-messaging-pubsub/brooklyn-example-simple-messaging-pubsub/bin
-% ./publish.sh "amqp://guest:guest@/localhost?brokerlist='tcp://localhost:5672'"
-% ./subscribe.sh "amqp://guest:guest@/localhost?brokerlist='tcp://localhost:5672'"
+cd ${BROOKLYN_EXAMPLES_DIR}/simple-messaging-pubsub/brooklyn-example-simple-messaging-pubsub/bin
+./publish.sh "amqp://guest:guest@/localhost?brokerlist='tcp://localhost:5672'"
+./subscribe.sh "amqp://guest:guest@/localhost?brokerlist='tcp://localhost:5672'"
 {% endhighlight %}
 
 In the _Publish_ window you should see a log message every time a
@@ -139,8 +146,8 @@ this can also be deployed to your favourite cloud, let's pretend
 it's Amazon Ireland, as follows:
 
 {% highlight bash %}
-% BROOKLYN_CLASSPATH=$BROOKLYN_EXAMPLES/simple-messaging-pubsub/target/brooklyn-example-simple-messaging-pubsub-0.4.0-SNAPSHOT.jar
-% $BROOKLYN_HOME/bin/brooklyn -v launch --app brooklyn.demo.StandaloneBrokerExample --location
aws-ec2:eu-west-1
+${BROOKLYN_HOME}/bin/brooklyn launch --app brooklyn.demo.StandaloneBrokerExample \
+--location aws-ec2:eu-west-1
 {% endhighlight %}
 
 If you encounter any difficulties, please

http://git-wip-us.apache.org/repos/asf/brooklyn-docs/blob/ea8fb025/docs/use/examples/portable-cloudfoundry/index.md
----------------------------------------------------------------------
diff --git a/docs/use/examples/portable-cloudfoundry/index.md b/docs/use/examples/portable-cloudfoundry/index.md
index 6cb2aa3..b7581de 100644
--- a/docs/use/examples/portable-cloudfoundry/index.md
+++ b/docs/use/examples/portable-cloudfoundry/index.md
@@ -18,7 +18,14 @@ than defining an application. On the plus side, entities are much easier
to re-u
 
 {% readj ../before-begin.include.md %}
 
-The project ``examples/portable-cloudfoundry`` contains the code used 
+The CLI needs to know where to find your compiled examples. You can set this up by exporting
+the ``BROOKLYN_CLASSPATH`` environment variable in the following way:
+
+{% highlight bash %}
+export BROOKLYN_CLASSPATH=${BROOKLYN_EXAMPLES_DIR}/portable-cloudfoundry/target/classes
+{% endhighlight %}
+
+The project ``${BROOKLYN_EXAMPLES_DIR}/portable-cloudfoundry`` contains the code used
 in this example in ``src/main/java``.
 
 
@@ -287,8 +294,8 @@ And finally, we'll define ``move``, as the sequence of the three effectors
above
 You can run the application using the provided shell script:
 
 {% highlight bash %}
-% BROOKLYN_CLASSPATH=$BROOKLYN_EXAMPLES/portable-cloudfoundry/target/brooklyn-example-portable-cloudfoundry-0.4.0-SNAPSHOT.jar
-% $BROOKLYN_HOME/bin/brooklyn -v launch --app brooklyn.example.cloudfoundry.MovableCloudFoundryClusterExample
--location localhost
+${BROOKLYN_HOME}/bin/brooklyn launch \
+--app brooklyn.example.cloudfoundry.MovableCloudFoundryClusterExample --location localhost
 {% endhighlight %}
 
 Note that we have our webapp running in Cloud Foundry, and we have the effectors we've introduced
exposed in the web console:

http://git-wip-us.apache.org/repos/asf/brooklyn-docs/blob/ea8fb025/docs/use/examples/webcluster/webcluster.include.md
----------------------------------------------------------------------
diff --git a/docs/use/examples/webcluster/webcluster.include.md b/docs/use/examples/webcluster/webcluster.include.md
index becefef..fab72e6 100644
--- a/docs/use/examples/webcluster/webcluster.include.md
+++ b/docs/use/examples/webcluster/webcluster.include.md
@@ -2,7 +2,14 @@
         
 {% readj ../before-begin.include.md %}
 
-The project ``examples/simple-web-cluster`` includes several deployment descriptors 
+The CLI needs to know where to find your compiled examples. You can set this up by exporting
+the ``BROOKLYN_CLASSPATH`` environment variable in the following way:
+
+{% highlight bash %}
+export BROOKLYN_CLASSPATH=${BROOKLYN_EXAMPLES_DIR}/simple-web-cluster/target/classes
+{% endhighlight %}
+
+The project ``${BROOKLYN_EXAMPLES_DIR}/simple-web-cluster`` includes several deployment descriptors
 for rolling out a web application, under ``src/main/java``.
 
 ## Simple Web Server
@@ -26,8 +33,8 @@ public class SingleWebServerExample extends AbstractApplication {
 You can run this (on *nix or Mac) as follows:
 
 {% highlight bash %}
-% BROOKLYN_CLASSPATH=$BROOKLYN_EXAMPLES/simple-web-cluster/target/brooklyn-example-simple-web-cluster-0.4.0-SNAPSHOT.jar
-% $BROOKLYN_HOME/bin/brooklyn launch --app brooklyn.demo.SingleWebServerExample --location
localhost
+${BROOKLYN_HOME}/bin/brooklyn launch --app brooklyn.demo.SingleWebServerExample \
+--location localhost
 {% endhighlight %}
 
 
@@ -40,8 +47,8 @@ With appropriate setup (as described [here]({{ site.url }}/use/guide/management/
 this can also be deployed to your favourite cloud, let's pretend it's Amazon Ireland, as
follows: 
 
 {% highlight bash %}
-% BROOKLYN_CLASSPATH=$BROOKLYN_EXAMPLES/simple-web-cluster/target/brooklyn-example-simple-web-cluster-0.4.0-SNAPSHOT.jar
-% $BROOKLYN_HOME/bin/brooklyn launch --app brooklyn.demo.SingleWebServerExample --location
aws-ec2:eu-west-1
+${BROOKLYN_HOME}/bin/brooklyn launch --app brooklyn.demo.SingleWebServerExample \
+--location aws-ec2:eu-west-1
 {% endhighlight %}
 
 
@@ -50,8 +57,8 @@ this can also be deployed to your favourite cloud, let's pretend it's Amazon
Ire
 Ready for something more interesting?  Try this:
 
 {% highlight bash %}
-% BROOKLYN_CLASSPATH=$BROOKLYN_EXAMPLES/simple-web-cluster/target/brooklyn-example-simple-web-cluster-0.4.0-SNAPSHOT.jar
-% $BROOKLYN_HOME/bin/brooklyn launch --app brooklyn.demo.WebClusterDatabaseExample --location
localhost
+${BROOKLYN_HOME}/bin/brooklyn launch --app brooklyn.demo.WebClusterDatabaseExample \
+--location localhost
 {% endhighlight %}
 
 This launches the class ``WebClusterDatabaseExample`` (also described in the [walkthrough]({{
site.url }}/start/walkthrough/index.html))

http://git-wip-us.apache.org/repos/asf/brooklyn-docs/blob/ea8fb025/docs/use/examples/whirrhadoop/whirrhadoop.include.md
----------------------------------------------------------------------
diff --git a/docs/use/examples/whirrhadoop/whirrhadoop.include.md b/docs/use/examples/whirrhadoop/whirrhadoop.include.md
index 4510150..145f2d2 100644
--- a/docs/use/examples/whirrhadoop/whirrhadoop.include.md
+++ b/docs/use/examples/whirrhadoop/whirrhadoop.include.md
@@ -1,6 +1,13 @@
 {% readj ../before-begin.include.md %}
 
-The project ``examples/hadoop-and-whirr`` includes deployment descriptors 
+The CLI needs to know where to find your compiled examples. You can set this up by exporting
+the ``BROOKLYN_CLASSPATH`` environment variable in the following way:
+
+{% highlight bash %}
+export BROOKLYN_CLASSPATH=${BROOKLYN_EXAMPLES_DIR}/hadoop-and-whirr/target/classes
+{% endhighlight %}
+
+The project ``${BROOKLYN_EXAMPLES_DIR}/hadoop-and-whirr`` includes deployment descriptors
 showing how to provision Whirr-based clusters from Brooklyn,
 including setting up a Hadoop recipe.
 
@@ -25,8 +32,8 @@ with an arbitrary size, with one line using the ``WhirrHadoopCluster`` entity.
 You can run this by running:
 
 {% highlight bash %}
-% BROOKLYN_CLASSPATH=$BROOKLYN_EXAMPLES/hadoop-and-whirr/target/brooklyn-example-hadoop-and-whirr-0.4.0-SNAPSHOT.jar
-% $BROOKLYN_HOME/bin/brooklyn launch --app brooklyn.extras.whirr.WhirrHadoopExample --stopOnKeyPress
--location aws-ec2:eu-west-1
+${BROOKLYN_HOME}/bin/brooklyn launch --app brooklyn.extras.whirr.WhirrHadoopExample \
+--stopOnKeyPress --location aws-ec2:eu-west-1
 {% endhighlight %}
 
 This targets ``aws-ec2:eu-west-1``,
@@ -58,8 +65,8 @@ whirr.instance-templates= 1 noop, 1 elasticsearch
 This can be launched by running:
 
 {% highlight bash %}
-% BROOKLYN_CLASSPATH=$BROOKLYN_EXAMPLES/hadoop-and-whirr/target/brooklyn-example-hadoop-and-whirr-0.4.0-SNAPSHOT.jar
-% $BROOKLYN_HOME/bin/brooklyn launch --app brooklyn.extras.whirr.WhirrExample --stopOnKeyPress
--location aws-ec2:eu-west-1
+${BROOKLYN_HOME}/bin/brooklyn launch --app brooklyn.extras.whirr.WhirrExample \
+--stopOnKeyPress --location aws-ec2:eu-west-1
 {% endhighlight %} 
 
 In the provided example this will deploy to AWS.


Mime
View raw message