Skip to content

Commit

Permalink
Merge pull request #16 from Bernardo-MG/merge_master
Browse files Browse the repository at this point in the history
Merge master
  • Loading branch information
Bernardo-MG committed Sep 10, 2015

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
2 parents 0f8f66e + bf74c91 commit 32b9076
Showing 7 changed files with 61 additions and 29 deletions.
36 changes: 24 additions & 12 deletions .scripts/create-maven-settings.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,20 @@
#!/bin/bash
# This script creates the Maven settings file
# This includes the connection settings, which are loaded from the server's environment
# This script creates the Maven settings file for deployment.
#
# The data generated during this script is sensible information. Don't print it on the console.
# This includes the connection settings, which are loaded from the server's environment variables.
#
# The data generated during this script should not be shared. Don't print it on the console.
#
# The following environmental variables are used:
# - DEPLOY_USER: string, user for the releases repo
# - DEPLOY_PASSWORD: string, password for the releases repo
# - DEPLOY_DEVELOP_USER: string, user for the development repo
# - DEPLOY_DEVELOP_PASSWORD: string, password for the development repo
# - DEPLOY_DOCS_USER: string, user for the releases documentation site repo
# - DEPLOY_DOCS_PASSWORD: string, password for the releases documentation site repo
# - DEPLOY_DOCS_DEVELOP_USER: string, user for the development documentation site repo
# - DEPLOY_DOCS_DEVELOP_PASSWORD: string, password for the development documentation site repo
# - SCM_BRANCH: string, the CMS branch from which the code has been taken

{
echo "<settings>";
@@ -11,32 +23,32 @@
# Releases FTP
echo "<server>";
echo "<id>releases</id>";
echo "<username>\${env.REPO_RELEASES_USER}</username>";
echo "<password>\${env.REPO_RELEASES_PASSWORD}</password>";
echo "<username>\${env.DEPLOY_USER}</username>";
echo "<password>\${env.DEPLOY_PASSWORD}</password>";
echo "</server>";
# DEVELOP FTP
echo "<server>";
echo "<id>snapshots</id>";
echo "<username>\${env.REPO_DEVELOP_USER}</username>";
echo "<password>\${env.REPO_DEVELOP_PASSWORD}</password>";
echo "<username>\${env.DEPLOY_DEVELOP_USER}</username>";
echo "<password>\${env.DEPLOY_DEVELOP_PASSWORD}</password>";
echo "</server>";
# Site FTP
echo "<server>";
echo "<id>site</id>";
echo "<username>\${env.REPO_SITE_USER}</username>";
echo "<password>\${env.REPO_SITE_PASSWORD}</password>";
echo "<username>\${env.DEPLOY_DOCS_USER}</username>";
echo "<password>\${env.DEPLOY_DOCS_PASSWORD}</password>";
echo "</server>";
# Development site FTP
echo "<server>";
echo "<id>site-development</id>";
echo "<username>\${env.REPO_SITE_DEVELOP_USER}</username>";
echo "<password>\${env.REPO_SITE_DEVELOP_PASSWORD}</password>";
echo "<username>\${env.DEPLOY_DOCS_DEVELOP_USER}</username>";
echo "<password>\${env.DEPLOY_DOCS_DEVELOP_PASSWORD}</password>";
echo "</server>";

echo "</servers>";

# Active profile
if [ "$TRAVIS_BRANCH" == "develop" ]; then
if [ "$SCM_BRANCH" == "develop" ]; then
echo "<activeProfiles>"
echo "<activeProfile>development</activeProfile>"
echo "</activeProfiles>"
16 changes: 12 additions & 4 deletions .scripts/deploy-site.sh
Original file line number Diff line number Diff line change
@@ -1,10 +1,18 @@
#!/bin/bash
# This script deploys the Maven site using the POM configuration
# It is triggered only commits to the master branch. Pulls are ignored
# This script deploys the Maven site.
#
# Also, it will only deploy if the DEPLOY environment variable is set to 'true'
# Make sure you have the deployment configuration ready before using it.
#
# It is triggered only commits to the master or develop branches, ignoring pulls.
#
# Also, it will only deploy if the DEPLOY_DOCS environment variable is set to 'true'.
#
# The following environmental variables are used:
# - PULL_REQUEST: boolean, indicates if this is a pull request, should be false for deployment
# - DEPLOY_DOCS: boolean, control flag for deployment, should be true to deploy
# - SCM_BRANCH: string, the CMS branch from which the code has been taken

if [ "$TRAVIS_PULL_REQUEST" == "false" ] && [ "$DEPLOY_DOCS" == "true" ] && [[ "$TRAVIS_BRANCH" == "master" || "$TRAVIS_BRANCH" == "develop" ]]; then
if [ "$PULL_REQUEST" == "false" ] && [ "$DEPLOY_DOCS" == "true" ] && [[ "$SCM_BRANCH" == "master" || "$SCM_BRANCH" == "develop" ]]; then

echo "Deploying Maven site"

16 changes: 12 additions & 4 deletions .scripts/deploy.sh
Original file line number Diff line number Diff line change
@@ -1,10 +1,18 @@
#!/bin/bash
# This script deploys the application using the POM configuration
# It is triggered only commits to the master or develop branches. Pulls are ignored
# This script deploys the project artifact.
#
# Also, it will only deploy if the DEPLOY environment variable is set to 'true'
# Make sure you have the deployment configuration ready before using it.
#
# It is triggered only commits to the master or develop branches, ignoring pulls.
#
# Also, it will only deploy if the DEPLOY environment variable is set to 'true'.
#
# The following environmental variables are used:
# - PULL_REQUEST: boolean, indicates if this is a pull request, should be false for deployment
# - DEPLOY: boolean, control flag for deployment, should be true to deploy
# - SCM_BRANCH: string, the CMS branch from which the code has been taken

if [ "$TRAVIS_PULL_REQUEST" == "false" ] && [ "$DEPLOY" == "true" ] && [[ "$TRAVIS_BRANCH" == "master" || "$TRAVIS_BRANCH" == "develop" ]]; then
if [ "$PULL_REQUEST" == "false" ] && [ "$DEPLOY" == "true" ] && [[ "$SCM_BRANCH" == "master" || "$SCM_BRANCH" == "develop" ]]; then

echo "Deploying Java artifact to repository"

4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -12,9 +12,9 @@ matrix:
- jdk: oraclejdk8
include:
- jdk: oraclejdk7
env: DEPLOY=true DEPLOY_DOCS=false
env: DEPLOY=true DEPLOY_DOCS=false PULL_REQUEST=$TRAVIS_PULL_REQUEST SCM_BRANCH=$TRAVIS_BRANCH
- jdk: oraclejdk8
env: DEPLOY=false DEPLOY_DOCS=true
env: DEPLOY=false DEPLOY_DOCS=true PULL_REQUEST=$TRAVIS_PULL_REQUEST SCM_BRANCH=$TRAVIS_BRANCH

before_install:
- chmod +x ./.scripts/create-maven-settings.sh
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -6,7 +6,7 @@ While it can be used by itself, just remember to check the documentation to find

The skin has been adapted from the static template [Docs Bootstrap Template][docs-template], which will be the visual reference to be followed by this project.

[![Maven Central](https://img.shields.io/maven-central/v/com.wandrell/docs-maven-skin.svg)][maven-repo]
[![Maven Central](https://img.shields.io/maven-central/v/com.wandrell.maven.skins/docs-maven-skin.svg)][maven-repo]
[![Bintray](https://api.bintray.com/packages/bernardo-mg/maven/docs-maven-skin/images/download.svg)][bintray-repo]

[![Release docs](https://img.shields.io/badge/docs-release-blue.svg)][site-release]
@@ -81,7 +81,7 @@ The project has been released under the [MIT License][license].
[library-archetype]: https://github.com/bernardo-mg/library-maven-archetype
[docs-template]: https://github.com/Bernardo-MG/docs-maven-skin
[bintray-repo]: https://bintray.com/bernardo-mg/maven/docs-maven-skin/view
[maven-repo]: http://mvnrepository.com/artifact/com.wandrell.maven/docs-maven-skin
[maven-repo]: http://mvnrepository.com/artifact/com.wandrell.maven.skins/docs-maven-skin
[issues]: https://github.com/Bernardo-MG/docs-maven-skin/issues
[javadoc-develop]: http://docs.wandrell.com/development/maven/docs-maven-skin/apidocs
[javadoc-release]: http://docs.wandrell.com/maven/docs-maven-skin/apidocs
9 changes: 4 additions & 5 deletions pom.xml
Original file line number Diff line number Diff line change
@@ -6,7 +6,7 @@

<groupId>com.wandrell.maven.skins</groupId>
<artifactId>docs-maven-skin</artifactId>
<version>0.1.1</version>
<version>0.1.2</version>
<packaging>jar</packaging>

<name>Docs Maven Skin</name>
@@ -110,7 +110,7 @@
<java.version.source>1.7</java.version.source>
<java.version.target>${java.version.source}</java.version.target>
<!-- Manifest data -->
<manifest.name>com/wandrell/site/skin/docs</manifest.name>
<manifest.name>com/wandrell/maven/skins/docs-maven-skin</manifest.name>
<!-- Dependencies versions -->
<velocity.version>1.7</velocity.version>
<wandrell.siteFixer.version>0.1.0</wandrell.siteFixer.version>
@@ -129,9 +129,8 @@
<extension.wagon.version>2.9</extension.wagon.version>
<!-- Maven Site -->
<site.skin.version>0.1.0</site.skin.version>
<repoDownloadURL>https://dl.bintray.com/bernardo-mg/maven/</repoDownloadURL>
<bintrayURL>https://bintray.com/bernardo-mg/maven/maven-site-fixer/view</bintrayURL>
<mavenURL>http://mvnrepository.com/artifact/com.wandrell.velocity/maven-site-fixer</mavenURL>
<bintrayURL>https://bintray.com/bernardo-mg/maven/docs-maven-skin/view</bintrayURL>
<mavenURL>http://mvnrepository.com/artifact/com.wandrell.maven.skins/docs-maven-skin</mavenURL>
</properties>

<dependencies>
5 changes: 5 additions & 0 deletions src/changes/changes.xml
Original file line number Diff line number Diff line change
@@ -19,5 +19,10 @@
Corrected links.
</action>
</release>
<release version="0.1.2" date="2015-09-10" description="Maven site">
<action dev="bmg" type="fix">
Corrected releases repositories links.
</action>
</release>
</body>
</document>

0 comments on commit 32b9076

Please sign in to comment.