Skip to content

Commit

Permalink
[all] Use travis CI for deployment.
Browse files Browse the repository at this point in the history
see #649

Signed-off-by: Stéphane Galland <galland@arakhne.org>
  • Loading branch information
gallandarakhneorg committed Apr 28, 2017
1 parent fa57882 commit 0a36ac2
Show file tree
Hide file tree
Showing 5 changed files with 62 additions and 9 deletions.
12 changes: 12 additions & 0 deletions .travis.yml
Expand Up @@ -46,3 +46,15 @@ cache:
- $HOME/.m2
- $HOME/.binaries

env:
global:
- secure: "e+S71qmexycXKKiRLzc/B12HO64XiGxB9nWW5vifuOI22qjsma6T2z4z+v5qWgSG0O5SEHjQCw+rXDjoqjD0hA8qHpiaFb5vuKS69ulBFfTM5QT4+5F3RX/xepYfrUZlAner7ES7UrYnwDOlASrARiy1HLmcWHcruLosWWgev9Y="
- secure: "grzZIv0E+OjSYyB81LH9j2KjH2SCspvsRY54KXD0dP7QmFb8pNbWClhV0TpGevaU4uocDn2ZhlXQdCEpzpesHo0LcPKz+b03xPg6ydbXvMuFXzJ4fFEUfi5iaRGuDDIFm/IPGEMRYyv62poUMFiKpwgECvFjE4ECG8NPegpZnz8="
- secure: "aIOrF7Oa3r2ZWuRC6YwSuw1UnDoBLz8uLjNmtq3ZIJzukI93NfjmnJcr+d278nvqOWm/eR+UPkE8fB8PgWamAoxYRK60bjP9ScvaudqR4cztwKMzHLetR1+h0yt3qRS3sl2ImdY2k0UkZDLe+sW7ColCnC1pKM4ty9mbs2tBbvk="
- secure: "SIQFWoeSvpHTtWi9x8SZ7J2qDU7OspParyQLAMuKsOK/SMeRbSEGoz1GMgoGMkTsrV64jbG82FTp+0h1ja4ImiaqNuJU7nnIya1CXQOQdtt2q0kcnVBUwhjNoASbxNdScFYrFRIv6205PlolehhpNl52YK5v1Lk0fdfxCaYaxsY="

# Deployment of the SNAPSHOT version.
after_success:
- "[[ ${TRAVIS_OS_NAME} == 'linux' ]] && [[ ${TRAVIS_PULL_REQUEST} == 'false' ]] && [[ ${TRAVIS_TAG} == '' ]] && [[ ${TRAVIS_BRANCH} == 'master' ]] && mvn -B deploy -DskipTests -Dmaven.test.skip=true -Dcheckstyle.skip=true --settings build-tools/src/main/resources/maven/deploy-settings.xml"


23 changes: 23 additions & 0 deletions build-tools/scripts/mvn-release-sarl.sh
@@ -0,0 +1,23 @@
#!/usr/bin/env bash

if [ -z "$MAVENSARLIO_URL" ]; then
echo "You must define the MAVENSARLIO_URL environment variable to the URL of the Maven upload server , e.g. dav:https://myhost/dav" 1>&2
exit 255
fi

if [ -z "$UPDATESSARLIO_URL" ]; then
echo "You must define the UPDATESSARLIO_URL environment variable to the URL of the P2 upload server , e.g. dav:https://myhost/dav" 1>&2
exit 255
fi

if [ -z "$MAVENSARLIO_USER" ]; then
echo "You must define the MAVENSARLIO_USER environment variable with the login to the upload servers." 1>&2
exit 255
fi

PASSPHRASE=`ssh-askpass "Please enter your password to the upload server:"`

CDIR="`dirname $0`"

exec "$CDIR/mvn-headless" clean deploy -Dmaven.test.skip=true -DskipTests=true -DMAVENSARLIO_USER="$MAVENSARLIO_USER" -DMAVENSARLIO_PWD="$PASSPHRASE" -DMAVENSARLIO_URL="$MAVENSARLIO_URL" -DUPDATESSARLIO_URL="$UPDATESARLIO_URL" -PuploadP2Repo --settings "$CDIR/../src/main/resources/maven/deploy-settings.xml" "$@"

14 changes: 14 additions & 0 deletions build-tools/src/main/resources/maven/deploy-settings.xml
@@ -0,0 +1,14 @@
<settings>
<servers>
<server>
<id>io.sarl.maven</id>
<username>${env.MAVENSARLIO_USER}</username>
<password>${env.MAVENSARLIO_PWD}</password>
</server>
<server>
<id>io.sarl.updates</id>
<username>${env.MAVENSARLIO_USER}</username>
<password>${env.MAVENSARLIO_PWD}</password>
</server>
</servers>
</settings>
19 changes: 11 additions & 8 deletions pom.xml
Expand Up @@ -65,10 +65,6 @@
<copyrighters>the original authors or authors</copyrighters>
<!-- URL of the Maven repositories of SARL (use in POM and documentation) -->
<sarl.maven.repository.url>http://maven.sarl.io</sarl.maven.repository.url>
<!-- Local path to the Maven repository -->
<local.maven.repository.path>file:///var/www/sarl-maven-repository/</local.maven.repository.path>
<!-- Local path to the P2 repository -->
<local.p2.repository.path>file:///var/www/sarl-p2-repository/</local.p2.repository.path>
</properties>

<!-- ======================================= -->
Expand Down Expand Up @@ -175,12 +171,12 @@

<distributionManagement>
<repository>
<id>local-release-repository</id>
<url>${local.maven.repository.path}</url>
<id>io.sarl.maven</id>
<url>${env.MAVENSARLIO_URL}</url>
</repository>
<snapshotRepository>
<id>local-repository</id>
<url>${local.maven.repository.path}</url>
<id>io.sarl.maven</id>
<url>${env.MAVENSARLIO_URL}</url>
</snapshotRepository>
</distributionManagement>

Expand Down Expand Up @@ -388,6 +384,13 @@
<!-- ======================================= -->

<build>
<extensions>
<extension>
<groupId>org.apache.maven.wagon</groupId>
<artifactId>wagon-webdav-jackrabbit</artifactId>
<version>2.12</version>
</extension>
</extensions>
<pluginManagement>
<plugins>
<plugin>
Expand Down
3 changes: 2 additions & 1 deletion products/updatesite/pom.xml
Expand Up @@ -167,7 +167,7 @@

<properties>
<!-- Properties relative to the distant host where to upload the repo -->
<p2UploadFolder>${local.p2.repository.path}</p2UploadFolder>
<p2UploadFolder>${env.UPDATESSARLIO_URL}</p2UploadFolder>
<!-- Relative path to the repo being uploaded -->
<p2RepoPath>${project.build.directory}/repository/</p2RepoPath>
</properties>
Expand All @@ -186,6 +186,7 @@
<goal>upload</goal>
</goals>
<configuration>
<serverId>io.sarl.updates</serverId>
<fromDir>${p2RepoPath}</fromDir>
<includes>**</includes>
<toDir>${p2UploadToDir}</toDir>
Expand Down

0 comments on commit 0a36ac2

Please sign in to comment.