From 9c6f77d8e2507db29ab8ad9c222c9b066d4ca5b8 Mon Sep 17 00:00:00 2001 From: Artem Date: Thu, 14 Jan 2021 17:29:07 +0300 Subject: [PATCH 1/6] Update reference to xsd as it is stated in https://pmd.github.io/latest/pmd_userdocs_making_rulesets.html (#33) --- fixtures/ruleset_default_file/ruleset.xml | 2 +- fixtures/specified_file/rules.xml | 2 +- java-basic-default-ruleset.xml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/fixtures/ruleset_default_file/ruleset.xml b/fixtures/ruleset_default_file/ruleset.xml index 2d8b0a1..e953fbf 100644 --- a/fixtures/ruleset_default_file/ruleset.xml +++ b/fixtures/ruleset_default_file/ruleset.xml @@ -3,7 +3,7 @@ + xsi:schemaLocation="http://pmd.sourceforge.net/ruleset/2.0.0 https://pmd.sourceforge.io/ruleset_2_0_0.xsd"> The Basic ruleset contains a collection of good practices which should be followed. diff --git a/fixtures/specified_file/rules.xml b/fixtures/specified_file/rules.xml index 006ec43..f7a216f 100644 --- a/fixtures/specified_file/rules.xml +++ b/fixtures/specified_file/rules.xml @@ -3,7 +3,7 @@ + xsi:schemaLocation="http://pmd.sourceforge.net/ruleset/2.0.0 https://pmd.sourceforge.io/ruleset_2_0_0.xsd"> The Basic ruleset contains a collection of good practices which should be followed. diff --git a/java-basic-default-ruleset.xml b/java-basic-default-ruleset.xml index 006ec43..f7a216f 100644 --- a/java-basic-default-ruleset.xml +++ b/java-basic-default-ruleset.xml @@ -3,7 +3,7 @@ + xsi:schemaLocation="http://pmd.sourceforge.net/ruleset/2.0.0 https://pmd.sourceforge.io/ruleset_2_0_0.xsd"> The Basic ruleset contains a collection of good practices which should be followed. From 0b24b87e160d37f68bc3e0f377a4a82002c4cd70 Mon Sep 17 00:00:00 2001 From: Artem Date: Thu, 14 Jan 2021 17:30:51 +0300 Subject: [PATCH 2/6] Update PMD version to 6.30 (#34) --- bin/install-pmd.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/install-pmd.sh b/bin/install-pmd.sh index e0d6e60..ca4b7b4 100755 --- a/bin/install-pmd.sh +++ b/bin/install-pmd.sh @@ -4,7 +4,7 @@ set -euo pipefail LIB_DIR=/usr/src/app/lib download_pmd() { - URL="https://github.com/pmd/pmd/releases/download/pmd_releases/6.7.0/pmd-bin-6.7.0.zip" + URL="https://github.com/pmd/pmd/releases/download/pmd_releases/6.30.0/pmd-bin-6.30.0.zip" wget -O pmd.zip $URL } From febf27387c542494763951cf87c5a1cff4cbc070 Mon Sep 17 00:00:00 2001 From: Filipe Esperandio Date: Fri, 15 Jan 2021 10:14:08 -0300 Subject: [PATCH 3/6] Move to circle 2.0 --- .circleci/config.yml | 49 ++++++++++++++++++++++++++++++++++++++++++++ circle.yml | 36 -------------------------------- 2 files changed, 49 insertions(+), 36 deletions(-) create mode 100644 .circleci/config.yml delete mode 100644 circle.yml diff --git a/.circleci/config.yml b/.circleci/config.yml new file mode 100644 index 0000000..c681f81 --- /dev/null +++ b/.circleci/config.yml @@ -0,0 +1,49 @@ +version: 2 + +jobs: + test: + machine: + docker_layer_caching: true + working_directory: ~/codeclimate/codeclimate-pmd + steps: + - checkout + - run: make image + - run: make test + + release_images: + machine: + docker_layer_caching: true + working_directory: ~/codeclimate/codeclimate-pmd + steps: + - checkout + - run: + name: Validate owner + command: | + if [ "$CIRCLE_PROJECT_USERNAME" -ne "codeclimate" ] + then + echo "Skipping release for non-codeclimate branches" + circleci step halt + fi + - run: make image + - run: echo "$GCR_JSON_KEY" | docker login -u _json_key --password-stdin us.gcr.io + - run: + name: Push image to GCR + command: | + docker tag $CIRCLE_PROJECT_USERNAME/$CIRCLE_PROJECT_REPONAME \ + us.gcr.io/code-climate/codeclimate-pmd:b$CIRCLE_BUILD_NUM + docker push us.gcr.io/code-climate/codeclimate-pmd:b$CIRCLE_BUILD_NUM + +workflows: + version: 2 + build_deploy: + jobs: + - test + - release_images: + requires: + - test + filters: + branches: + only: /master|channel\/[\w-]+/ +notify: + webhooks: + - url: https://cc-slack-proxy.herokuapp.com/circle diff --git a/circle.yml b/circle.yml deleted file mode 100644 index c7dd860..0000000 --- a/circle.yml +++ /dev/null @@ -1,36 +0,0 @@ -machine: - services: - - docker - -dependencies: - override: - - > - docker run - --env CIRCLE_BRANCH - --env CIRCLE_PROJECT_REPONAME - --env CIRCLE_TOKEN - --env GCR_JSON_KEY - --volume /var/run/docker.sock:/var/run/docker.sock - codeclimate/patrick pull || true - - make image - -test: - override: - - make test - -deployment: - registry: - branch: /master|channel\/[\w-]+/ - owner: codeclimate - commands: - - > - docker run - --env CIRCLE_BUILD_NUM - --env CIRCLE_PROJECT_REPONAME - --env GCR_JSON_KEY - --volume /var/run/docker.sock:/var/run/docker.sock - codeclimate/patrick push gcr - -notify: - webhooks: - - url: https://cc-slack-proxy.herokuapp.com/circle From 991645c69fd447532fc01d1df2fcb54ba26e862c Mon Sep 17 00:00:00 2001 From: dantevvp Date: Mon, 22 Nov 2021 13:07:45 -0300 Subject: [PATCH 4/6] QUA-401: update PMD --- bin/install-pmd.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/install-pmd.sh b/bin/install-pmd.sh index ca4b7b4..a01807c 100755 --- a/bin/install-pmd.sh +++ b/bin/install-pmd.sh @@ -4,7 +4,7 @@ set -euo pipefail LIB_DIR=/usr/src/app/lib download_pmd() { - URL="https://github.com/pmd/pmd/releases/download/pmd_releases/6.30.0/pmd-bin-6.30.0.zip" + URL="https://github.com/pmd/pmd/releases/download/pmd_releases/6.40.0/pmd-bin-6.40.0.zip" wget -O pmd.zip $URL } From 7639b24c3b4138bfa5cb763f08bc0c9aaa282be8 Mon Sep 17 00:00:00 2001 From: Dante Ventieri Date: Mon, 13 Feb 2023 13:03:29 -0300 Subject: [PATCH 5/6] Push images to Dockerhub instead of GCR --- .circleci/config.yml | 10 +++++----- Makefile | 11 ++++++++++- 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index c681f81..0c3e407 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -25,13 +25,12 @@ jobs: circleci step halt fi - run: make image - - run: echo "$GCR_JSON_KEY" | docker login -u _json_key --password-stdin us.gcr.io + - run: echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin - run: - name: Push image to GCR + name: Push image to Dockerhub command: | - docker tag $CIRCLE_PROJECT_USERNAME/$CIRCLE_PROJECT_REPONAME \ - us.gcr.io/code-climate/codeclimate-pmd:b$CIRCLE_BUILD_NUM - docker push us.gcr.io/code-climate/codeclimate-pmd:b$CIRCLE_BUILD_NUM + make release RELEASE_TAG="b$CIRCLE_BUILD_NUM" + make release RELEASE_TAG="$(echo $CIRCLE_BRANCH | grep -oP 'channel/\K[\w\-]+')" workflows: version: 2 @@ -39,6 +38,7 @@ workflows: jobs: - test - release_images: + context: Quality requires: - test filters: diff --git a/Makefile b/Makefile index 109c208..ee3130c 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,11 @@ -.PHONY: image test +.PHONY: image test release IMAGE_NAME ?= codeclimate/codeclimate-pmd +RELEASE_REGISTRY ?= codeclimate + +ifndef RELEASE_TAG +override RELEASE_TAG = latest +endif image: docker build --rm -t $(IMAGE_NAME) . @@ -13,3 +18,7 @@ upgrade: --workdir /usr/src/app \ --volume $(PWD):/usr/src/app \ $(IMAGE_NAME) ./bin/upgrade.sh + +release: + docker tag $(IMAGE_NAME) $(RELEASE_REGISTRY)/codeclimate-phpmd:$(RELEASE_TAG) + docker push $(RELEASE_REGISTRY)/codeclimate-phpmd:$(RELEASE_TAG) From 0bc9ad6d2c49c3e3dbb443601e6993162a6a8c2e Mon Sep 17 00:00:00 2001 From: Dante Ventieri Date: Fri, 10 Mar 2023 15:18:33 -0300 Subject: [PATCH 6/6] fix repo name in Makefile --- Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index ee3130c..5930d18 100644 --- a/Makefile +++ b/Makefile @@ -20,5 +20,5 @@ upgrade: $(IMAGE_NAME) ./bin/upgrade.sh release: - docker tag $(IMAGE_NAME) $(RELEASE_REGISTRY)/codeclimate-phpmd:$(RELEASE_TAG) - docker push $(RELEASE_REGISTRY)/codeclimate-phpmd:$(RELEASE_TAG) + docker tag $(IMAGE_NAME) $(RELEASE_REGISTRY)/codeclimate-pmd:$(RELEASE_TAG) + docker push $(RELEASE_REGISTRY)/codeclimate-pmd:$(RELEASE_TAG)