Skip to content

Commit 098355b

Browse files
authored
Merge pull request #72 from scalecube/develop
Release
2 parents 90ee9da + dbb2eb4 commit 098355b

File tree

6 files changed

+86
-39
lines changed

6 files changed

+86
-39
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,6 @@
1515

1616
# IntelliJ IDEA project files and directories
1717
*.iml
18+
19+
**/pom.xml.releaseBackup
20+
/release.properties

.travis.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ jdk: openjdk8
88
before_install:
99
- "./src/main/scripts/ci/before-install.sh"
1010
- "./src/main/scripts/cd/before-deploy.sh"
11+
script: "mvn verify -B"
1112
after_success: "./src/main/scripts/ci/after-success.sh"
1213
deploy:
1314
- provider: script
@@ -20,3 +21,8 @@ deploy:
2021
- "./src/main/scripts/cd/release.sh"
2122
on:
2223
branch: master
24+
- provider: script
25+
script:
26+
- "./src/main/scripts/cd/release.sh"
27+
on:
28+
tags: true

pom.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,7 @@
124124
<configuration>
125125
<overWriteReleases>false</overWriteReleases>
126126
<outputDirectory>${project.build.directory}/lib</outputDirectory>
127+
<silent>true</silent>
127128
</configuration>
128129
</execution>
129130
</executions>
@@ -282,6 +283,7 @@
282283
</goals>
283284
<configuration>
284285
<additionalparam>-Xdoclint:none</additionalparam>
286+
<quiet>true</quiet>
285287
</configuration>
286288
</execution>
287289
</executions>

src/main/scripts/cd/before-deploy.sh

Lines changed: 29 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -6,52 +6,52 @@ BEFORE_DEPLOY_EXEC_FILES=$(find $DIRNAME -name 'before-deploy-*.sh')
66
echo Running $0
77
echo *-*-*-*-*-*-*-*-*-*-*-*-*-*
88

