forked from clarin-eric/cmdi-toolkit
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
travis configuration: deploy on build
- Loading branch information
Showing
4 changed files
with
61 additions
and
1 deletion.
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,21 @@ | ||
<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"> | ||
<!-- | ||
This file is included so that Travis can deploy artifacts to CLARIN's nexus repository | ||
<https://nexus.clarin.eu> | ||
More info at <https://trac.clarin.eu/wiki/Nexus>. | ||
--> | ||
|
||
<servers> | ||
<server> | ||
<id>CLARIN</id> | ||
<username>${env.NEXUS_DEPLOY_USERNAME}</username> | ||
<password>${env.NEXUS_DEPLOY_PASSWORD}</password> | ||
</server> | ||
<server> | ||
<id>CLARIN-Snapshot</id> | ||
<username>${env.NEXUS_DEPLOY_USERNAME}</username> | ||
<password>${env.NEXUS_DEPLOY_PASSWORD}</password> | ||
</server> | ||
</servers> | ||
</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 @@ | ||
Files and settings for continuous integration (build/deploy jobs at Travis-CI) |
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,26 @@ | ||
#!/bin/bash | ||
|
||
# Determine Maven goal | ||
# Behaviour can be overridden by exporting the MVN_GOAL variable | ||
if [ ! -z "${MVN_GOAL}" ] | ||
then | ||
echo "Using goal from MVN_GOAL variable: ${MVN_GOAL}" | ||
else | ||
#by default, use "install" | ||
MVN_GOAL="install" | ||
|
||
#check if nexus credentials are set | ||
if [ -z "${NEXUS_DEPLOY_USERNAME}" ] || [ -z "${NEXUS_DEPLOY_PASSWORD}" ] | ||
then | ||
echo "Nexus credentials not set. Skipping Maven deployment!" | ||
else | ||
#if snapshot OR tag, deploy | ||
if [ ! -z "${TRAVIS_TAG}" ] || (grep "<version>" pom.xml|head -n1 | egrep -q "<version>.*SNAPSHOT</version>") | ||
then | ||
MVN_GOAL="deploy" | ||
else | ||
echo "Not a snapshot release or tagged revision. Skipping Maven deployment!" | ||
fi | ||
fi | ||
fi | ||
mvn ${MVN_GOAL} $@ |
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,4 +1,16 @@ | ||
sudo: false | ||
language: java | ||
jdk: | ||
- openjdk8 | ||
|
||
script: | ||
- bash -c 'if [ "${TRAVIS_TAG}" ]; then mvn versions:set -DnewVersion=${TRAVIS_TAG} versions:commit; fi' | ||
- .ci/build.sh -B --settings .ci/.maven-settings.xml | ||
|
||
deploy: | ||
provider: releases | ||
prerelease: true | ||
api_key: "${GITHUB_DEPLOY_TOKEN}" | ||
file: "target/cmd-toolkit-${TRAVIS_TAG}.jar" | ||
skip_cleanup: true | ||
on: | ||
tags: true |