-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
322 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
# Base build parameters | ||
base_build: &base_build | ||
working_directory: ~/repo | ||
docker: | ||
- image: circleci/openjdk:8-jdk | ||
environment: | ||
MAVEN_OPTS: -Xmx3200m | ||
|
||
# Base steps for maven project | ||
base_restore_cache: &base_restore_cache | ||
restore_cache: | ||
keys: | ||
- v1-dependencies-{{ checksum "pom.xml" }} | ||
# fallback to using the latest cache if no exact match is found | ||
- v1-dependencies- | ||
|
||
base_save_cache: &base_save_cache | ||
save_cache: | ||
paths: | ||
- ~/.m2 | ||
key: v1-dependencies-{{ checksum "pom.xml" }} | ||
|
||
# Jobs definitions | ||
version: 2 | ||
jobs: | ||
build: | ||
<<: *base_build | ||
|
||
steps: | ||
- checkout | ||
- *base_restore_cache | ||
- run: mvn dependency:go-offline | ||
- *base_save_cache | ||
# run tests! | ||
- run: mvn clean install | ||
|
||
deploy: | ||
<<: *base_build | ||
|
||
steps: | ||
- checkout | ||
- *base_restore_cache | ||
- run: mvn dependency:go-offline | ||
- *base_save_cache | ||
# Import key in GPG | ||
- run: echo $GPG_SECRET_KEY | base64 --decode | $GPG_EXECUTABLE --batch --import | ||
# Deploy to sonatype | ||
- run: mvn clean deploy -DskipTests -DdeployTo=sonatype --settings .circleci/settings.xml | ||
|
||
# Workflow definitions | ||
workflows: | ||
version: 2 | ||
deploy_sonatype: | ||
jobs: | ||
- build | ||
# If we are on master or a release branch, we deploy directly to sonatype. Release version will still need manual | ||
# approval via sonatype UI: https://oss.sonatype.org/#stagingRepositories | ||
- deploy: | ||
context: org-global | ||
requires: | ||
- build | ||
filters: | ||
branches: | ||
only: | ||
- master | ||
- /^release\/.*$/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd"> | ||
<servers> | ||
<server> | ||
<id>sonatype-nexus-snapshots</id> | ||
<username>${env.SONATYPE_USER}</username> | ||
<password>${env.SONATYPE_PASSWORD}</password> | ||
</server> | ||
<server> | ||
<id>sonatype-nexus-staging</id> | ||
<username>${env.SONATYPE_USER}</username> | ||
<password>${env.SONATYPE_PASSWORD}</password> | ||
</server> | ||
</servers> | ||
|
||
<profiles> | ||
<profile> | ||
<id>sonatype-nexus-repo</id> | ||
<properties> | ||
<gpg.executable>${env.GPG_EXECUTABLE}</gpg.executable> | ||
<gpg.secret.key>${env.GPG_SECRET_KEY}</gpg.secret.key> | ||
<gpg.passphrase>${env.GPG_PASSPHRASE}</gpg.passphrase> | ||
</properties> | ||
<repositories> | ||
<repository> | ||
<id>sonatype-nexus-staging</id> | ||
<name>Nexus Release Repository</name> | ||
<url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url> | ||
<releases> | ||
<enabled>true</enabled> | ||
</releases> | ||
</repository> | ||
<repository> | ||
<id>sonatype-nexus-snapshots</id> | ||
<name>Sonatype Nexus Snapshots</name> | ||
<url>https://oss.sonatype.org/content/repositories/snapshots/</url> | ||
<snapshots> | ||
<enabled>true</enabled> | ||
</snapshots> | ||
</repository> | ||
</repositories> | ||
</profile> | ||
</profiles> | ||
|
||
<activeProfiles> | ||
<activeProfile>sonatype-nexus-repo</activeProfile> | ||
</activeProfiles> | ||
</settings> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
target | ||
.idea |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
# Three Tier Webapp | ||
# Brooklyn Three Tier Webapp Entity | ||
|
||
This is the core [Apache Brooklyn](http://brooklyn.apache.org/) integration for deployment and in-life management of a three tier webapp. | ||
|
||
See the [Apache Brooklyn documentation](http://brooklyn.apache.org/v/latest/start/policies.html) for further details of this blueprint. | ||
See the [Apache Brooklyn documentation](http://brooklyn.apache.org/v/latest/start/policies.html) for further details of this blueprint. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
# Perform releases | ||
|
||
## SNAPSHOT releases | ||
|
||
`master` branch should only contains `SNAPSHOT` version. Upon every commit pushed on `master`, Circle CI will build, sign | ||
then deploy `SNAPSHOT` version to sonatype automatically. | ||
|
||
## Official releases | ||
|
||
To perform an official release, simply create a branch `release/<version>`, update the version number in the code then push | ||
your changes. Circle CI will build, sign then deploy artifacts to sonatype automatically. | ||
|
||
You will then need to go to the [sonatype UI](https://oss.sonatype.org/#stagingRepositories) to manually | ||
[close and release artifacts](http://central.sonatype.org/pages/releasing-the-deployment.html). | ||
|
||
## Manual releases | ||
|
||
You can always perform manual releases by running the following command: | ||
|
||
```bash | ||
mvn clean deploy -DskipTests -DdeployTo=sonatype --settings .circleci/settings.xml | ||
``` | ||
|
||
*If your project contains java classes, **don't forget to add** `source:jar javadoc:jar` to the deploy command above!* | ||
|
||
Note that you need to setup the following environment variables: | ||
|
||
|
||
| Environment variable | Value | | ||
| -------------------- | ------------------------------------------------------------------------------------------------- | | ||
| SONATYPE_USER | Sonatype user | | ||
| SONATYPE_PASSWORD | Sonatype password | | ||
| GPG_EXECUTABLE | GPG executable, e.g. `gpg` | | ||
| GPG_SECRET_KEY | GPG secret key to use. You can get it be running: `gpg -a --export-secret-keys <KEY-ID> | base64` | | ||
| GPG_PASSPHRASE | The passphrase of the <KEY-ID> | | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
brooklyn.catalog: | ||
items: | ||
- classpath://three-tier-webapp/three-tier-webapp.bom |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<features xmlns="http://karaf.apache.org/xmlns/features/v1.3.0" name="${project.artifactId}-${project.version}"> | ||
<feature name="${project.artifactId}" version="${project.version}"> | ||
<bundle>mvn:${project.groupId}/${project.artifactId}/${project.version}</bundle> | ||
</feature> | ||
|
||
<feature name="${project.artifactId}-bom" version="${project.version}"> | ||
<configfile finalname="${karaf.home}/catalog/${project.artifactId}-${project.version}.bom" override="true"> | ||
mvn:${project.groupId}/${project.artifactId}/${project.version}/bom/three-tier-webapp | ||
</configfile> | ||
</feature> | ||
</features> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,141 @@ | ||
<?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> | ||
|
||
<groupId>io.brooklyn.three-tier-webapp</groupId> | ||
<artifactId>brooklyn-three-tier-webapp</artifactId> | ||
<version>1.0.0-SNAPSHOT</version><!--BROOKLYN_THREE_TIER_WEBAPP_VERSION--> | ||
<packaging>bundle</packaging> | ||
|
||
<parent> | ||
<groupId>io.brooklyn</groupId> | ||
<artifactId>brooklyncentral-parent</artifactId> | ||
<version>1.0.2</version> | ||
</parent> | ||
|
||
<name>Brooklyn :: Three Tier Webapp</name> | ||
<description>This is the core Apache Brooklyn integration for deployment and in-life management of a three tier webapp. See the Apache Brooklyn documentation for further details of this blueprint</description> | ||
<url>https://github.com/brooklyncentral/brooklyn-three-tier-webapp</url> | ||
|
||
<properties> | ||
<build-helper-maven-plugin.version>3.0.0</build-helper-maven-plugin.version> | ||
<buildnumber-maven-plugin.version>1.4</buildnumber-maven-plugin.version> | ||
<maven-bundle-plugin.version>3.3.0</maven-bundle-plugin.version> | ||
</properties> | ||
|
||
<scm> | ||
<url>https://github.com/brooklyncentral/brooklyn-three-tier-webapp</url> | ||
<connection>scm:git:https://github.com/brooklyncentral/brooklyn-three-tier-webapp.git</connection> | ||
<developerConnection>scm:git:[email protected]:brooklyncentral/brooklyn-three-tier-webapp.git</developerConnection> | ||
<tag>HEAD</tag> | ||
</scm> | ||
|
||
<licenses> | ||
<license> | ||
<name>Apache 2.0</name> | ||
<url>http://www.apache.org/licenses/LICENSE-2.0.txt</url> | ||
</license> | ||
</licenses> | ||
|
||
<!-- For the full list of developers, see contributors to https://github.com/brooklyncentral/brooklyn-elk --> | ||
<developers> | ||
<developer> | ||
<name>Cloudsoft</name> | ||
<organizationUrl>https://github.com/cloudsoft</organizationUrl> | ||
</developer> | ||
</developers> | ||
|
||
<build> | ||
<resources> | ||
<resource> | ||
<directory>catalog</directory> | ||
<filtering>false</filtering> | ||
</resource> | ||
<resource> | ||
<directory>feature</directory> | ||
<filtering>true</filtering> | ||
</resource> | ||
<resource> | ||
<directory>resources</directory> | ||
<filtering>false</filtering> | ||
</resource> | ||
</resources> | ||
<pluginManagement> | ||
<plugins> | ||
<plugin> | ||
<groupId>org.codehaus.mojo</groupId> | ||
<artifactId>build-helper-maven-plugin</artifactId> | ||
<version>${build-helper-maven-plugin.version}</version> | ||
</plugin> | ||
<plugin> | ||
<groupId>org.apache.felix</groupId> | ||
<artifactId>maven-bundle-plugin</artifactId> | ||
<version>${maven-bundle-plugin.version}</version> | ||
</plugin> | ||
<plugin> | ||
<groupId>org.apache.karaf.tooling</groupId> | ||
<artifactId>karaf-maven-plugin</artifactId> | ||
<version>${karaf-maven-plugin.version}</version> | ||
<extensions>true</extensions> | ||
</plugin> | ||
</plugins> | ||
</pluginManagement> | ||
<plugins> | ||
<plugin> | ||
<groupId>org.codehaus.mojo</groupId> | ||
<artifactId>buildnumber-maven-plugin</artifactId> | ||
<executions> | ||
<execution> | ||
<phase>validate</phase> | ||
<goals> | ||
<goal>create</goal> | ||
</goals> | ||
</execution> | ||
</executions> | ||
</plugin> | ||
<plugin> | ||
<groupId>org.apache.felix</groupId> | ||
<artifactId>maven-bundle-plugin</artifactId> | ||
<extensions>true</extensions> | ||
<executions> | ||
<execution> | ||
<id>bundle-manifest</id> | ||
<phase>process-classes</phase> | ||
<goals> | ||
<goal>manifest</goal> | ||
</goals> | ||
</execution> | ||
</executions> | ||
</plugin> | ||
<plugin> | ||
<groupId>org.codehaus.mojo</groupId> | ||
<artifactId>build-helper-maven-plugin</artifactId> | ||
<executions> | ||
<execution> | ||
<id>attach-artifact</id> | ||
<phase>package</phase> | ||
<goals> | ||
<goal>attach-artifact</goal> | ||
</goals> | ||
<configuration> | ||
<artifacts> | ||
<artifact> | ||
<file>${project.build.outputDirectory}/three-tier-webapp/three-tier-webapp.bom</file> | ||
<classifier>three-tier-webapp</classifier> | ||
<type>bom</type> | ||
</artifact> | ||
<artifact> | ||
<file>${project.build.outputDirectory}/feature.xml</file> | ||
<classifier>features</classifier> | ||
<type>xml</type> | ||
</artifact> | ||
</artifacts> | ||
</configuration> | ||
</execution> | ||
</executions> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
</project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters