move subdir from incubator up a level as it is promoted to its own repo (first non-incubator commit!)
Project: http://git-wip-us.apache.org/repos/asf/brooklyn-dist/repo Commit: http://git-wip-us.apache.org/repos/asf/brooklyn-dist/commit/26c4604c Tree: http://git-wip-us.apache.org/repos/asf/brooklyn-dist/tree/26c4604c Diff: http://git-wip-us.apache.org/repos/asf/brooklyn-dist/diff/26c4604c Branch: refs/heads/master Commit: 26c4604ca41d5b79829d595235b4fdc45b28aba9 Parents: e8c23d3 Author: Alex Heneveld <[email protected]> Authored: Sat Jan 30 12:59:53 2016 +0000 Committer: Alex Heneveld <[email protected]> Committed: Sat Jan 30 12:59:53 2016 +0000 ---------------------------------------------------------------------- .gitignore | 1 + README.md | 8 + all/pom.xml | 117 + archetypes/quickstart/NOTES.txt | 76 + archetypes/quickstart/pom.xml | 232 ++ .../quickstart/src/brooklyn-sample/README.md | 73 + .../quickstart/src/brooklyn-sample/pom.xml | 102 + .../src/main/assembly/assembly.xml | 88 + .../src/main/assembly/files/README.txt | 96 + .../src/main/assembly/files/conf/logback.xml | 11 + .../src/main/assembly/scripts/start.sh | 40 + .../com/acme/sample/brooklyn/SampleMain.java | 81 + .../app/ClusterWebServerDatabaseSample.java | 137 ++ .../sample/app/SingleWebServerSample.java | 32 + .../src/main/resources/logback-custom.xml | 10 + .../src/main/resources/sample-icon.png | Bin 0 -> 46490 bytes .../main/resources/visitors-creation-script.sql | 35 + .../app/SampleLocalhostIntegrationTest.java | 81 + .../brooklyn/sample/app/SampleUnitTest.java | 69 + .../quickstart/src/main/resources/.gitignore | 1 + .../META-INF/maven/archetype-metadata.xml | 65 + .../projects/integration-test-1/.gitignore | 1 + .../integration-test-1/archetype.properties | 22 + .../projects/integration-test-1/goal.txt | 1 + brooklyn-dist/.gitattributes | 6 - brooklyn-dist/.gitignore | 33 - brooklyn-dist/LICENSE | 455 ---- brooklyn-dist/NOTICE | 5 - brooklyn-dist/README.md | 8 - brooklyn-dist/all/pom.xml | 117 - brooklyn-dist/archetypes/quickstart/NOTES.txt | 76 - brooklyn-dist/archetypes/quickstart/pom.xml | 232 -- .../quickstart/src/brooklyn-sample/README.md | 73 - .../quickstart/src/brooklyn-sample/pom.xml | 102 - .../src/main/assembly/assembly.xml | 88 - .../src/main/assembly/files/README.txt | 96 - .../src/main/assembly/files/conf/logback.xml | 11 - .../src/main/assembly/scripts/start.sh | 40 - .../com/acme/sample/brooklyn/SampleMain.java | 81 - .../app/ClusterWebServerDatabaseSample.java | 137 -- .../sample/app/SingleWebServerSample.java | 32 - .../src/main/resources/logback-custom.xml | 10 - .../src/main/resources/sample-icon.png | Bin 46490 -> 0 bytes .../main/resources/visitors-creation-script.sql | 35 - .../app/SampleLocalhostIntegrationTest.java | 81 - .../brooklyn/sample/app/SampleUnitTest.java | 69 - .../quickstart/src/main/resources/.gitignore | 1 - .../META-INF/maven/archetype-metadata.xml | 65 - .../projects/integration-test-1/.gitignore | 1 - .../integration-test-1/archetype.properties | 22 - .../projects/integration-test-1/goal.txt | 1 - brooklyn-dist/dist/licensing/.gitignore | 2 - brooklyn-dist/dist/licensing/MAIN_LICENSE_ASL2 | 176 -- brooklyn-dist/dist/licensing/README.md | 78 - brooklyn-dist/dist/licensing/extras-files | 1 - .../dist/licensing/licenses/binary/ASL2 | 177 -- .../dist/licensing/licenses/binary/BSD-2-Clause | 23 - .../dist/licensing/licenses/binary/BSD-3-Clause | 27 - .../dist/licensing/licenses/binary/CDDL1 | 381 --- .../dist/licensing/licenses/binary/CDDL1.1 | 304 --- .../dist/licensing/licenses/binary/EPL1 | 212 -- .../dist/licensing/licenses/binary/MIT | 20 - .../dist/licensing/licenses/binary/WTFPL | 15 - .../dist/licensing/licenses/binary/bouncycastle | 23 - .../dist/licensing/licenses/binary/jtidy | 53 - .../dist/licensing/licenses/binary/jython | 27 - .../licenses/binary/metastuff-bsd-style | 43 - .../licenses/binary/xpp3_indiana_university | 45 - .../licensing/licenses/brooklyn-ui/BSD-2-Clause | 23 - .../licensing/licenses/brooklyn-ui/BSD-3-Clause | 27 - .../dist/licensing/licenses/brooklyn-ui/MIT | 20 - .../dist/licensing/licenses/server-cli/MIT | 20 - .../dist/licensing/licenses/source/BSD-2-Clause | 23 - .../dist/licensing/licenses/source/BSD-3-Clause | 27 - .../dist/licensing/licenses/source/MIT | 20 - .../dist/licensing/make-all-licenses.sh | 65 - .../dist/licensing/make-one-license.sh | 79 - brooklyn-dist/dist/licensing/overrides.yaml | 385 ---- .../licensing/projects-with-custom-licenses | 2 - brooklyn-dist/dist/pom.xml | 159 -- .../dist/src/main/config/build-distribution.xml | 95 - brooklyn-dist/dist/src/main/dist/README.md | 17 - .../dist/src/main/dist/bin/.gitattributes | 3 - brooklyn-dist/dist/src/main/dist/bin/brooklyn | 51 - .../dist/src/main/dist/bin/brooklyn.bat | 111 - .../dist/src/main/dist/bin/brooklyn.ps1 | 135 -- .../dist/src/main/dist/conf/logback.xml | 14 - brooklyn-dist/dist/src/main/license/README.md | 2 - .../dist/src/main/license/files/DISCLAIMER | 8 - .../dist/src/main/license/files/LICENSE | 2169 ------------------ .../dist/src/main/license/files/NOTICE | 5 - .../brooklyn/cli/BaseCliIntegrationTest.java | 189 -- .../apache/brooklyn/cli/CliIntegrationTest.java | 219 -- brooklyn-dist/downstream-parent/pom.xml | 524 ----- brooklyn-dist/pom.xml | 83 - brooklyn-dist/release/.gitignore | 2 - brooklyn-dist/release/README.md | 50 - brooklyn-dist/release/Vagrantfile | 66 - brooklyn-dist/release/change-version.sh | 70 - brooklyn-dist/release/gpg-agent.conf | 2 - brooklyn-dist/release/make-release-artifacts.sh | 273 --- brooklyn-dist/release/print-vote-email.sh | 130 -- .../release/pull-request-reports/Gemfile | 5 - .../release/pull-request-reports/Gemfile.lock | 38 - .../release/pull-request-reports/pr_report.rb | 12 - brooklyn-dist/release/settings.xml | 29 - brooklyn-dist/scripts/buildAndTest | 102 - brooklyn-dist/scripts/grep-in-poms.sh | 25 - .../scripts/release-branch-from-master | 114 - brooklyn-dist/scripts/release-make | 83 - brooklyn-dist/vagrant/pom.xml | 83 - .../src/main/config/build-distribution.xml | 33 - .../vagrant/src/main/vagrant/README.md | 41 - .../vagrant/src/main/vagrant/Vagrantfile | 76 - .../src/main/vagrant/files/brooklyn.properties | 23 - .../src/main/vagrant/files/brooklyn.service | 32 - .../src/main/vagrant/files/install_brooklyn.sh | 92 - .../vagrant/src/main/vagrant/files/logback.xml | 32 - .../src/main/vagrant/files/vagrant-catalog.bom | 82 - .../vagrant/src/main/vagrant/servers.yaml | 73 - dist/licensing/.gitignore | 2 + dist/licensing/MAIN_LICENSE_ASL2 | 176 ++ dist/licensing/README.md | 78 + dist/licensing/extras-files | 1 + dist/licensing/licenses/binary/ASL2 | 177 ++ dist/licensing/licenses/binary/BSD-2-Clause | 23 + dist/licensing/licenses/binary/BSD-3-Clause | 27 + dist/licensing/licenses/binary/CDDL1 | 381 +++ dist/licensing/licenses/binary/CDDL1.1 | 304 +++ dist/licensing/licenses/binary/EPL1 | 212 ++ dist/licensing/licenses/binary/MIT | 20 + dist/licensing/licenses/binary/WTFPL | 15 + dist/licensing/licenses/binary/bouncycastle | 23 + dist/licensing/licenses/binary/jtidy | 53 + dist/licensing/licenses/binary/jython | 27 + .../licenses/binary/metastuff-bsd-style | 43 + .../licenses/binary/xpp3_indiana_university | 45 + .../licensing/licenses/brooklyn-ui/BSD-2-Clause | 23 + .../licensing/licenses/brooklyn-ui/BSD-3-Clause | 27 + dist/licensing/licenses/brooklyn-ui/MIT | 20 + dist/licensing/licenses/server-cli/MIT | 20 + dist/licensing/licenses/source/BSD-2-Clause | 23 + dist/licensing/licenses/source/BSD-3-Clause | 27 + dist/licensing/licenses/source/MIT | 20 + dist/licensing/make-all-licenses.sh | 65 + dist/licensing/make-one-license.sh | 79 + dist/licensing/overrides.yaml | 385 ++++ dist/licensing/projects-with-custom-licenses | 2 + dist/pom.xml | 159 ++ dist/src/main/config/build-distribution.xml | 95 + dist/src/main/dist/README.md | 17 + dist/src/main/dist/bin/.gitattributes | 3 + dist/src/main/dist/bin/brooklyn | 51 + dist/src/main/dist/bin/brooklyn.bat | 111 + dist/src/main/dist/bin/brooklyn.ps1 | 135 ++ dist/src/main/dist/conf/logback.xml | 14 + dist/src/main/license/README.md | 2 + dist/src/main/license/files/DISCLAIMER | 8 + dist/src/main/license/files/LICENSE | 2169 ++++++++++++++++++ dist/src/main/license/files/NOTICE | 5 + .../brooklyn/cli/BaseCliIntegrationTest.java | 189 ++ .../apache/brooklyn/cli/CliIntegrationTest.java | 219 ++ downstream-parent/pom.xml | 524 +++++ pom.xml | 83 + release/.gitignore | 2 + release/README.md | 50 + release/Vagrantfile | 66 + release/change-version.sh | 70 + release/gpg-agent.conf | 2 + release/make-release-artifacts.sh | 273 +++ release/print-vote-email.sh | 130 ++ release/pull-request-reports/Gemfile | 5 + release/pull-request-reports/Gemfile.lock | 38 + release/pull-request-reports/pr_report.rb | 12 + release/settings.xml | 29 + scripts/buildAndTest | 102 + scripts/grep-in-poms.sh | 25 + scripts/release-branch-from-master | 114 + scripts/release-make | 83 + vagrant/pom.xml | 83 + vagrant/src/main/config/build-distribution.xml | 33 + vagrant/src/main/vagrant/README.md | 41 + vagrant/src/main/vagrant/Vagrantfile | 76 + .../src/main/vagrant/files/brooklyn.properties | 23 + vagrant/src/main/vagrant/files/brooklyn.service | 32 + .../src/main/vagrant/files/install_brooklyn.sh | 92 + vagrant/src/main/vagrant/files/logback.xml | 32 + .../src/main/vagrant/files/vagrant-catalog.bom | 82 + vagrant/src/main/vagrant/servers.yaml | 73 + 189 files changed, 9029 insertions(+), 9527 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/brooklyn-dist/blob/26c4604c/.gitignore ---------------------------------------------------------------------- diff --git a/.gitignore b/.gitignore index ed439f2..2ef22e4 100644 --- a/.gitignore +++ b/.gitignore @@ -28,5 +28,6 @@ prodDb.* brooklyn*.log.* *brooklyn-persisted-state/ +*.vagrant/ ignored http://git-wip-us.apache.org/repos/asf/brooklyn-dist/blob/26c4604c/README.md ---------------------------------------------------------------------- diff --git a/README.md b/README.md new file mode 100644 index 0000000..0b34dc4 --- /dev/null +++ b/README.md @@ -0,0 +1,8 @@ + +# [](http://brooklyn.apache.org/) + +### Distribution Sub-Project for Apache Brooklyn + +This repo contains modules for creating the distributable binary +combining the `server`, the `ui`, and other elements in other Brooklyn repos. + http://git-wip-us.apache.org/repos/asf/brooklyn-dist/blob/26c4604c/all/pom.xml ---------------------------------------------------------------------- diff --git a/all/pom.xml b/all/pom.xml new file mode 100644 index 0000000..bcaa758 --- /dev/null +++ b/all/pom.xml @@ -0,0 +1,117 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + Licensed to the Apache Software Foundation (ASF) under one + or more contributor license agreements. See the NOTICE file + distributed with this work for additional information + regarding copyright ownership. The ASF licenses this file + to you under the Apache License, Version 2.0 (the + "License"); you may not use this file except in compliance + with the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, + software distributed under the License is distributed on an + "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + KIND, either express or implied. See the License for the + specific language governing permissions and limitations + under the License. +--> +<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + <modelVersion>4.0.0</modelVersion> + <packaging>jar</packaging> + + <artifactId>brooklyn-all</artifactId> + + <name>Brooklyn All Things</name> + <description> + A meta-dependency for all the major Brooklyn modules. + </description> + + <parent> + <groupId>org.apache.brooklyn</groupId> + <artifactId>brooklyn-dist-root</artifactId> + <version>0.9.0-SNAPSHOT</version> <!-- BROOKLYN_VERSION --> + <relativePath>../pom.xml</relativePath> + </parent> + + <dependencies> + <dependency> + <groupId>com.google.guava</groupId> + <artifactId>guava</artifactId> + </dependency> + + <dependency> + <groupId>org.apache.brooklyn</groupId> + <artifactId>brooklyn-policy</artifactId> + <version>${project.version}</version> + </dependency> + + <dependency> + <groupId>org.apache.brooklyn</groupId> + <artifactId>brooklyn-locations-jclouds</artifactId> + <version>${project.version}</version> + </dependency> + + <dependency> + <groupId>org.apache.brooklyn</groupId> + <artifactId>brooklyn-software-webapp</artifactId> + <version>${project.version}</version> + </dependency> + <dependency> + <groupId>org.apache.brooklyn</groupId> + <artifactId>brooklyn-software-messaging</artifactId> + <version>${project.version}</version> + </dependency> + <dependency> + <groupId>org.apache.brooklyn</groupId> + <artifactId>brooklyn-software-monitoring</artifactId> + <version>${project.version}</version> + </dependency> + <dependency> + <groupId>org.apache.brooklyn</groupId> + <artifactId>brooklyn-software-database</artifactId> + <version>${project.version}</version> + </dependency> + <dependency> + <groupId>org.apache.brooklyn</groupId> + <artifactId>brooklyn-software-osgi</artifactId> + <version>${project.version}</version> + </dependency> + <dependency> + <groupId>org.apache.brooklyn</groupId> + <artifactId>brooklyn-software-nosql</artifactId> + <version>${project.version}</version> + </dependency> + <dependency> + <groupId>org.apache.brooklyn</groupId> + <artifactId>brooklyn-software-network</artifactId> + <version>${project.version}</version> + </dependency> + + <dependency> + <groupId>org.apache.brooklyn</groupId> + <artifactId>brooklyn-launcher</artifactId> + <version>${project.version}</version> + </dependency> + + <dependency> + <groupId>org.apache.brooklyn</groupId> + <artifactId>brooklyn-cli</artifactId> + <version>${project.version}</version> + </dependency> + + <dependency> + <groupId>org.apache.brooklyn</groupId> + <artifactId>brooklyn-test-framework</artifactId> + <version>${project.version}</version> + </dependency> + + <!-- bring in all jclouds-supported cloud providers --> + <dependency> + <groupId>${jclouds.groupId}</groupId> + <artifactId>jclouds-allcompute</artifactId> + </dependency> + </dependencies> + +</project> http://git-wip-us.apache.org/repos/asf/brooklyn-dist/blob/26c4604c/archetypes/quickstart/NOTES.txt ---------------------------------------------------------------------- diff --git a/archetypes/quickstart/NOTES.txt b/archetypes/quickstart/NOTES.txt new file mode 100644 index 0000000..4028bf6 --- /dev/null +++ b/archetypes/quickstart/NOTES.txt @@ -0,0 +1,76 @@ + +This file contains notes for anyone working on the archetype. + + +Some things to keep in mind: + +* The sample project in `src/brooklyn-sample` is what populates the + archetype source (in `src/main/resources/archetype-resources`, + copied there by the `pom.xml` in this directory, in `clean` phase). + (You can open and edit it in your IDE.) + +* That archetype source then becomes the archetype (in `install` phase) + according to the copy and filter rules in `src/main/resources/META-INF/maven/archetype-metadata.xml` + +* For any changes to the project: + + * ensure `brooklyn-sample` builds as you would like + * ensure the resulting archetype builds as you would like + (should be reasonably safe and automated, but check that the 2 sets of + copy/translation rules above do what you intended!) + * update the `README.*` files in the root of `brooklyn-sample` and the + `src/main/assembly/files` within that + * update the docs under `use/guide/defining-applications/archetype.md` and `use/guide/quickstart/index.md` + + +To build: + + mvn clean install + + +To test a build: + + pushd /tmp + rm -rf brooklyn-sample + export BV=0.9.0-SNAPSHOT # BROOKLYN_VERSION + + mvn archetype:generate \ + \ + -DarchetypeGroupId=org.apache.brooklyn \ + -DarchetypeArtifactId=brooklyn-archetype-quickstart \ + -DarchetypeVersion=${BV} \ + \ + -DgroupId=com.acme.sample \ + -DartifactId=brooklyn-sample \ + -Dversion=0.1.0-SNAPSHOT \ + -Dpackage=com.acme.sample.brooklyn \ + \ + --batch-mode + + cd brooklyn-sample + mvn clean assembly:assembly + cd target/brooklyn-sample-0.1.0-SNAPSHOT-dist/brooklyn-sample-0.1.0-SNAPSHOT/ + ./start.sh launch --cluster --location localhost + + +References + + * http://stackoverflow.com/questions/4082643/how-can-i-test-a-maven-archetype-that-ive-just-created/18916065#18916065 + +---- +Licensed to the Apache Software Foundation (ASF) under one +or more contributor license agreements. See the NOTICE file +distributed with this work for additional information +regarding copyright ownership. The ASF licenses this file +to you under the Apache License, Version 2.0 (the +"License"); you may not use this file except in compliance +with the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, +software distributed under the License is distributed on an +"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +KIND, either express or implied. See the License for the +specific language governing permissions and limitations +under the License. http://git-wip-us.apache.org/repos/asf/brooklyn-dist/blob/26c4604c/archetypes/quickstart/pom.xml ---------------------------------------------------------------------- diff --git a/archetypes/quickstart/pom.xml b/archetypes/quickstart/pom.xml new file mode 100644 index 0000000..f47c395 --- /dev/null +++ b/archetypes/quickstart/pom.xml @@ -0,0 +1,232 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + Licensed to the Apache Software Foundation (ASF) under one + or more contributor license agreements. See the NOTICE file + distributed with this work for additional information + regarding copyright ownership. The ASF licenses this file + to you under the Apache License, Version 2.0 (the + "License"); you may not use this file except in compliance + with the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, + software distributed under the License is distributed on an + "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + KIND, either express or implied. See the License for the + specific language governing permissions and limitations + under the License. +--> +<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + <modelVersion>4.0.0</modelVersion> + <artifactId>brooklyn-archetype-quickstart</artifactId> + <packaging>maven-archetype</packaging> + <name>Brooklyn Quick-Start Project Archetype</name> + <description> + This project defines an archetype for creating new projects which consume brooklyn, + including an example application and an example new entity type, + able to build an OSGi JAR and a binary assembly, with logging and READMEs. + </description> + + <parent> + <groupId>org.apache.brooklyn</groupId> + <artifactId>brooklyn-parent</artifactId> + <version>0.9.0-SNAPSHOT</version> <!-- BROOKLYN_VERSION --> + <relativePath>../../../brooklyn-server/parent/pom.xml</relativePath> + </parent> + + <build> + <plugins> + <plugin> + <artifactId>maven-archetype-plugin</artifactId> + <!-- all we want to do is skip _integration tests_ when skipTests is set, not other phases; + but for some reason this seems to do it, and it still builds the archetype (!?). + whereas setting skip inside the integration-test execution goal does NOT work. + + TODO promote to root pom.xml when we better understand why + --> + <configuration> + <skip>${skipTests}</skip> + </configuration> + </plugin> + + <plugin> + <artifactId>maven-clean-plugin</artifactId> + <configuration> + <filesets> + <fileset> + <directory>src/test/resources/projects/integration-test-1/reference</directory> + <includes><include>**/*</include></includes> + </fileset> + <fileset> + <directory>src/main/resources/archetype-resources/</directory> + <includes><include>**/*</include></includes> + </fileset> + </filesets> + </configuration> + </plugin> + + <plugin> + <groupId>com.google.code.maven-replacer-plugin</groupId> + <artifactId>maven-replacer-plugin</artifactId> + <executions> + <execution> + <id>copy-brooklyn-sample-to-integration-test-reference</id> + <phase>clean</phase> + <goals> <goal>replace</goal> </goals> + <configuration> + <basedir>${basedir}/src/brooklyn-sample</basedir> + <outputBasedir>${basedir}</outputBasedir> + <outputDir>src/test/resources/projects/integration-test-1/reference</outputDir> + <includes> <include>**</include> </includes> + <excludes> + <exclude>.*</exclude> + <exclude>.*/**</exclude> + <exclude>target/**</exclude> + <exclude>*.log</exclude> + </excludes> + + <replacements /> + </configuration> + </execution> + <!-- would be nice to reduce the repetion below, but don't see how; + have tried with valueTokenMap but it must lie beneath basedir; + and tried with {input,output}FilePattern but that doesn't apply to dirs --> + <execution> + <!-- copy creating variables and unpackaged, for src/main/java --> + <id>copy-brooklyn-sample-to-archetype-src-main-java</id> + <phase>clean</phase> + <goals> <goal>replace</goal> </goals> + <configuration> + <basedir>${basedir}/src/brooklyn-sample/src/main/java/com/acme/sample/brooklyn</basedir> + <outputBasedir>${basedir}</outputBasedir> + <outputDir>src/main/resources/archetype-resources/src/main/java</outputDir> + <includes> <include>**/*</include> </includes> + <replacements> + <replacement> <token>brooklyn-sample</token> <value>\$\{artifactId}</value> </replacement> + <replacement> <token>com\.acme\.sample\.brooklyn</token> <value>\$\{package}</value> </replacement> + <replacement> <token>com/acme/sample/brooklyn</token> <value>\$\{packageInPathFormat}</value> </replacement> + <replacement> <token>com\.acme\.sample</token> <value>\$\{groupId}</value> </replacement> + <replacement> <token>0.1.0-SNAPSHOT</token> <value>\$\{version}</value> </replacement> + </replacements> + </configuration> + </execution> + <execution> + <!-- copy creating variables and unpackaged, for src/test/java --> + <id>copy-brooklyn-sample-to-archetype-src-test-java</id> + <phase>clean</phase> + <goals> <goal>replace</goal> </goals> + <configuration> + <basedir>${basedir}/src/brooklyn-sample/src/test/java/com/acme/sample/brooklyn</basedir> + <outputBasedir>${basedir}</outputBasedir> + <outputDir>src/main/resources/archetype-resources/src/test/java</outputDir> + <includes> <include>**/*</include> </includes> + <replacements> + <replacement> <token>brooklyn-sample</token> <value>\$\{artifactId}</value> </replacement> + <replacement> <token>com\.acme\.sample\.brooklyn</token> <value>\$\{package}</value> </replacement> + <replacement> <token>com/acme/sample/brooklyn</token> <value>\$\{packageInPathFormat}</value> </replacement> + <replacement> <token>com\.acme\.sample</token> <value>\$\{groupId}</value> </replacement> + <replacement> <token>0.1.0-SNAPSHOT</token> <value>\$\{version}</value> </replacement> + </replacements> + </configuration> + </execution> + <execution> + <!-- copy creating variables, for all other places --> + <id>copy-brooklyn-sample-to-archetype-resources</id> + <phase>clean</phase> + <goals> <goal>replace</goal> </goals> + <configuration> + <basedir>${basedir}/src/brooklyn-sample/</basedir> + <outputBasedir>${basedir}</outputBasedir> + <outputDir>src/main/resources/archetype-resources/</outputDir> + <includes> <include>**/*</include> </includes> + <excludes> + <exclude>src/main/java/**</exclude> + <exclude>src/test/java/**</exclude> + <exclude>target/**</exclude> + <exclude>test-output/**</exclude> + <exclude>.*</exclude> + <exclude>**/*.png</exclude> + <exclude>.*/**</exclude> + <exclude>*.log</exclude> + <exclude>**/*.sh</exclude> + </excludes> + <replacements> + <!-- special chars in velocity have to be escaped. + fortunately we only use fairly simple examples so we don't need to solve the general case! --> + <!-- escaping # is ugly --> + <replacement> <token>(#+)</token> <value>#set\(\$H='$1'\)\${H}</value> </replacement> + <!-- and escaping $ doesn't even seem to work; perhaps an old version of velocity in use? + (however velocity ignores $ except for variables which are defined, so we're okay) + <replacement> <token>\$</token> <value>\\\$</value> </replacement> + --> + + <replacement> <token>brooklyn-sample</token> <value>\$\{artifactId}</value> </replacement> + <replacement> <token>com\.acme\.sample\.brooklyn</token> <value>\$\{package}</value> </replacement> + <replacement> <token>com/acme/sample/brooklyn</token> <value>\$\{packageInPathFormat}</value> </replacement> + <replacement> <token>com\.acme\.sample</token> <value>\$\{groupId}</value> </replacement> + <replacement> <token>0.1.0-SNAPSHOT</token> <value>\$\{version}</value> </replacement> + </replacements> + </configuration> + </execution> + <execution> + <!-- copy creating variables, for all other places --> + <id>copy-brooklyn-sample-to-archetype-resources-binary</id> + <phase>clean</phase> + <goals> <goal>replace</goal> </goals> + <configuration> + <basedir>${basedir}/src/brooklyn-sample/</basedir> + <outputBasedir>${basedir}</outputBasedir> + <outputDir>src/main/resources/archetype-resources/</outputDir> + <includes> + <include>**/*.png</include> + <include>**/*.sh</include> + </includes> + <excludes> + <exclude>target/**</exclude> + <exclude>test-output/**</exclude> + <exclude>.*</exclude> + <exclude>.*/**</exclude> + </excludes> + <!-- no replacements for binary (put one just so we can use this plugin for consistency) --> + <replacements><replacement> <token>NONCE_123456789XYZ</token> <value>NONCE_123456789XYZ</value> </replacement></replacements> + </configuration> + </execution> + + </executions> + </plugin> + + </plugins> + <pluginManagement> + <plugins> + <plugin> + <groupId>org.apache.rat</groupId> + <artifactId>apache-rat-plugin</artifactId> + <configuration> + <excludes combine.children="append"> + <!-- + The maven archetype are files "without any degree of creativity". They are intended + purely as a template to generate a new project for a user, where upon the user can + write their code within this new project. + The exclusions seem to need to include code that is auto-generated during a test run. + --> + <exclude>**/src/main/resources/archetype-resources/**/*</exclude> + <exclude>**/src/test/resources/projects/integration-test-1/goal.txt</exclude> + <exclude>**/src/test/resources/projects/integration-test-1/reference/**/*</exclude> + <exclude>**/src/main/java/sample/**/*Sample*.java</exclude> + <exclude>**/src/main/resources/logback-custom.xml</exclude> + <exclude>**/src/brooklyn-sample/README.md</exclude> + <exclude>**/src/brooklyn-sample/pom.xml</exclude> + <exclude>**/src/brooklyn-sample/src/main/assembly/files/conf/*</exclude> + <exclude>**/src/brooklyn-sample/src/main/java/**/*.java</exclude> + <exclude>**/src/brooklyn-sample/src/main/resources/logback-custom.xml</exclude> + <exclude>**/src/brooklyn-sample/src/test/java/**/*.java</exclude> + </excludes> + </configuration> + </plugin> + </plugins> + </pluginManagement> + + </build> + +</project> http://git-wip-us.apache.org/repos/asf/brooklyn-dist/blob/26c4604c/archetypes/quickstart/src/brooklyn-sample/README.md ---------------------------------------------------------------------- diff --git a/archetypes/quickstart/src/brooklyn-sample/README.md b/archetypes/quickstart/src/brooklyn-sample/README.md new file mode 100644 index 0000000..b40df41 --- /dev/null +++ b/archetypes/quickstart/src/brooklyn-sample/README.md @@ -0,0 +1,73 @@ +brooklyn-sample +=== + +This is a Sample Brooklyn project, showing how to define an application +which Brooklyn will deploy and manage. + +This sample project is intended to be customized to suit your purposes: but +search for all lines containing the word "sample" to make sure all the +references to this being a sample are removed! + +To build an assembly, simply run: + + mvn clean assembly:assembly + +This creates a tarball with a full standalone application which can be installed in any *nix machine at: + target/brooklyn-sample-0.1.0-SNAPSHOT-dist.tar.gz + +It also installs an unpacked version which you can run locally: + + cd target/brooklyn-sample-0.1.0-SNAPSHOT-dist/brooklyn-sample-0.1.0-SNAPSHOT + ./start.sh server + +For more information see the README (or `./start.sh help`) in that directory. +On OS X and Linux, this application will deploy to localhost *if* you have key-based +password-less (and passphrase-less) ssh enabled. + +To configure cloud and fixed-IP locations, see the README file in the built application directly. +For more information you can run `./start.sh help`) in that directory. + + +### Opening in an IDE + +To open this project in an IDE, you will need maven support enabled +(e.g. with the relevant plugin). You should then be able to develop +it and run it as usual. For more information on IDE support, visit: + + https://brooklyn.incubator.apache.org/v/latest/dev/env/ide/ + + +### Customizing the Assembly + +The artifacts (directory and tar.gz by default) which get built into +`target/` can be changed. Simply edit the relevant files under +`src/main/assembly`. + +You will likely wish to customize the `SampleMain` class as well as +the `Sample*App` classes provided. That is the intention! +You will also likely want to update the `start.sh` script and +the `README.*` files. + +To easily find the bits you should customize, do a: + + grep -ri sample src/ *.* + + +### More About Apache Brooklyn + +Apache Brooklyn is a code library and framework for managing applications in a +cloud-first dev-ops-y way. It has been used to create this sample project +which shows how to define an application and entities for Brooklyn. + +This project can be extended for more complex topologies and more +interesting applications, and to develop the policies to scale or tune the +deployment depending on what the application needs. + +For more information consider: + +* Visiting the Apache Brooklyn home page at https://brooklyn.incubator.apache.org +* Finding us on IRC #brooklyncentral or email (click "Community" at the site above) +* Forking the project at http://github.com/apache/incubator-brooklyn/ + +A sample Brooklyn project should specify its license. + http://git-wip-us.apache.org/repos/asf/brooklyn-dist/blob/26c4604c/archetypes/quickstart/src/brooklyn-sample/pom.xml ---------------------------------------------------------------------- diff --git a/archetypes/quickstart/src/brooklyn-sample/pom.xml b/archetypes/quickstart/src/brooklyn-sample/pom.xml new file mode 100644 index 0000000..44f5f93 --- /dev/null +++ b/archetypes/quickstart/src/brooklyn-sample/pom.xml @@ -0,0 +1,102 @@ +<?xml version="1.0" encoding="UTF-8"?> +<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + + <modelVersion>4.0.0</modelVersion> + + <parent> + <groupId>org.apache.brooklyn</groupId> + <artifactId>brooklyn-downstream-parent</artifactId> + <version>0.9.0-SNAPSHOT</version> <!-- BROOKLYN_VERSION --> + </parent> + + <groupId>com.acme.sample</groupId> + <artifactId>brooklyn-sample</artifactId> + <version>0.1.0-SNAPSHOT</version> + <packaging>jar</packaging> + + <name>Sample Brooklyn Project com.acme.sample:brooklyn-sample v0.1.0-SNAPSHOT</name> + <description> + Sample optional description goes here. + </description> + + <!-- Optional metadata (commented out in this sample) + + <url>https://github.com/sample/sample</url> + + <licenses> + <license> + <name>The Apache Software License, Version 2.0</name> + <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url> + <distribution>repo</distribution> + </license> + </licenses> + + <developers> + <developer> + <name>Sample Project Committers</name> + </developer> + </developers> + + <scm> + <connection>scm:git:git://github.com/sample/sample</connection> + <developerConnection>scm:git:[email protected]:sample/sample.git</developerConnection> + <url>http://github.com/sample/sample</url> + </scm> + + --> + + <properties> + <project.entry>com.acme.sample.brooklyn.SampleMain</project.entry> + </properties> + + <repositories> + <repository> + <id>apache.snapshots</id> + <name>Apache Snapshot Repository</name> + <url>http://repository.apache.org/snapshots</url> + <releases> + <enabled>false</enabled> + </releases> + </repository> + </repositories> + + <dependencies> + <dependency> + <!-- this pulls in all brooklyn entities and clouds; + you can cherry pick selected ones instead (for a smaller build) --> + <groupId>org.apache.brooklyn</groupId> + <artifactId>brooklyn-all</artifactId> + <version>${brooklyn.version}</version> + </dependency> + + <dependency> + <!-- includes testng and useful logging for tests --> + <groupId>org.apache.brooklyn</groupId> + <artifactId>brooklyn-test-support</artifactId> + <version>${brooklyn.version}</version> + <scope>test</scope> + </dependency> + + <dependency> + <!-- this gives us flexible and easy-to-use logging; just edit logback-custom.xml! --> + <groupId>org.apache.brooklyn</groupId> + <artifactId>brooklyn-logback-xml</artifactId> + <version>${brooklyn.version}</version> + </dependency> + </dependencies> + + <build> + <plugins> + <plugin> + <artifactId>maven-assembly-plugin</artifactId> + <configuration> + <descriptors> + <descriptor>src/main/assembly/assembly.xml</descriptor> + </descriptors> + </configuration> + </plugin> + </plugins> + </build> + +</project> http://git-wip-us.apache.org/repos/asf/brooklyn-dist/blob/26c4604c/archetypes/quickstart/src/brooklyn-sample/src/main/assembly/assembly.xml ---------------------------------------------------------------------- diff --git a/archetypes/quickstart/src/brooklyn-sample/src/main/assembly/assembly.xml b/archetypes/quickstart/src/brooklyn-sample/src/main/assembly/assembly.xml new file mode 100644 index 0000000..2875a8a --- /dev/null +++ b/archetypes/quickstart/src/brooklyn-sample/src/main/assembly/assembly.xml @@ -0,0 +1,88 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + Licensed to the Apache Software Foundation (ASF) under one + or more contributor license agreements. See the NOTICE file + distributed with this work for additional information + regarding copyright ownership. The ASF licenses this file + to you under the Apache License, Version 2.0 (the + "License"); you may not use this file except in compliance + with the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, + software distributed under the License is distributed on an + "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + KIND, either express or implied. See the License for the + specific language governing permissions and limitations + under the License. +--> +<assembly> + <id>dist</id> + <!-- Generates an archive and a dir containing the needed files; + can add e.g. zip to the following + (but executable bit is not preserved) --> + <formats> + <format>dir</format> + <format>tar.gz</format> + </formats> + + <!-- Adds dependencies to zip package under lib directory --> + <dependencySets> + <dependencySet> + <!-- + Project artifact is not copied under library directory since + it is added to the root directory of the zip package. + --> + <useProjectArtifact>false</useProjectArtifact> + <outputDirectory>lib</outputDirectory> + <unpack>false</unpack> + </dependencySet> + </dependencySets> + + <!-- + Adds startup scripts to the root directory of zip package. The startup + scripts are located to src/main/scripts directory as stated by Maven + conventions. + --> + <files> + <file> + <source>src/main/assembly/scripts/start.sh</source> + <outputDirectory></outputDirectory> + <fileMode>0755</fileMode> + <filtered>true</filtered> + </file> + </files> + <fileSets> + <fileSet> + <directory>src/main/assembly/scripts</directory> + <outputDirectory></outputDirectory> + <fileMode>0755</fileMode> + <includes> + <include>*</include> + </includes> + <excludes> + <exclude>start.sh</exclude> + </excludes> + </fileSet> + <!-- add additional files (but not marked executable) --> + <fileSet> + <directory>src/main/assembly/files</directory> + <outputDirectory></outputDirectory> + <includes> + <include>**</include> + </includes> + </fileSet> + <!-- adds jar package to the root directory of zip package --> + <fileSet> + <directory>target</directory> + <outputDirectory></outputDirectory> + <includes> + <include>*.jar</include> + </includes> + <excludes> + <exclude>*-tests.jar</exclude> + </excludes> + </fileSet> + </fileSets> +</assembly> http://git-wip-us.apache.org/repos/asf/brooklyn-dist/blob/26c4604c/archetypes/quickstart/src/brooklyn-sample/src/main/assembly/files/README.txt ---------------------------------------------------------------------- diff --git a/archetypes/quickstart/src/brooklyn-sample/src/main/assembly/files/README.txt b/archetypes/quickstart/src/brooklyn-sample/src/main/assembly/files/README.txt new file mode 100644 index 0000000..8ba14f1 --- /dev/null +++ b/archetypes/quickstart/src/brooklyn-sample/src/main/assembly/files/README.txt @@ -0,0 +1,96 @@ +brooklyn-sample +=== + +This is a sample application which is launched and managed by Brooklyn. +This README file is at the root of the built assembly, which can be uploaded +and run most anywhere. This file provides end-user instructions. + +To use this, configure any cloud credentials then run ./start.sh in this +directory. You can then access the management context in your browser, +typically on http://localhost:8081 , and through that console deploy the +applications contained in this archive. + + +### Cloud Credentials + +To run, you'll need to specify credentials for your preferred cloud. This +can be done in `~/.brooklyn/brooklyn.properties`. + +A recommended starting point is the file at: + + https://brooklyn.incubator.apache.org/v/latest/use/guide/quickstart/brooklyn.properties + +As a quick-start, you can specify: + + brooklyn.location.jclouds.aws-ec2.identity=AKXXXXXXXXXXXXXXXXXX + brooklyn.location.jclouds.aws-ec2.credential=secret01xxxxxxxxxxxxxxxxxxxxxxxxxxx + + brooklyn.location.named.My_Amazon_US_west=jclouds:aws-ec2:us-west-1 + brooklyn.location.named.My_Amazon_EU=jclouds:aws-ec2:eu-west-1 + +Alternatively these can be set as shell environment parameters or JVM system properties. + +Many other clouds are supported also, as well as pre-existing machines +("bring your own nodes"), custom endpoints for private clouds, and specifying +custom keys and passphrases. For more information see: + + https://brooklyn.incubator.apache.org/v/latest/use/guide/defining-applications/common-usage#locations + + +### Run + +Usage: + + ./start.sh launch [--WHAT] \ + [--port 8081+] \ + [--location location] + +The optional port argument specifies the port where the Brooklyn console +will be running, such as localhost:8081. (The console is only bound to +localhost, unless you set up users and security, as described at +https://brooklyn.incubator.apache.org/v/latest/use/guide/management/ .) + +In the console, you can access the catalog and deploy applications to +configured locations. + +In this sample application, `--cluster` and `--single` are supported in place of `--WHAT`, +corresponding to sample blueprints in the project. This can be left blank to have nothing +launched; note that the blueprints can be launched at runtime via the GUI or API. + +Use `./start.sh help` or `./start.sh help launch` for more detailed help. + +The location might be `localhost` (the default), `aws-ec2:us-east-1`, +`openstack:endpoint`, `softlayer`, or based on names, such as +`named:My_Amazon_US_west`, so long as it is configured as above. +(Localhost does not need any configuration in `~/brooklyn/brooklyn.properties`, +provided you have password-less ssh access enabled to localhost, using a +private key with no passphrase.) + + +### More About Brooklyn + +Brooklyn is a code library and framework for managing applications in a +cloud-first dev-ops-y way. It has been used to create this sample project +which shows how to define an application and entities for Brooklyn. + +This project can be extended for more complex topologies and more +interesting applications, and to develop the policies to scale or tune the +deployment depending on what the application needs. + +For more information consider: + +* Visiting the open-source Brooklyn home page at http://brooklyncentral.github.com +* Forking the Brooklyn project at http://github.com/brooklyncentral/brooklyn +* Emailing [email protected] + +For commercial enquiries -- including bespoke development and paid support -- +contact Cloudsoft, the supporters of Brooklyn, at: + +* www.CloudsoftCorp.com +* [email protected] + +Brooklyn is (c) 2014 Cloudsoft Corporation and released as open source under +the Apache License v2.0. + +A sample Brooklyn project should specify its license here. + http://git-wip-us.apache.org/repos/asf/brooklyn-dist/blob/26c4604c/archetypes/quickstart/src/brooklyn-sample/src/main/assembly/files/conf/logback.xml ---------------------------------------------------------------------- diff --git a/archetypes/quickstart/src/brooklyn-sample/src/main/assembly/files/conf/logback.xml b/archetypes/quickstart/src/brooklyn-sample/src/main/assembly/files/conf/logback.xml new file mode 100644 index 0000000..7b7a972 --- /dev/null +++ b/archetypes/quickstart/src/brooklyn-sample/src/main/assembly/files/conf/logback.xml @@ -0,0 +1,11 @@ +<?xml version="1.0" encoding="UTF-8"?> +<configuration> + + <!-- logging configuration for this project; edit this file as required, or override the files + this includes as described in the Logging section of the brooklyn users guide. + this project already supplies a logback-custom.xml which gets included to log our + classes at debug level and write to a log file named after this project --> + + <include resource="logback-main.xml"/> + +</configuration> http://git-wip-us.apache.org/repos/asf/brooklyn-dist/blob/26c4604c/archetypes/quickstart/src/brooklyn-sample/src/main/assembly/scripts/start.sh ---------------------------------------------------------------------- diff --git a/archetypes/quickstart/src/brooklyn-sample/src/main/assembly/scripts/start.sh b/archetypes/quickstart/src/brooklyn-sample/src/main/assembly/scripts/start.sh new file mode 100755 index 0000000..2879b6d --- /dev/null +++ b/archetypes/quickstart/src/brooklyn-sample/src/main/assembly/scripts/start.sh @@ -0,0 +1,40 @@ +#!/bin/bash +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# + +if [ ! -z "$JAVA_HOME" ] ; then + JAVA=$JAVA_HOME/bin/java +else + JAVA=`which java` +fi + +if [ ! -x "$JAVA" ] ; then + echo Cannot find java. Set JAVA_HOME or add java to path. + exit 1 +fi + +if [[ ! `ls ${project.artifactId}-*.jar 2> /dev/null` ]] ; then + echo Command must be run from the directory where the JAR is installed. + exit 4 +fi + +$JAVA -Xms256m -Xmx1024m -XX:MaxPermSize=1024m \ + -classpath "conf/:patch/*:*:lib/*" \ + ${project.entry} \ + "$@" http://git-wip-us.apache.org/repos/asf/brooklyn-dist/blob/26c4604c/archetypes/quickstart/src/brooklyn-sample/src/main/java/com/acme/sample/brooklyn/SampleMain.java ---------------------------------------------------------------------- diff --git a/archetypes/quickstart/src/brooklyn-sample/src/main/java/com/acme/sample/brooklyn/SampleMain.java b/archetypes/quickstart/src/brooklyn-sample/src/main/java/com/acme/sample/brooklyn/SampleMain.java new file mode 100644 index 0000000..253f657 --- /dev/null +++ b/archetypes/quickstart/src/brooklyn-sample/src/main/java/com/acme/sample/brooklyn/SampleMain.java @@ -0,0 +1,81 @@ +package com.acme.sample.brooklyn; + +import java.util.Arrays; + +import io.airlift.command.Command; +import io.airlift.command.Option; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import org.apache.brooklyn.api.catalog.BrooklynCatalog; +import org.apache.brooklyn.cli.Main; + +import com.google.common.base.Objects.ToStringHelper; + +import com.acme.sample.brooklyn.sample.app.*; + +/** + * This class provides a static main entry point for launching a custom Brooklyn-based app. + * <p> + * It inherits the standard Brooklyn CLI options from {@link Main}, + * plus adds a few more shortcuts for favourite blueprints to the {@link LaunchCommand}. + */ +public class SampleMain extends Main { + + private static final Logger log = LoggerFactory.getLogger(SampleMain.class); + + public static final String DEFAULT_LOCATION = "localhost"; + + public static void main(String... args) { + log.debug("CLI invoked with args "+Arrays.asList(args)); + new SampleMain().execCli(args); + } + + @Override + protected String cliScriptName() { + return "start.sh"; + } + + @Override + protected Class<? extends BrooklynCommand> cliLaunchCommand() { + return LaunchCommand.class; + } + + @Command(name = "launch", description = "Starts a server, and optionally an application. " + + "Use e.g. --single or --cluster to launch one-node and clustered variants of the sample web application.") + public static class LaunchCommand extends Main.LaunchCommand { + + // add these options to the LaunchCommand as shortcuts for our favourite applications + + @Option(name = { "--single" }, description = "Launch a single web-server instance") + public boolean single; + + @Option(name = { "--cluster" }, description = "Launch a web-server cluster") + public boolean cluster; + + @Override + public Void call() throws Exception { + // process our CLI arguments + if (single) setAppToLaunch( SingleWebServerSample.class.getCanonicalName() ); + if (cluster) setAppToLaunch( ClusterWebServerDatabaseSample.class.getCanonicalName() ); + + // now process the standard launch arguments + return super.call(); + } + + @Override + protected void populateCatalog(BrooklynCatalog catalog) { + super.populateCatalog(catalog); + catalog.addItem(SingleWebServerSample.class); + catalog.addItem(ClusterWebServerDatabaseSample.class); + } + + @Override + public ToStringHelper string() { + return super.string() + .add("single", single) + .add("cluster", cluster); + } + } +} http://git-wip-us.apache.org/repos/asf/brooklyn-dist/blob/26c4604c/archetypes/quickstart/src/brooklyn-sample/src/main/java/com/acme/sample/brooklyn/sample/app/ClusterWebServerDatabaseSample.java ---------------------------------------------------------------------- diff --git a/archetypes/quickstart/src/brooklyn-sample/src/main/java/com/acme/sample/brooklyn/sample/app/ClusterWebServerDatabaseSample.java b/archetypes/quickstart/src/brooklyn-sample/src/main/java/com/acme/sample/brooklyn/sample/app/ClusterWebServerDatabaseSample.java new file mode 100644 index 0000000..11d977f --- /dev/null +++ b/archetypes/quickstart/src/brooklyn-sample/src/main/java/com/acme/sample/brooklyn/sample/app/ClusterWebServerDatabaseSample.java @@ -0,0 +1,137 @@ +package com.acme.sample.brooklyn.sample.app; + +import java.util.concurrent.TimeUnit; + +import org.apache.brooklyn.api.catalog.Catalog; +import org.apache.brooklyn.api.catalog.CatalogConfig; +import org.apache.brooklyn.api.entity.EntitySpec; +import org.apache.brooklyn.api.sensor.AttributeSensor; +import org.apache.brooklyn.config.ConfigKey; +import org.apache.brooklyn.core.config.ConfigKeys; +import org.apache.brooklyn.core.entity.AbstractApplication; +import org.apache.brooklyn.core.entity.Entities; +import org.apache.brooklyn.core.location.PortRanges; +import org.apache.brooklyn.core.sensor.Sensors; +import org.apache.brooklyn.enricher.stock.SensorPropagatingEnricher; +import org.apache.brooklyn.enricher.stock.SensorTransformingEnricher; +import org.apache.brooklyn.entity.database.DatastoreMixins.DatastoreCommon; +import org.apache.brooklyn.entity.database.mysql.MySqlNode; +import org.apache.brooklyn.entity.group.DynamicCluster; +import org.apache.brooklyn.entity.java.JavaEntityMethods; +import org.apache.brooklyn.entity.webapp.ControlledDynamicWebAppCluster; +import org.apache.brooklyn.entity.webapp.DynamicWebAppCluster; +import org.apache.brooklyn.entity.webapp.JavaWebAppService; +import org.apache.brooklyn.entity.webapp.WebAppService; +import org.apache.brooklyn.entity.webapp.WebAppServiceConstants; +import org.apache.brooklyn.policy.autoscaling.AutoScalerPolicy; +import org.apache.brooklyn.policy.enricher.HttpLatencyDetector; +import org.apache.brooklyn.util.maven.MavenArtifact; +import org.apache.brooklyn.util.maven.MavenRetriever; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import com.google.common.base.Functions; + +import static org.apache.brooklyn.core.sensor.DependentConfiguration.attributeWhenReady; +import static org.apache.brooklyn.core.sensor.DependentConfiguration.formatString; + + +/** This sample builds a 3-tier application with an elastic app-server cluster, + * and it sets it up for use in the Brooklyn catalog. + * <p> + * Note that root access (and xcode etc) may be required to install nginx. + **/ +@Catalog(name="Elastic Java Web + DB", + description="Deploys a WAR to a load-balanced elastic Java AppServer cluster, " + + "with an auto-scaling policy, " + + "wired to a database initialized with the provided SQL; " + + "defaults to a 'Hello World' chatroom app.", + iconUrl="classpath://sample-icon.png") +public class ClusterWebServerDatabaseSample extends AbstractApplication { + + public static final Logger LOG = LoggerFactory.getLogger(ClusterWebServerDatabaseSample.class); + + // ---------- WAR configuration --------------- + + public static final String DEFAULT_WAR_URL = + // can supply any URL -- this loads a stock example from maven central / sonatype + MavenRetriever.localUrl(MavenArtifact.fromCoordinate("io.brooklyn.example:brooklyn-example-hello-world-sql-webapp:war:0.5.0")); + + @CatalogConfig(label="WAR (URL)", priority=2) + public static final ConfigKey<String> WAR_URL = ConfigKeys.newConfigKey( + "app.war", "URL to the application archive which should be deployed", DEFAULT_WAR_URL); + + + // ---------- DB configuration ---------------- + + // this is included in src/main/resources. if in an IDE, ensure your build path is set appropriately. + public static final String DEFAULT_DB_SETUP_SQL_URL = "classpath://visitors-creation-script.sql"; + + @CatalogConfig(label="DB Setup SQL (URL)", priority=1) + public static final ConfigKey<String> DB_SETUP_SQL_URL = ConfigKeys.newConfigKey( + "app.db_sql", "URL to the SQL script to set up the database", + DEFAULT_DB_SETUP_SQL_URL); + + public static final String DB_TABLE = "visitors"; + public static final String DB_USERNAME = "brooklyn"; + public static final String DB_PASSWORD = "br00k11n"; + + + // --------- Custom Sensor -------------------- + + AttributeSensor<Integer> APPSERVERS_COUNT = Sensors.newIntegerSensor( + "appservers.count", "Number of app servers deployed"); + + + // --------- Initialization ------------------- + + /** Initialize our application. In this case it consists of + * a single DB, with a load-balanced cluster (nginx + multiple JBosses, by default), + * with some sensors and a policy. */ + @Override + public void init() { + DatastoreCommon db = addChild( + EntitySpec.create(MySqlNode.class) + .configure(MySqlNode.CREATION_SCRIPT_URL, Entities.getRequiredUrlConfig(this, DB_SETUP_SQL_URL))); + + ControlledDynamicWebAppCluster web = addChild( + EntitySpec.create(ControlledDynamicWebAppCluster.class) + // set WAR to use, and port to use + .configure(JavaWebAppService.ROOT_WAR, getConfig(WAR_URL)) + .configure(WebAppService.HTTP_PORT, PortRanges.fromString("8080+")) + +// // optionally - use Tomcat instead of JBoss (default: +// .configure(ControlledDynamicWebAppCluster.MEMBER_SPEC, EntitySpec.create(TomcatServer.class)) + + // inject a JVM system property to point to the DB + .configure(JavaEntityMethods.javaSysProp("brooklyn.example.db.url"), + formatString("jdbc:%s%s?user=%s\\&password=%s", + attributeWhenReady(db, DatastoreCommon.DATASTORE_URL), DB_TABLE, DB_USERNAME, DB_PASSWORD)) + + // start with 2 appserver nodes, initially + .configure(DynamicCluster.INITIAL_SIZE, 2) + ); + + // add an enricher which measures latency + web.addEnricher(HttpLatencyDetector.builder(). + url(WebAppServiceConstants.ROOT_URL). + rollup(10, TimeUnit.SECONDS). + build()); + + // add a policy which scales out based on Reqs/Sec + web.getCluster().addPolicy(AutoScalerPolicy.builder(). + metric(DynamicWebAppCluster.REQUESTS_PER_SECOND_IN_WINDOW_PER_NODE). + metricRange(10, 100). + sizeRange(2, 5). + build()); + + // add a few more sensors at the top-level (KPI's at the root of the application) + addEnricher(SensorPropagatingEnricher.newInstanceListeningTo(web, + WebAppServiceConstants.ROOT_URL, + DynamicWebAppCluster.REQUESTS_PER_SECOND_IN_WINDOW, + HttpLatencyDetector.REQUEST_LATENCY_IN_SECONDS_IN_WINDOW)); + addEnricher(SensorTransformingEnricher.newInstanceTransforming(web, + DynamicWebAppCluster.GROUP_SIZE, Functions.<Integer>identity(), APPSERVERS_COUNT)); + } + +} http://git-wip-us.apache.org/repos/asf/brooklyn-dist/blob/26c4604c/archetypes/quickstart/src/brooklyn-sample/src/main/java/com/acme/sample/brooklyn/sample/app/SingleWebServerSample.java ---------------------------------------------------------------------- diff --git a/archetypes/quickstart/src/brooklyn-sample/src/main/java/com/acme/sample/brooklyn/sample/app/SingleWebServerSample.java b/archetypes/quickstart/src/brooklyn-sample/src/main/java/com/acme/sample/brooklyn/sample/app/SingleWebServerSample.java new file mode 100644 index 0000000..3cc9426 --- /dev/null +++ b/archetypes/quickstart/src/brooklyn-sample/src/main/java/com/acme/sample/brooklyn/sample/app/SingleWebServerSample.java @@ -0,0 +1,32 @@ +package com.acme.sample.brooklyn.sample.app; + +import org.apache.brooklyn.api.entity.EntitySpec; +import org.apache.brooklyn.core.entity.AbstractApplication; +import org.apache.brooklyn.core.entity.Attributes; +import org.apache.brooklyn.core.location.PortRanges; +import org.apache.brooklyn.entity.webapp.JavaWebAppService; +import org.apache.brooklyn.entity.webapp.jboss.JBoss7Server; +import org.apache.brooklyn.util.maven.MavenArtifact; +import org.apache.brooklyn.util.maven.MavenRetriever; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** This example starts one web app on 8080. */ +public class SingleWebServerSample extends AbstractApplication { + + public static final Logger LOG = LoggerFactory.getLogger(SingleWebServerSample.class); + + public static final String DEFAULT_WAR_URL = + // can supply any URL -- this loads a stock example from maven central / sonatype + MavenRetriever.localUrl(MavenArtifact.fromCoordinate("io.brooklyn.example:brooklyn-example-hello-world-sql-webapp:war:0.5.0")); + + /** Initialize our application. In this case it consists of + * a single JBoss entity, configured to run the WAR above. */ + @Override + public void init() { + addChild(EntitySpec.create(JBoss7Server.class) + .configure(JavaWebAppService.ROOT_WAR, DEFAULT_WAR_URL) + .configure(Attributes.HTTP_PORT, PortRanges.fromString("8080+"))); + } + +} http://git-wip-us.apache.org/repos/asf/brooklyn-dist/blob/26c4604c/archetypes/quickstart/src/brooklyn-sample/src/main/resources/logback-custom.xml ---------------------------------------------------------------------- diff --git a/archetypes/quickstart/src/brooklyn-sample/src/main/resources/logback-custom.xml b/archetypes/quickstart/src/brooklyn-sample/src/main/resources/logback-custom.xml new file mode 100644 index 0000000..5a1ec98 --- /dev/null +++ b/archetypes/quickstart/src/brooklyn-sample/src/main/resources/logback-custom.xml @@ -0,0 +1,10 @@ +<?xml version="1.0" encoding="UTF-8"?> +<included> + + <!-- include everything in this project at debug level --> + <logger name="com.acme.sample.brooklyn" level="DEBUG"/> + + <!-- logfile named after this project --> + <property name="logging.basename" scope="context" value="brooklyn-sample" /> + +</included> http://git-wip-us.apache.org/repos/asf/brooklyn-dist/blob/26c4604c/archetypes/quickstart/src/brooklyn-sample/src/main/resources/sample-icon.png ---------------------------------------------------------------------- diff --git a/archetypes/quickstart/src/brooklyn-sample/src/main/resources/sample-icon.png b/archetypes/quickstart/src/brooklyn-sample/src/main/resources/sample-icon.png new file mode 100644 index 0000000..542a1de Binary files /dev/null and b/archetypes/quickstart/src/brooklyn-sample/src/main/resources/sample-icon.png differ http://git-wip-us.apache.org/repos/asf/brooklyn-dist/blob/26c4604c/archetypes/quickstart/src/brooklyn-sample/src/main/resources/visitors-creation-script.sql ---------------------------------------------------------------------- diff --git a/archetypes/quickstart/src/brooklyn-sample/src/main/resources/visitors-creation-script.sql b/archetypes/quickstart/src/brooklyn-sample/src/main/resources/visitors-creation-script.sql new file mode 100644 index 0000000..0a805c4 --- /dev/null +++ b/archetypes/quickstart/src/brooklyn-sample/src/main/resources/visitors-creation-script.sql @@ -0,0 +1,35 @@ +-- +-- Licensed to the Apache Software Foundation (ASF) under one +-- or more contributor license agreements. See the NOTICE file +-- distributed with this work for additional information +-- regarding copyright ownership. The ASF licenses this file +-- to you under the Apache License, Version 2.0 (the +-- "License"); you may not use this file except in compliance +-- with the License. You may obtain a copy of the License at +-- +-- http://www.apache.org/licenses/LICENSE-2.0 +-- +-- Unless required by applicable law or agreed to in writing, +-- software distributed under the License is distributed on an +-- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +-- KIND, either express or implied. See the License for the +-- specific language governing permissions and limitations +-- under the License. +-- +create database visitors; +use visitors; +create user 'brooklyn' identified by 'br00k11n'; +grant usage on *.* to 'brooklyn'@'%' identified by 'br00k11n'; +# ''@localhost is sometimes set up, overriding brooklyn@'%', so do a second explicit grant +grant usage on *.* to 'brooklyn'@'localhost' identified by 'br00k11n'; +grant all privileges on visitors.* to 'brooklyn'@'%'; +flush privileges; + +CREATE TABLE MESSAGES ( + id INT NOT NULL AUTO_INCREMENT, + NAME VARCHAR(30) NOT NULL, + MESSAGE VARCHAR(400) NOT NULL, + PRIMARY KEY (ID) + ); + +INSERT INTO MESSAGES values (default, 'Isaac Asimov', 'I grew up in Brooklyn' ); http://git-wip-us.apache.org/repos/asf/brooklyn-dist/blob/26c4604c/archetypes/quickstart/src/brooklyn-sample/src/test/java/com/acme/sample/brooklyn/sample/app/SampleLocalhostIntegrationTest.java ---------------------------------------------------------------------- diff --git a/archetypes/quickstart/src/brooklyn-sample/src/test/java/com/acme/sample/brooklyn/sample/app/SampleLocalhostIntegrationTest.java b/archetypes/quickstart/src/brooklyn-sample/src/test/java/com/acme/sample/brooklyn/sample/app/SampleLocalhostIntegrationTest.java new file mode 100644 index 0000000..f640f6a --- /dev/null +++ b/archetypes/quickstart/src/brooklyn-sample/src/test/java/com/acme/sample/brooklyn/sample/app/SampleLocalhostIntegrationTest.java @@ -0,0 +1,81 @@ +package com.acme.sample.brooklyn.sample.app; + +import java.util.Arrays; +import java.util.Iterator; + +import org.apache.brooklyn.api.entity.Entity; +import org.apache.brooklyn.api.entity.EntitySpec; +import org.apache.brooklyn.api.mgmt.ManagementContext; +import org.apache.brooklyn.core.mgmt.internal.LocalManagementContext; +import org.apache.brooklyn.core.entity.Entities; +import org.apache.brooklyn.core.entity.StartableApplication; +import org.apache.brooklyn.entity.webapp.JavaWebAppService; +import org.apache.brooklyn.util.core.ResourceUtils; +import org.apache.brooklyn.util.text.Strings; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.testng.Assert; +import org.testng.annotations.AfterMethod; +import org.testng.annotations.BeforeMethod; +import org.testng.annotations.Test; + +/** + * Sample integration tests which show how to launch the sample applications on localhost, + * make some assertions about them, and then destroy them. + */ +@Test(groups="Integration") +public class SampleLocalhostIntegrationTest { + + private static final Logger log = LoggerFactory.getLogger(SampleLocalhostIntegrationTest.class); + + private ManagementContext mgmt; + + @BeforeMethod(alwaysRun=true) + public void setup() { + mgmt = new LocalManagementContext(); + } + + @AfterMethod(alwaysRun=true) + public void shutdown() { + if (mgmt != null) Entities.destroyAll(mgmt); + } + + + public void testSingle() { + StartableApplication app = mgmt.getEntityManager().createEntity( + EntitySpec.create(StartableApplication.class, SingleWebServerSample.class)); + Entities.startManagement(app, mgmt); + Entities.start(app, Arrays.asList(mgmt.getLocationRegistry().resolve("localhost"))); + + Iterator<Entity> children = app.getChildren().iterator(); + if (!children.hasNext()) Assert.fail("Should have had a single JBoss child; had none"); + + Entity web = children.next(); + + if (children.hasNext()) Assert.fail("Should have had a single JBoss child; had too many: "+app.getChildren()); + + String url = web.getAttribute(JavaWebAppService.ROOT_URL); + Assert.assertNotNull(url); + + String page = new ResourceUtils(this).getResourceAsString(url); + log.info("Read web page for "+app+" from "+url+":\n"+page); + Assert.assertTrue(!Strings.isBlank(page)); + } + + public void testCluster() { + StartableApplication app = mgmt.getEntityManager().createEntity( + EntitySpec.create(StartableApplication.class, ClusterWebServerDatabaseSample.class)); + Entities.startManagement(app, mgmt); + Entities.start(app, Arrays.asList(mgmt.getLocationRegistry().resolve("localhost"))); + + log.debug("APP is started"); + + String url = app.getAttribute(JavaWebAppService.ROOT_URL); + Assert.assertNotNull(url); + + String page = new ResourceUtils(this).getResourceAsString(url); + log.info("Read web page for "+app+" from "+url+":\n"+page); + Assert.assertTrue(!Strings.isBlank(page)); + } + +} http://git-wip-us.apache.org/repos/asf/brooklyn-dist/blob/26c4604c/archetypes/quickstart/src/brooklyn-sample/src/test/java/com/acme/sample/brooklyn/sample/app/SampleUnitTest.java ---------------------------------------------------------------------- diff --git a/archetypes/quickstart/src/brooklyn-sample/src/test/java/com/acme/sample/brooklyn/sample/app/SampleUnitTest.java b/archetypes/quickstart/src/brooklyn-sample/src/test/java/com/acme/sample/brooklyn/sample/app/SampleUnitTest.java new file mode 100644 index 0000000..6a34301 --- /dev/null +++ b/archetypes/quickstart/src/brooklyn-sample/src/test/java/com/acme/sample/brooklyn/sample/app/SampleUnitTest.java @@ -0,0 +1,69 @@ +package com.acme.sample.brooklyn.sample.app; + +import org.apache.brooklyn.api.entity.Entity; +import org.apache.brooklyn.api.entity.EntitySpec; +import org.apache.brooklyn.api.mgmt.ManagementContext; +import org.apache.brooklyn.core.mgmt.internal.LocalManagementContext; +import org.apache.brooklyn.core.entity.Entities; +import org.apache.brooklyn.core.entity.StartableApplication; +import org.apache.brooklyn.entity.database.DatastoreMixins.DatastoreCommon; +import org.apache.brooklyn.entity.database.mysql.MySqlNode; +import org.apache.brooklyn.entity.webapp.JavaWebAppService; +import org.apache.brooklyn.entity.webapp.WebAppService; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.testng.Assert; +import org.testng.annotations.AfterMethod; +import org.testng.annotations.BeforeMethod; +import org.testng.annotations.Test; + +import com.google.common.base.Predicates; +import com.google.common.collect.Iterables; + +/** + * Unit tests for the sample applications defined in this project. + * Shows how to examine the spec and make assertions about configuration. + */ +@Test +public class SampleUnitTest { + + private static final Logger log = LoggerFactory.getLogger(SampleUnitTest.class); + + + private ManagementContext mgmt; + + @BeforeMethod(alwaysRun=true) + public void setup() { + mgmt = new LocalManagementContext(); + } + + @AfterMethod(alwaysRun=true) + public void shutdown() { + if (mgmt != null) Entities.destroyAll(mgmt); + } + + + public void testSampleSingleStructure() { + StartableApplication app = mgmt.getEntityManager().createEntity( + EntitySpec.create(StartableApplication.class, SingleWebServerSample.class)); + log.info("app from spec is: "+app); + + Assert.assertEquals(app.getChildren().size(), 1); + Assert.assertNotNull( app.getChildren().iterator().next().getConfig(JavaWebAppService.ROOT_WAR) ); + } + + public void testSampleClusterStructure() { + StartableApplication app = mgmt.getEntityManager().createEntity( + EntitySpec.create(StartableApplication.class, ClusterWebServerDatabaseSample.class)); + log.info("app from spec is: "+app); + + Assert.assertEquals(app.getChildren().size(), 2); + + Entity webappCluster = Iterables.find(app.getChildren(), Predicates.instanceOf(WebAppService.class)); + Entity database = Iterables.find(app.getChildren(), Predicates.instanceOf(DatastoreCommon.class)); + + Assert.assertNotNull( webappCluster.getConfig(JavaWebAppService.ROOT_WAR) ); + Assert.assertNotNull( database.getConfig(MySqlNode.CREATION_SCRIPT_URL) ); + } + +} http://git-wip-us.apache.org/repos/asf/brooklyn-dist/blob/26c4604c/archetypes/quickstart/src/main/resources/.gitignore ---------------------------------------------------------------------- diff --git a/archetypes/quickstart/src/main/resources/.gitignore b/archetypes/quickstart/src/main/resources/.gitignore new file mode 100644 index 0000000..6d7b6a3 --- /dev/null +++ b/archetypes/quickstart/src/main/resources/.gitignore @@ -0,0 +1 @@ +archetype-resources http://git-wip-us.apache.org/repos/asf/brooklyn-dist/blob/26c4604c/archetypes/quickstart/src/main/resources/META-INF/maven/archetype-metadata.xml ---------------------------------------------------------------------- diff --git a/archetypes/quickstart/src/main/resources/META-INF/maven/archetype-metadata.xml b/archetypes/quickstart/src/main/resources/META-INF/maven/archetype-metadata.xml new file mode 100644 index 0000000..4768945 --- /dev/null +++ b/archetypes/quickstart/src/main/resources/META-INF/maven/archetype-metadata.xml @@ -0,0 +1,65 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + Licensed to the Apache Software Foundation (ASF) under one + or more contributor license agreements. See the NOTICE file + distributed with this work for additional information + regarding copyright ownership. The ASF licenses this file + to you under the Apache License, Version 2.0 (the + "License"); you may not use this file except in compliance + with the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, + software distributed under the License is distributed on an + "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + KIND, either express or implied. See the License for the + specific language governing permissions and limitations + under the License. +--> +<archetype xmlns="http://maven.apache.org/plugins/maven-archetype-plugin/archetype/1.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/plugins/maven-archetype-plugin/archetype/1.0.0 http://maven.apache.org/xsd/archetype-1.0.0.xsd"> + + <fileSets> + <fileSet filtered="true" packaged="true"> + <directory>src/main/java</directory> + <includes> + <include>**/*.java</include> + </includes> + </fileSet> + + <fileSet filtered="true" packaged="true"> + <directory>src/test/java</directory> + <includes> + <include>**/*.java</include> + </includes> + </fileSet> + + <!-- we cannot have src/main/resources/** be "packaged" (package dirs prepended) and non-packaged; + so we put everything non-packaged here. + (also note for src/main/java, the root pom uses google-replacer to drop the "package" directory) --> + + <fileSet filtered="false" packaged="false"> + <directory></directory> + <includes> + <include>**/*.png</include> + <include>**/*.sh</include> + </includes> + </fileSet> + <fileSet filtered="true" packaged="false"> + <directory></directory> + <includes> + <include>**/*</include> + <include>*</include> + </includes> + <excludes> + <exclude>src/main/java/**</exclude> + <exclude>src/test/java/**</exclude> + <exclude>pom.xml</exclude> + <exclude>**.png</exclude> + <exclude>**.sh</exclude> + </excludes> + </fileSet> + </fileSets> + +</archetype> http://git-wip-us.apache.org/repos/asf/brooklyn-dist/blob/26c4604c/archetypes/quickstart/src/test/resources/projects/integration-test-1/.gitignore ---------------------------------------------------------------------- diff --git a/archetypes/quickstart/src/test/resources/projects/integration-test-1/.gitignore b/archetypes/quickstart/src/test/resources/projects/integration-test-1/.gitignore new file mode 100644 index 0000000..25d80f5 --- /dev/null +++ b/archetypes/quickstart/src/test/resources/projects/integration-test-1/.gitignore @@ -0,0 +1 @@ +reference http://git-wip-us.apache.org/repos/asf/brooklyn-dist/blob/26c4604c/archetypes/quickstart/src/test/resources/projects/integration-test-1/archetype.properties ---------------------------------------------------------------------- diff --git a/archetypes/quickstart/src/test/resources/projects/integration-test-1/archetype.properties b/archetypes/quickstart/src/test/resources/projects/integration-test-1/archetype.properties new file mode 100644 index 0000000..d1f4da4 --- /dev/null +++ b/archetypes/quickstart/src/test/resources/projects/integration-test-1/archetype.properties @@ -0,0 +1,22 @@ +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# +groupId=com.acme.sample +artifactId=brooklyn-sample +version=0.1.0-SNAPSHOT +package=com.acme.sample.brooklyn http://git-wip-us.apache.org/repos/asf/brooklyn-dist/blob/26c4604c/archetypes/quickstart/src/test/resources/projects/integration-test-1/goal.txt ---------------------------------------------------------------------- diff --git a/archetypes/quickstart/src/test/resources/projects/integration-test-1/goal.txt b/archetypes/quickstart/src/test/resources/projects/integration-test-1/goal.txt new file mode 100644 index 0000000..f7ffc47 --- /dev/null +++ b/archetypes/quickstart/src/test/resources/projects/integration-test-1/goal.txt @@ -0,0 +1 @@ +install \ No newline at end of file http://git-wip-us.apache.org/repos/asf/brooklyn-dist/blob/26c4604c/brooklyn-dist/.gitattributes ---------------------------------------------------------------------- diff --git a/brooklyn-dist/.gitattributes b/brooklyn-dist/.gitattributes deleted file mode 100644 index 7920d0e..0000000 --- a/brooklyn-dist/.gitattributes +++ /dev/null @@ -1,6 +0,0 @@ -#Don't auto-convert line endings for shell scripts on Windows (breaks the scripts) -* text=auto -*.sh text eol=lf -*.bat text eol=crlf -*.ps1 text eol=crlf -*.ini text eol=crlf http://git-wip-us.apache.org/repos/asf/brooklyn-dist/blob/26c4604c/brooklyn-dist/.gitignore ---------------------------------------------------------------------- diff --git a/brooklyn-dist/.gitignore b/brooklyn-dist/.gitignore deleted file mode 100644 index 2ef22e4..0000000 --- a/brooklyn-dist/.gitignore +++ /dev/null @@ -1,33 +0,0 @@ -\#*\# -*~ -*.bak -*.swp -*.swo -.DS_Store - -atlassian-ide-plugin.xml -*.class - -target/ -test-output/ - -.project -.classpath -.settings/ -.metadata/ - -.idea/ -*.iml - -nbactions.xml -nb-configuration.xml - -prodDb.* - -*.log -brooklyn*.log.* - -*brooklyn-persisted-state/ -*.vagrant/ - -ignored
