diff --git a/.circleci/config.yml b/.circleci/config.yml new file mode 100644 index 0000000..0c3e407 --- /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 "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin + - run: + name: Push image to Dockerhub + command: | + make release RELEASE_TAG="b$CIRCLE_BUILD_NUM" + make release RELEASE_TAG="$(echo $CIRCLE_BRANCH | grep -oP 'channel/\K[\w\-]+')" + +workflows: + version: 2 + build_deploy: + jobs: + - test + - release_images: + context: Quality + requires: + - test + filters: + branches: + only: /master|channel\/[\w-]+/ +notify: + webhooks: + - url: https://cc-slack-proxy.herokuapp.com/circle diff --git a/Makefile b/Makefile index 109c208..5930d18 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-pmd:$(RELEASE_TAG) + docker push $(RELEASE_REGISTRY)/codeclimate-pmd:$(RELEASE_TAG) diff --git a/bin/install-pmd.sh b/bin/install-pmd.sh index e0d6e60..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.7.0/pmd-bin-6.7.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 } 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 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. pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy