Skip to content
This repository has been archived by the owner on Oct 15, 2024. It is now read-only.

Commit

Permalink
Merge pull request #4 from scalecube/develop
Browse files Browse the repository at this point in the history
Prepare new release
  • Loading branch information
artem-v authored Aug 13, 2018
2 parents cc16e75 + aca74f2 commit 27d690e
Show file tree
Hide file tree
Showing 6 changed files with 55 additions and 34 deletions.
8 changes: 4 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ addons:
packages:
- libxml-xpath-perl
sudo: required

language: java
jdk: openjdk8
before_install:
Expand All @@ -12,11 +11,12 @@ before_install:
after_success: "./src/main/scripts/ci/after-success.sh"
deploy:
- provider: script
script: mvn -P release deploy -DskipTests=true -B -V -s travis-settings.xml
script:
- "./src/main/scripts/cd/deploy.sh"
on:
branch: develop
- provider: script
script:
- "./src/main/scripts/cd/deploy.sh"
- "./src/main/scripts/cd/release.sh"
on:
branch: master
branch: master
18 changes: 3 additions & 15 deletions src/main/scripts/cd/deploy.sh
Original file line number Diff line number Diff line change
@@ -1,18 +1,6 @@
#!/bin/sh

echo Running $0
echo *-*-*-*-*-*-*-*-*-*-*-*-*-*

commit_to_develop() {
git fetch
git branch -r
git checkout -B develop
git rebase master
git commit --amend -m "++++ Prepare for next development iteration build: $TRAVIS_BUILD_NUMBER ++++"
git push origin develop && curl -u "$GITHUBUSER:$GITHUBTOKEN" -d '{"title": "Prepare new release","head": "develop","base": "master"}' https://api.github.com/repos/$TRAVIS_REPO_SLUG/pulls?access_token=$GITTOKEN

}

mvn -P release release:prepare release:perform -DautoVersionSubmodules=true -DscmCommentPrefix="$TRAVIS_COMMIT_MESSAGE [skip ci] " -DskipTests=true -B -V -s travis-settings.xml


mvn clean
commit_to_develop
mvn -P release deploy -DskipTests=true -B -V -s travis-settings.xml
19 changes: 19 additions & 0 deletions src/main/scripts/cd/release.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/bin/sh


echo Running $0
echo *-*-*-*-*-*-*-*-*-*-*-*-*-*

commit_to_develop() {
git fetch
git branch -r
git checkout -B develop
git rebase master
git commit --amend -m "++++ Prepare for next development iteration build: $TRAVIS_BUILD_NUMBER ++++"
git push origin develop
}

mvn -P release release:prepare release:perform -DautoVersionSubmodules=true -DscmCommentPrefix="$TRAVIS_COMMIT_MESSAGE [skip ci] " -DskipTests=true -B -V -s travis-settings.xml

mvn clean
commit_to_develop
12 changes: 8 additions & 4 deletions src/main/scripts/ci/after-success.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
#!/bin/bash


echo Running $0
echo *-*-*-*-*-*-*-*-*-*-*-*-*-*

if [ -z "$CODACY_PROJECT_TOKEN" ]; then
echo [WARNING] Please go to https://app.codacy.com/app/$TRAVIS_REPO_SLUG/settings/coverage and add CODACY_PROJECT_TOKEN to travis settings
echo [WARNING] Please go to https://app.codacy.com/app/$TRAVIS_REPO_SLUG/settings/coverage and add CODACY_PROJECT_TOKEN to travis settings
else
find -name jacoco.xml -exec java -jar ~/codacy-coverage-reporter-assembly.jar report -l Java -r {} \;
java -jar ~/codacy-coverage-reporter-assembly.jar final
fi;
find -name jacoco.xml | xargs -i java -jar ~/codacy-coverage-reporter-assembly.jar report -l Java --partial -r {}
java -jar ~/codacy-coverage-reporter-assembly.jar final
fi;
4 changes: 4 additions & 0 deletions src/main/scripts/ci/before-install.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
#!/usr/bin/env bash


echo Running $0
echo *-*-*-*-*-*-*-*-*-*-*-*-*-*

# get latest version of codacy reporter from sonatype
latest=$(curl "https://oss.sonatype.org/service/local/repositories/releases/content/com/codacy/codacy-coverage-reporter/maven-metadata.xml" | xpath -e "/metadata/versioning/release/text()")

Expand Down
28 changes: 17 additions & 11 deletions travis-settings.xml
Original file line number Diff line number Diff line change
@@ -1,9 +1,20 @@
<?xml version="1.0" encoding="UTF-8" ?>
<settings
xsi:schemaLocation='http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd'
xmlns='http://maven.apache.org/SETTINGS/1.0.0'
xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'>
xmlns='http://maven.apache.org/SETTINGS/1.0.0' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'>
<profiles>
<profile>
<id>skipstyle</id>
<properties>
<checkstyle.skip>true</checkstyle.skip>
</properties>
</profile>
<profile>
<id>skippmd</id>
<properties>
<pmd.skip>true</pmd.skip>
</properties>
</profile>
<profile>
<id>bintray</id>
<repositories>
Expand All @@ -19,25 +30,20 @@
</profile>
<profile>
<id>ossrh</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<properties>
<!-- <gpg.executable>gpg</gpg.executable> -->
<!-- <gpg.keyname>${env.GPG_KEY_NAME}</gpg.keyname> -->
<gpg.passphrase>${env.GPG_KEY}</gpg.passphrase>
</properties>
</profile>
</profiles>
<activeProfiles>
<activeProfile>bintray</activeProfile>
</activeProfiles>

<servers>
<server>
<id>ossrh</id>
<username>${env.SONATYPE_USERNAME}</username>
<password>${env.SONATYPE_PASSWORD}</password>
</server>
</servers>
<activeProfiles>
<activeProfile>bintray</activeProfile>
<activeProfile>ossrh</activeProfile>
</activeProfiles>
</settings>

0 comments on commit 27d690e

Please sign in to comment.