From ef250398a1605c49e7824113b74b0ce9bc198734 Mon Sep 17 00:00:00 2001 From: Luciano Ruiz Morales Date: Mon, 17 Jan 2022 15:04:45 -0300 Subject: [PATCH 1/2] QUA-463: Updated base Docker image. Updated build.gradle file to use 'Maven Central' instead of JCenter --- Dockerfile | 2 +- build.gradle | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 77b95e0..5893fc5 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM java:8-jdk-alpine +FROM amazoncorretto:8-alpine3.14-jdk MAINTAINER Code Climate diff --git a/build.gradle b/build.gradle index 55a9bb3..b7358e1 100644 --- a/build.gradle +++ b/build.gradle @@ -1,7 +1,7 @@ apply plugin: "java" repositories { - jcenter() + mavenCentral() maven { url 'https://jitpack.io' } } From 3462d60bab86cf4d6f953a7e9e8a4aa2aed0524c Mon Sep 17 00:00:00 2001 From: Luciano Ruiz Morales Date: Tue, 25 Jan 2022 16:54:09 -0300 Subject: [PATCH 2/2] QUA-463: Create new config file for CircleCI 2.1 --- .circleci/config.yml | 55 ++++++++++++++++++++++++++++++++++++++++++++ circle.yml | 36 ----------------------------- 2 files changed, 55 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..7182133 --- /dev/null +++ b/.circleci/config.yml @@ -0,0 +1,55 @@ +version: 2.1 + +jobs: + build: + machine: + docker_layer_caching: true + working_directory: ~/codeclimate/codeclimate-sonar-php + steps: + - checkout + - run: + name: Build + command: make image + - run: + name: Test + command: make test + + release_images: + machine: + docker_layer_caching: true + working_directory: ~/codeclimate/codeclimate-sonar-php + 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: + name: Build + command: 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 codeclimate/codeclimate-sonar-php \ + us.gcr.io/code-climate/codeclimate-sonar-php:b$CIRCLE_BUILD_NUM + docker push us.gcr.io/code-climate/codeclimate-sonar-php:b$CIRCLE_BUILD_NUM +workflows: + version: 2 + build_deploy: + jobs: + - build + - release_images: + requires: + - build + 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