forked from checkstyle/sonar-checkstyle
-
Notifications
You must be signed in to change notification settings - Fork 0
/
wercker.yml
43 lines (39 loc) · 1.24 KB
/
wercker.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
box: checkstyle/sonarqube-maven-git
build:
steps:
- script:
name: setup mvn local repo
code: |-
export MAVEN_OPTS="-Dmaven.repo.local=${WERCKER_CACHE_DIR}"
mvn -version
echo "------"
du -hs ${WERCKER_CACHE_DIR}
echo "------"
du -hs ${WERCKER_CACHE_DIR}/* | sort -h
# Build Checkstyle
- script:
name: Package plugin, install to sonar
code: |-
POM_VERSION=$(grep "<version>" pom.xml | head -n 1 | sed -E "s/.*<version>//" | sed "s/<.*//")
echo "POM_VERSION="$POM_VERSION
mvn package
cp checkstyle-sonar-plugin/target/checkstyle-sonar-plugin-$POM_VERSION.jar /opt/sonarqube/extensions/plugins/
cd /opt/sonarqube/
rm logs/*.*
./bin/run.sh &
echo "sleeping 30 to let sonar start up"
sleep 30
cd -
mvn sonar:sonar
grep "ERROR" /opt/sonarqube/logs/* | cat
# Cleanup
- script:
name: Cleanup maven local repo
code: |-
find ${WERCKER_CACHE_DIR} -type d -name "*SNAPSHOT" -ls -exec rm -rf {} +
echo "------"
du -hs ${WERCKER_CACHE_DIR}
echo "------"
du -hs ${WERCKER_CACHE_DIR}/* | sort -h
echo "------"
du -hs * | sort -h