Skip to content

Commit 4dcdfe6

Browse files
authored
Merge pull request #79 from scalecube/develop
New release
2 parents cea9ffa + 0e40c79 commit 4dcdfe6

27 files changed

+1197
-53
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 & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ addons:
44
- libxml-xpath-perl
55
sudo: required
66
language: java
7-
jdk: openjdk8
7+
jdk: openjdk11
88
before_install:
99
- "./src/main/scripts/ci/before-install.sh"
1010
- "./src/main/scripts/cd/before-deploy.sh"
@@ -21,3 +21,8 @@ deploy:
2121
- "./src/main/scripts/cd/release.sh"
2222
on:
2323
branch: master
24+
- provider: script
25+
script:
26+
- "./src/main/scripts/cd/release.sh"
27+
on:
28+
tags: true

jwt/pom.xml

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -27,17 +27,6 @@
2727
<groupId>io.jsonwebtoken</groupId>
2828
<artifactId>jjwt-jackson</artifactId>
2929
</dependency>
30-
31-
<dependency>
32-
<groupId>org.junit.jupiter</groupId>
33-
<artifactId>junit-jupiter-engine</artifactId>
34-
<scope>test</scope>
35-
</dependency>
36-
<dependency>
37-
<groupId>io.projectreactor</groupId>
38-
<artifactId>reactor-test</artifactId>
39-
<scope>test</scope>
40-
</dependency>
4130
</dependencies>
4231

4332
</project>

pom.xml

Lines changed: 53 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<parent>
77
<groupId>io.scalecube</groupId>
88
<artifactId>scalecube-parent-pom</artifactId>
9-
<version>0.0.17</version>
9+
<version>0.1.0-RC1</version>
1010
</parent>
1111

1212
<artifactId>scalecube-security-parent</artifactId>
@@ -25,14 +25,26 @@
2525

2626
<modules>
2727
<module>jwt</module>
28+
<module>tokens</module>
2829
</modules>
2930

3031
<properties>
3132
<jjwt.version>0.10.5</jjwt.version>
33+
<reactor.version>Dysprosium-RELEASE</reactor.version>
34+
<junit.version>5.1.1</junit.version>
35+
<mockito.version>2.24.5</mockito.version>
36+
<hamcrest.version>1.3</hamcrest.version>
3237
</properties>
3338

3439
<dependencyManagement>
3540
<dependencies>
41+
<dependency>
42+
<groupId>io.projectreactor</groupId>
43+
<artifactId>reactor-bom</artifactId>
44+
<version>${reactor.version}</version>
45+
<type>pom</type>
46+
<scope>import</scope>
47+
</dependency>
3648
<dependency>
3749
<groupId>io.jsonwebtoken</groupId>
3850
<artifactId>jjwt-api</artifactId>
@@ -50,4 +62,44 @@
5062
</dependency>
5163
</dependencies>
5264
</dependencyManagement>
65+
66+
<dependencies>
67+
<!-- Test scope -->
68+
<dependency>
69+
<groupId>org.junit.jupiter</groupId>
70+
<artifactId>junit-jupiter-engine</artifactId>
71+
<version>${junit.version}</version>
72+
<scope>test</scope>
73+
</dependency>
74+
<dependency>
75+
<groupId>org.junit.jupiter</groupId>
76+
<artifactId>junit-jupiter-params</artifactId>
77+
<version>${junit.version}</version>
78+
<scope>test</scope>
79+
</dependency>
80+
<dependency>
81+
<groupId>org.mockito</groupId>
82+
<artifactId>mockito-junit-jupiter</artifactId>
83+
<version>${mockito.version}</version>
84+
<scope>test</scope>
85+
</dependency>
86+
<dependency>
87+
<groupId>org.hamcrest</groupId>
88+
<artifactId>hamcrest-all</artifactId>
89+
<version>${hamcrest.version}</version>
90+
<scope>test</scope>
91+
</dependency>
92+
<dependency>
93+
<groupId>org.hamcrest</groupId>
94+
<artifactId>hamcrest-core</artifactId>
95+
<version>${hamcrest.version}</version>
96+
<scope>test</scope>
97+
</dependency>
98+
<dependency>
99+
<groupId>io.projectreactor</groupId>
100+
<artifactId>reactor-test</artifactId>
101+
<scope>test</scope>
102+
</dependency>
103+
</dependencies>
104+
53105
</project>

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)