Add travis release config (#113)

This commit is contained in:
Alex Mukha
2019-06-05 22:02:34 +01:00
committed by GitHub
parent bab256ab36
commit d5d8c4c86f
3 changed files with 32 additions and 11 deletions

10
.travis.settings.xml Normal file
View File

@@ -0,0 +1,10 @@
<settings>
<!-- required to push artifacts to repositories -->
<servers>
<server>
<id>alfresco-public</id>
<username>${env.MAVEN_USERNAME}</username>
<password>${env.MAVEN_PASSWORD}</password>
</server>
</servers>
</settings>

View File

@@ -15,15 +15,30 @@ branches:
install: travis_retry mvn install -DskipTests=true -B -V
matrix:
stages:
- test
- release
jobs:
include:
- name: "Build and test"
- stage: test
name: "Build and test"
script: travis_retry mvn test
- name: "WhiteSource scan"
# only on support branches or master and if it is not a PR
if: fork = false AND (branch = master OR branch =~ /support\/.*/) AND type != pull_request
# only on SP branches or master and if it is not a PR
if: fork = false AND (branch = master OR branch =~ /support\/SP\/.*/) AND type != pull_request
script:
# Download the latest version of WhiteSource Unified Agent
- curl -LJO https://github.com/whitesource/unified-agent-distribution/raw/master/standAlone/wss-unified-agent.jar
# Run WhiteSource Unified Agent
- java -jar wss-unified-agent.jar -apiKey ${WHITESOURCE_API_KEY} -c .wss-unified-agent.config
- java -jar wss-unified-agent.jar -apiKey ${WHITESOURCE_API_KEY} -c .wss-unified-agent.config
- stage: release
name: "Push to Nexus"
if: fork = false AND (branch = master OR branch =~ /support\/.*/) AND type != pull_request AND commit_message !~ /\[no-release\]/
before_install:
- "cp .travis.settings.xml $HOME/.m2/settings.xml"
script:
# Use full history for release
- git checkout -B "${TRAVIS_BRANCH}"
# Skip building of release commits
- mvn --batch-mode -q -DscmCommentPrefix="[maven-release-plugin][skip ci] " -Dusername="${GIT_USERNAME}" -Dpassword="${GIT_PASSWORD}" -DskipTests -Darguments=-DskipTests release:clean release:prepare release:perform

View File

@@ -21,13 +21,9 @@
<distributionManagement>
<repository>
<id>alfresco-internal</id>
<id>alfresco-public</id>
<url>https://artifacts.alfresco.com/nexus/content/repositories/releases</url>
</repository>
<snapshotRepository>
<id>alfresco-internal-snapshots</id>
<url>https://artifacts.alfresco.com/nexus/content/repositories/snapshots</url>
</snapshotRepository>
</distributionManagement>
<properties>
@@ -39,7 +35,7 @@
source/java/org/alfresco/repo/search/impl/parsers/FTSParser.java,
source/java/org/alfresco/repo/search/impl/parsers/FTSLexer.java
</sonar.exclusions>
<maven.build.sourceVersion>11</maven.build.sourceVersion>
</properties>
<build>