Skip to content

Commit d0efc91

Browse files
authored
Merge pull request #18 from scalecube/Enable_codacy_on_projects#15
Enable codacy on projects (fix for #15)
2 parents 4c7c9d8 + d8aef4c commit d0efc91

File tree

5 files changed

+56
-5
lines changed

5 files changed

+56
-5
lines changed

.travis.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,12 @@ language: generic
22
sudo: required
33

44
env:
5-
- SLUG=scalecube/scalecube-cluster
5+
- SLUG=scalecube/scalecube-parent
66
- SLUG=scalecube/scalecube-security
7+
- SLUG=scalecube/scalecube-app-utils
78
- SLUG=scalecube/config
89
- SLUG=scalecube/scalecube-benchmarks
9-
- SLUG=scalecube/scalecube-parent
1010
- SLUG=scalecube/scalecube-gateway
11-
1211
services:
1312
- docker
1413

Dockerfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@ RUN apt-get install -qy jq maven
44
RUN ruby -v
55
RUN mvn -version
66
RUN gem install travis
7+
78
ADD entrypoint.sh /opt
9+
ADD travis-settings.xml /opt
810
ADD append.to.travis.yml /opt
911
ADD prepend.to.travis.yml /opt
1012

entrypoint.sh

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ mkdir -p ~/repo/src/main/scripts/ci/
3333
cp ~/src/main/scripts/ci/*.sh $TRAVIS_BUILD_DIR/src/main/scripts/ci/
3434
chmod u+x $TRAVIS_BUILD_DIR/src/main/scripts/ci/*.sh
3535

36+
cp ~/opt/travis-settings.xml $TRAVIS_BUILD_DIR/
37+
3638
git add --all
3739
git commit -am "+ script files" | true
3840

@@ -43,7 +45,7 @@ if [ ! -f '.travis.yml' ]; then
4345
travis init java --jdk openjdk8 \
4446
--before-install "./src/main/scripts/ci/before-install.sh" \
4547
--before-install "./src/main/scripts/cd/before-deploy.sh" \
46-
--after-success "java -jar ~/codacy-coverage-reporter-assembly.jar -l Java -r ./target/site/jacoco/jacoco.xml"
48+
--after-success "./src/main/scripts/ci/after-success.sh"
4749

4850
cat /opt/prepend.to.travis.yml .travis.yml /opt/append.to.travis.yml >> tmp.travis.yml
4951
mv tmp.travis.yml .travis.yml
@@ -106,7 +108,6 @@ fi
106108

107109
mvn -B -q -f $TRAVIS_BUILD_DIR/pom.xml -s $TRAVIS_BUILD_DIR/travis-settings.xml -P release \
108110
help:evaluate -Dexpression=gpg.passphrase -Doutput=/tmp/gpg.passphrase
109-
// TODO
110111

111112
mvn -B -q -f $TRAVIS_BUILD_DIR/pom.xml -s $TRAVIS_BUILD_DIR/travis-settings.xml -P release \
112113
fr.jcgay.maven.plugins:buildplan-maven-plugin:list-plugin -Dbuildplan.plugin=nexus-staging-maven-plugin -Dbuildplan.outputFile=/tmp/nexus-staging-maven-plugin

src/main/scripts/ci/after-success.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#!/bin/bash
2+
3+
if [ -z "$CODACY_PROJECT_TOKEN" ]; then
4+
echo [WARNING] Please go to https://app.codacy.com/app/$TRAVIS_REPO_SLUG/settings/coverage and add CODACY_PROJECT_TOKEN to travis settings
5+
else
6+
find -name jacoco.xml -exec java -jar ~/codacy-coverage-reporter-assembly.jar report -l Java -r {} --partial\;
7+
java -jar ~/codacy-coverage-reporter-assembly.jar final
8+
fi;

travis-settings.xml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
<?xml version="1.0" encoding="UTF-8" ?>
2+
<settings
3+
xsi:schemaLocation='http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd'
4+
xmlns='http://maven.apache.org/SETTINGS/1.0.0'
5+
xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'>
6+
<profiles>
7+
<profile>
8+
<id>bintray</id>
9+
<repositories>
10+
<repository>
11+
<id>central</id>
12+
<name>bintray</name>
13+
<url>http://jcenter.bintray.com</url>
14+
<snapshots>
15+
<enabled>false</enabled>
16+
</snapshots>
17+
</repository>
18+
</repositories>
19+
</profile>
20+
<profile>
21+
<id>ossrh</id>
22+
<activation>
23+
<activeByDefault>true</activeByDefault>
24+
</activation>
25+
<properties>
26+
<gpg.passphrase>${env.GPG_KEY}</gpg.passphrase>
27+
</properties>
28+
</profile>
29+
</profiles>
30+
<activeProfiles>
31+
<activeProfile>bintray</activeProfile>
32+
</activeProfiles>
33+
34+
<servers>
35+
<server>
36+
<id>ossrh</id>
37+
<username>${env.SONATYPE_USERNAME}</username>
38+
<password>${env.SONATYPE_PASSWORD}</password>
39+
</server>
40+
</servers>
41+
</settings>

0 commit comments

Comments
 (0)