Skip to content

Commit cd57e9c

Browse files
authored
QUA-958: Push images to Dockerhub instead of GCR (#59)
* Push images to Dockerhub instead of GCR * Change base image to alpine:3.15.0 * Fix makefile release step * Update Makefile * Force cc analysis
1 parent 6907f8f commit cd57e9c

File tree

3 files changed

+21
-9
lines changed

3 files changed

+21
-9
lines changed

.circleci/config.yml

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,12 @@ jobs:
2525
steps:
2626
- checkout
2727
- run: make image
28-
- run: echo "$GCR_JSON_KEY" | docker login -u _json_key --password-stdin us.gcr.io
28+
- run: echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin
2929
- run:
30-
name: Push image to GCR
30+
name: Push image to Dockerhub
3131
command: |
32-
docker tag $CIRCLE_PROJECT_USERNAME/$CIRCLE_PROJECT_REPONAME \
33-
us.gcr.io/code-climate/codeclimate-phpmd:b$CIRCLE_BUILD_NUM
34-
docker push us.gcr.io/code-climate/codeclimate-phpmd:b$CIRCLE_BUILD_NUM
32+
make release RELEASE_TAG="b$CIRCLE_BUILD_NUM"
33+
make release RELEASE_TAG="$(echo $CIRCLE_BRANCH | grep -oP 'channel/\K[\w\-]+')"
3534
3635
workflows:
3736
version: 2
@@ -42,8 +41,12 @@ workflows:
4241
requires:
4342
- build
4443
- release_images:
44+
context: Quality
4545
requires:
4646
- test
47+
filters:
48+
branches:
49+
only: /master|channel\/[\w-]+/
4750

4851

4952
notify:

Dockerfile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM alpine:edge
1+
FROM alpine:3.15.0
22
LABEL maintainer="Code Climate <hello@codeclimate.com>"
33

44
WORKDIR /usr/src/app
@@ -37,13 +37,13 @@ RUN composer install --no-dev && \
3737

3838
# Build Content
3939
COPY bin/build-content ./bin/build-content
40-
RUN apk add --no-cache ruby ruby-json ruby-bigdecimal ruby-dev build-base libxml2-dev libxslt-dev libffi-dev && \
40+
RUN apk add --no-cache ruby ruby-json ruby-bigdecimal ruby-dev build-base libxml2-dev libxslt-dev libffi-dev yaml-dev && \
4141
gem install rdoc nokogiri httparty --no-document && \
4242
./bin/build-content && \
4343
chown -R app:app content && \
4444
gem uninstall --all rdoc httparty nokogiri && \
4545
rm -rf $( gem environment gemdir ) && \
46-
apk del --purge ruby ruby-json ruby-bigdecimal ruby-dev build-base libxml2-dev libxslt-dev libffi-dev && \
46+
apk del --purge ruby ruby-json ruby-bigdecimal ruby-dev build-base libxml2-dev libxslt-dev libffi-dev yaml-dev && \
4747
rm -rf /var/cache/* ~/.gem
4848

4949
COPY . ./

Makefile

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
1-
.PHONY: image composer-update test
1+
.PHONY: image composer-update test release
22

33
IMAGE_NAME ?= codeclimate/codeclimate-phpmd
4+
RELEASE_REGISTRY ?= codeclimate
5+
6+
ifndef RELEASE_TAG
7+
override RELEASE_TAG = latest
8+
endif
49

510
image:
611
docker build --tag $(IMAGE_NAME) .
@@ -26,3 +31,7 @@ test:
2631
--volume $(PWD)/tests:/usr/src/app/tests \
2732
$(IMAGE_NAME)-test \
2833
sh -c "vendor/bin/phpunit --bootstrap engine.php ./tests"
34+
35+
release:
36+
docker tag $(IMAGE_NAME) $(RELEASE_REGISTRY)/codeclimate-phpmd:$(RELEASE_TAG)
37+
docker push $(RELEASE_REGISTRY)/codeclimate-phpmd:$(RELEASE_TAG)

0 commit comments

Comments
 (0)
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