9-
function decryptsecrets {
10-
echo decrypting secrets
11-
echo *-*-*-*-*-*-*-*-*-*-*-*
12-
mkdir -p ~/tmp
13-
openssl aes-256-cbc -K $encrypted_SOME_key -iv $encrypted_SOME_iv -in $TRAVIS_BUILD_DIR/src/main/scripts/cd/secrets.tar.enc -out ~/tmp/secrets.tar -d
14-
md5sum ~/tmp/secrets.tar
15-
tar -xvf ~/tmp/secrets.tar -C ~/.ssh
16-
shred -z -u ~/tmp/secrets.tar
9+
decryptsecrets() {
10+
echo decrypting secrets
11+
echo *-*-*-*-*-*-*-*-*-*-*-*
12+
mkdir -p ~/tmp
13+
openssl aes-256-cbc -K $encrypted_SOME_key -iv $encrypted_SOME_iv -in $TRAVIS_BUILD_DIR/src/main/scripts/cd/secrets.tar.enc -out ~/tmp/secrets.tar -d
14+
md5sum ~/tmp/secrets.tar
15+
tar -xvf ~/tmp/secrets.tar -C ~/.ssh
16+
shred -z -u ~/tmp/secrets.tar
1717
}
1818

19-
function importpgp {
20-
echo importing pgp secret
21-
echo *-*-*-*-*-*-*-*-*-*-*-*
22-
eval $(gpg-agent --daemon --batch)
19+
importpgp() {
20+
echo importing pgp secret
21+
echo *-*-*-*-*-*-*-*-*-*-*-*
22+
eval $(gpg-agent --daemon --batch)
2323
gpg --batch --passphrase $GPG_PASSPHRASE --import ~/.ssh/codesigning.asc
2424
shred -z -u ~/.ssh/codesigning.asc
2525
}
2626

27-
function setupssh {
28-
echo importing ssh secret
29-
echo *-*-*-*-*-*-*-*-*-*-*-*
27+
setupssh() {
28+
echo importing ssh secret
29+
echo *-*-*-*-*-*-*-*-*-*-*-*
3030
chmod 400 ~/.ssh/id_rsa
3131
touch ~/.ssh/config
3232

3333
echo "Host github.com" >> $HOME/.ssh/config
3434
echo " IdentityFile $HOME/.ssh/id_rsa" >> $HOME/.ssh/config
3535
echo " StrictHostKeyChecking no" >> $HOME/.ssh/config
36-
37-
eval "$(ssh-agent -s)"
38-
ssh-add ~/.ssh/id_rsa
39-
ssh -T [email protected] | true
36+
37+
eval "$(ssh-agent -s)"
38+
ssh-add ~/.ssh/id_rsa
39+
ssh -T [email protected] | true
4040
}
41-
42-
function setupgit {
43-
echo setting git up
44-
echo *-*-*-*-*-*-*-*-*-*-*-*
41+
42+
setupgit() {
43+
echo setting git up
44+
echo *-*-*-*-*-*-*-*-*-*-*-*
4545
git remote set-url origin [email protected]:$TRAVIS_REPO_SLUG.git
46-
git config --global user.email "[email protected]"
46+
git config --global user.email "[email protected]"
4747
git config --global user.name "io-scalecube-ci"
48-
git checkout -B $TRAVIS_BRANCH | true
48+
git checkout -B $TRAVIS_BRANCH | true
4949
}
5050

51-
function deployment {
52-
if [ "$TRAVIS_PULL_REQUEST" == 'false' ] && [ "$TRAVIS_BRANCH" = 'master' ] || [ "$TRAVIS_BRANCH" = 'develop' ]; then
53-
echo deployment
54-
echo *-*-*-*-*-*-*-*-*-*-*-*
51+
deployment() {
52+
if [ "$TRAVIS_PULL_REQUEST" = 'false' -a "$TRAVIS_BRANCH" = 'master' -o "$TRAVIS_BRANCH" = 'develop' -o -n "$TRAVIS_TAG" ]; then
53+
echo deployment
54+
echo *-*-*-*-*-*-*-*-*-*-*-*
5555
decryptsecrets
5656
importpgp
5757
setupssh

src/main/scripts/cd/release.sh

Lines changed: 45 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,19 +6,55 @@ RELEASE_EXEC_FILES=$(find $DIRNAME -name 'release-*.sh')
66
echo Running $0
77
echo *-*-*-*-*-*-*-*-*-*-*-*-*-*
88

9+
. $DIRNAME/before-deploy.sh
10+
911
commit_to_develop() {
10-
git fetch
11-
git branch -r
12-
git checkout -B develop
13-
git rebase master
14-
git commit --amend -m "++++ Prepare for next development iteration build: $TRAVIS_BUILD_NUMBER ++++"
15-
git push origin develop
12+
git fetch
13+
git branch -r
14+
git checkout -B develop
15+
git rebase $TRAVIS_BRANCH
16+
git commit --amend -m "++++ Prepare for next development iteration build: $TRAVIS_BUILD_NUMBER ++++"
17+
git push origin develop
18+
}
19+
20+
check_next_version() {
21+
export NEXT_VERSION=$(echo $TRAVIS_COMMIT_MESSAGE | grep -E -o '[0-9]+\.[0-9]+\.[0-9]+-SNAPSHOT')
22+
if [ -n "$NEXT_VERSION" ] ; then
23+
export MVN_NEXT_VERSION=-DdevelopmentVersion=$NEXT_VERSION
24+
fi
1625
}
1726

18-
mvn -P release -Darguments=-DskipTests release:prepare release:perform -DautoVersionSubmodules=true -DscmCommentPrefix="$TRAVIS_COMMIT_MESSAGE [skip ci] " -B -V -s travis-settings.xml
27+
check_tag_for_rc() {
28+
export VERSION=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)
29+
if [ -n "$TRAVIS_TAG" ] ; then
30+
RC_VER=$(echo $TRAVIS_TAG | grep -E -o 'RC-?[0-9]+')
31+
RC_PREPARE=$(echo $TRAVIS_TAG | grep -o -i 'prepare')
32+
if [ -n "$RC_VER" -a -n "$RC_PREPARE" ] ; then
33+
export NEW_RC_VERSION=$(echo $VERSION | sed "s/SNAPSHOT/$RC_VER/g")
34+
echo Release candidate: $NEW_RC_VERSION
35+
echo *-*-*-*-*-*-*-*-*-*-*-*
36+
decryptsecrets
37+
importpgp
38+
setupssh
39+
setupgit
40+
export MVN_RELEASE_VERSION=-DreleaseVersion=$NEW_RC_VERSION
41+
if [ -n "$MVN_NEXT_VERSION" ] ; then
42+
export MVN_NEXT_VERSION=-DdevelopmentVersion=$VERSION;
43+
fi
44+
fi
45+
fi
46+
}
47+
48+
check_next_version
49+
check_tag_for_rc
50+
51+
mvn -P release -Darguments=-DskipTests release:prepare release:perform $MVN_RELEASE_VERSION $MVN_NEXT_VERSION -DautoVersionSubmodules=true -DscmCommentPrefix="$TRAVIS_COMMIT_MESSAGE [skip ci] " -B -V -s travis-settings.xml || exit 126
52+
53+
mvn -B -q clean
1954

20-
mvn clean
21-
commit_to_develop
55+
if [ -z "$NEW_RC_VERSION" ]; then
56+
commit_to_develop
57+
fi
2258

2359
# extends release.sh
2460
for script_file in $RELEASE_EXEC_FILES; do

src/main/scripts/ci/before-install.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ latest=$(curl "https://oss.sonatype.org/service/local/repositories/releases/cont
1414

1515
echo Downloading latest version $latest of codacy reporter from sonatype
1616
# download latest assembly jar
17-
mvn dependency:get dependency:copy \
17+
mvn -B -q dependency:get dependency:copy \
1818
-DoutputDirectory=$HOME \
1919
-DoutputAbsoluteArtifactFilename=true \
2020
-Dmdep.stripVersion=true \

0 commit comments

Comments
 (0)