Skip to content
This repository was archived by the owner on Jan 4, 2024. It is now read-only.

Commit 968d794

Browse files
committed
Having Checkstyle HTML report as part of Travis pipeline
1 parent ab38432 commit 968d794

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

.travis.yml

+24
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,31 @@ cache:
77
sudo: required
88
services:
99
- docker
10+
env:
11+
global:
12+
- ARTIFACTS_S3_BUCKET=schultedev-xml-metrics-to-html
13+
- S3_KEY_PREFIX=github/$TRAVIS_REPO_SLUG
14+
- CHECKSTYLE_HTML_REPORT_DIR=target/checkstyle-html-report
15+
addons:
16+
artifacts:
17+
working_dir: $CHECKSTYLE_HTML_REPORT_DIR
18+
paths:
19+
- $(ls $CHECKSTYLE_HTML_REPORT_DIR | tr "\n" ":")
20+
target_paths: $S3_KEY_PREFIX/$TRAVIS_COMMIT/checkstyle/:$S3_KEY_PREFIX/$TRAVIS_BRANCH/checkstyle/
21+
22+
before_script:
23+
- mkdir $CHECKSTYLE_HTML_REPORT_DIR
24+
- docker login -u="$DOCKER_USERNAME" -p="$DOCKER_PASSWORD"
25+
- docker pull schultedev/checkstyle-xml-to-html
1026
script: mvn verify
1127
after_success:
1228
- mvn versions:display-dependency-updates
1329
- mvn versions:display-plugin-updates
30+
- mvn checkstyle:checkstyle
31+
- docker run --rm
32+
-v $TRAVIS_BUILD_DIR/target/checkstyle-result.xml:/checkstyle-result.xml:ro
33+
-v $TRAVIS_BUILD_DIR/$CHECKSTYLE_HTML_REPORT_DIR:/tmp/checkstyle-html-report/
34+
schultedev/checkstyle-xml-to-html:latest
35+
- "curl -s -o /dev/null -w \"%{http_code}\" -H \"Authorization: token $GH_MS_API_PERSONAL_ACCESS_TOKEN\"
36+
-d \"{\\\"state\\\": \\\"success\\\", \\\"description\\\": \\\"Checkstyle HTML report\\\", \\\"context\\\": \\\"schultedev/Checkstyle\\\", \\\"target_url\\\": \\\"https://s3.amazonaws.com/$ARTIFACTS_S3_BUCKET/$S3_KEY_PREFIX/$TRAVIS_COMMIT/checkstyle/index.html\\\"}\"
37+
https://api.github.com/repos/$TRAVIS_REPO_SLUG/statuses/$TRAVIS_COMMIT"

0 commit comments

Comments
 (0)