fixed travis issues

This commit is contained in:
Mariusz Smykula
2016-04-04 23:17:59 +02:00
parent 9601dafbe1
commit 6b8e379283
3 changed files with 29 additions and 15 deletions

View File

@@ -6,6 +6,10 @@
<username>${env.CI_DEPLOY_USERNAME}</username>
<password>${env.CI_DEPLOY_PASSWORD}</password>
</server>
<server>
<id>github.com</id>
<username>${env.GITHUBKEY}</username>
</server>
</servers>
<profiles>

View File

@@ -2,25 +2,19 @@ language: java
jdk:
- oraclejdk8
before_install:
- true && [ "$TRAVIS_BRANCH" = 'master' ] && [ "$TRAVIS_PULL_REQUEST" == 'false' ] && openssl aes-256-cbc -K $encrypted_6c56aea9ab8c_key -iv $encrypted_6c56aea9ab8c_iv -in .mvn/codesigning.asc.enc -out .mvn/codesigning.asc -d
- true && [ "$TRAVIS_BRANCH" = 'master' ] && [ "$TRAVIS_PULL_REQUEST" == 'false' ] && gpg --fast-import .mvn/codesigning.asc
before_script:
- ./mvnw release-candidate:updateVersion -Drevision=$TRAVIS_BUILD_NUMBER
script:
- true && [ "$TRAVIS_BRANCH" = 'master' ] && [ "$TRAVIS_PULL_REQUEST" == 'false' ] && ./mvnw deploy --settings .mvn/settings.xml -Prelease
after_success:
- if [[ $TRAVIS_PULL_REQUEST == "false" && $TRAVIS_BRANCH == "master" ]]; then openssl aes-256-cbc -K $encrypted_6c56aea9ab8c_key -iv $encrypted_6c56aea9ab8c_iv -in .mvn/codesigning.asc.enc -out .mvn/codesigning.asc -d; fi
- if [[ $TRAVIS_PULL_REQUEST == "false" && $TRAVIS_BRANCH == "master" ]]; then gpg --fast-import .mvn/codesigning.asc; fi
- git config --global user.email "builds@travis-ci.com"
- git config --global user.name "Travis CI"
- export GIT_TAG=build-$(date -u "+%Y-%m-%d")-$TRAVIS_BUILD_NUMBER
- echo -n $GIT_TAG > public/version
- git commit -m "Set build VERSION number" public/version
- git tag $GIT_TAG -a -m "Generated tag from TravisCI build $TRAVIS_BUILD_NUMBER"
- true && [ "$TRAVIS_BRANCH" = 'master' ] && [ "$TRAVIS_PULL_REQUEST" == 'false' ] && git push --quiet https://$GITHUBKEY@github.com/Codearte/accurest-maven-plugin
$GIT_TAG > /dev/null 2>&1
before_script:
- if [[ $TRAVIS_PULL_REQUEST == "false" && $TRAVIS_BRANCH == "master" ]]; then ./mvnw release-candidate:updateVersion -Drevision=$TRAVIS_BUILD_NUMBER; fi
script:
- if [[ $TRAVIS_PULL_REQUEST == "false" && $TRAVIS_BRANCH == "master" ]]; then ./mvnw deploy --settings .mvn/settings.xml -Prelease; else ./mvnw install; fi
after_success:
- ./mvnw clean test jacoco:report coveralls:report
branches:
except:
- /^build-[0-9a-z\-]*/
- /^v\d/
cache:
directories:
- "~/.m2/repository"

18
pom.xml
View File

@@ -82,7 +82,7 @@
<goal>updateVersion</goal>
</goals>
<configuration>
<releaseVersionFormat>{{ api_version }}.${revision}</releaseVersionFormat>
<releaseVersionFormat>{{ api_version }}-${revision}</releaseVersionFormat>
</configuration>
</execution>
<execution>
@@ -192,6 +192,22 @@
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-scm-plugin</artifactId>
<version>1.9.4</version>
<executions>
<execution>
<phase>deploy</phase>
<goals>
<goal>tag</goal>
</goals>
</execution>
</executions>
<configuration>
<tag>v${project.version}</tag>
</configuration>
</plugin>
</plugins>
</build>
</profile>