diff --git a/.circleci/config.yml b/.circleci/config.yml new file mode 100644 index 0000000..32bebfd --- /dev/null +++ b/.circleci/config.yml @@ -0,0 +1,50 @@ +version: 2.1 + +jobs: + build: + machine: + docker_layer_caching: true + working_directory: ~/codeclimate/codeclimate-phpcodesniffer + steps: + - checkout + - run: + name: Build + command: make image + + release_images: + machine: + docker_layer_caching: true + working_directory: ~/codeclimate/codeclimate-phpcodesniffer + 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-phpcodesniffer:b$CIRCLE_BUILD_NUM + docker push us.gcr.io/code-climate/codeclimate-phpcodesniffer: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/Dockerfile b/Dockerfile index e2af141..1e4024e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM alpine:edge +FROM alpine:3.15.0 RUN adduser -u 9000 -D app diff --git a/circle.yml b/circle.yml deleted file mode 100644 index cdde542..0000000 --- a/circle.yml +++ /dev/null @@ -1,35 +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: - - echo "true" - -deployment: - registry: - branch: master - 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
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: