File tree
Expand file treeCollapse file tree3 files changed
+62
-35
lines changed Expand file treeCollapse file tree3 files changed
+62
-35
lines changed Original file line number | Diff line number | Diff line change |
---|
|
| 1 | +version: 2.1 |
| 2 | + |
| 3 | +jobs: |
| 4 | +build: |
| 5 | +machine: |
| 6 | +docker_layer_caching: true |
| 7 | +working_directory: ~/codeclimate/codeclimate-csslint |
| 8 | +steps: |
| 9 | +- checkout |
| 10 | +- run: |
| 11 | +name: Build |
| 12 | +command: make image |
| 13 | +- run: |
| 14 | +name: Test |
| 15 | +command: make test |
| 16 | + |
| 17 | +release_images: |
| 18 | +machine: |
| 19 | +docker_layer_caching: true |
| 20 | +working_directory: ~/codeclimate/codeclimate-csslint |
| 21 | +steps: |
| 22 | +- checkout |
| 23 | +- run: |
| 24 | +name: Validate owner |
| 25 | +command: | |
| 26 | +if [ "$CIRCLE_PROJECT_USERNAME" -ne "codeclimate" ] |
| 27 | +then |
| 28 | +echo "Skipping release for non-codeclimate branches" |
| 29 | +circleci step halt |
| 30 | +fi |
| 31 | + - run: make image |
| 32 | +- run: echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin |
| 33 | +- run: |
| 34 | +name: Push image to Dockerhub |
| 35 | +command: | |
| 36 | +make release RELEASE_TAG="b$CIRCLE_BUILD_NUM" |
| 37 | +make release RELEASE_TAG="$(echo $CIRCLE_BRANCH | grep -oP 'channel/\K[\w\-]+')" |
| 38 | +workflows: |
| 39 | +version: 2 |
| 40 | +build_deploy: |
| 41 | +jobs: |
| 42 | +- build |
| 43 | +- release_images: |
| 44 | +context: Quality |
| 45 | +requires: |
| 46 | +- build |
| 47 | +filters: |
| 48 | +branches: |
| 49 | +only: /master|channel\/[\w-]+/ |
| 50 | + |
| 51 | +notify: |
| 52 | +webhooks: |
| 53 | +- url: https://cc-slack-proxy.herokuapp.com/circle |
Original file line number | Diff line number | Diff line change |
---|
|
1 |
| -.PHONY: test |
| 1 | +.PHONY: image test release |
| 2 | + |
| 3 | +IMAGE_NAME ?= codeclimate/codeclimate-csslint |
| 4 | +RELEASE_REGISTRY ?= codeclimate |
| 5 | +RELEASE_TAG ?= latest |
2 | 6 |
|
3 | 7 | image:
|
4 | 8 | docker build -t codeclimate/codeclimate-csslint .
|
5 | 9 |
|
6 | 10 | test: image
|
7 | 11 | docker run --rm codeclimate/codeclimate-csslint sh -c "cd /usr/src/app && npm run test"
|
| 12 | + |
| 13 | +release: |
| 14 | +docker tag $(IMAGE_NAME) $(RELEASE_REGISTRY)/codeclimate-csslint:$(RELEASE_TAG) |
| 15 | +docker push $(RELEASE_REGISTRY)/codeclimate-csslint:$(RELEASE_TAG) |
This file was deleted.
You can’t perform that action at this time.
0 commit comments