File tree Expand file tree Collapse file tree 4 files changed +26
-5
lines changed Expand file tree Collapse file tree 4 files changed +26
-5
lines changed Original file line number Diff line number Diff line change
1
+ # Contributing
2
+
3
+ ## Testing
4
+ ` make test ` will build the docker image and run the tests
5
+
6
+ ## Upgrading PMD Version
7
+ 1 . ` make upgrade ` => will adjust ` bin/install-pmd.sh ` with the URL to the latest version
8
+ 1 . ` make test `
9
+ 1 . If all looks good, commit the change and open a PR :)
Original file line number Diff line number Diff line change 7
7
8
8
test : image
9
9
docker run --rm -v $(PWD ) :/code $(IMAGE_NAME ) /code/test.groovy
10
+
11
+ upgrade :
12
+ docker run --rm \
13
+ --workdir /usr/src/app \
14
+ --volume $(PWD ) :/usr/src/app \
15
+ $(IMAGE_NAME ) ./bin/upgrade.sh
Original file line number Diff line number Diff line change @@ -3,14 +3,12 @@ set -euo pipefail
3
3
4
4
LIB_DIR=/usr/src/app/lib
5
5
6
- download_latest_pmd () {
7
- curl -s https://api.github.com/repos/pmd/pmd/releases/latest | \
8
- jq -c ' .assets[] | select(.name | contains("bin")) | .browser_download_url' | \
9
- xargs wget -O pmd.zip
6
+ download_pmd () {
7
+ URL=" https://github.com/pmd/pmd/releases/download/pmd_releases/5.8.1/pmd-bin-5.8.1.zip"
8
+ wget -O pmd.zip $URL
10
9
}
11
10
12
11
install_pmd () {
13
- download_latest_pmd
14
12
unzip pmd.zip
15
13
mv ${LIB_DIR} /pmd-bin* /* ${LIB_DIR} /pmd
16
14
}
@@ -23,5 +21,6 @@ cleanup() {
23
21
mkdir -p ${LIB_DIR} /pmd
24
22
cd ${LIB_DIR}
25
23
24
+ download_pmd
26
25
install_pmd
27
26
cleanup
Original file line number Diff line number Diff line change
1
+ #! /bin/sh
2
+
3
+ URL=$( curl -s https://api.github.com/repos/pmd/pmd/releases/latest | jq -c ' .assets[] | select(.name | contains("bin")) | .browser_download_url' )
4
+ ESCAPED_URL=$( echo $URL | sed ' s/\&/\\&/g' )
5
+ sed -i -E " s#URL=.*#URL=${ESCAPED_URL} #" bin/install-pmd.sh
6
+
7
+ echo $ESCAPED_URL
You can’t perform that action at this time.
0 commit comments