From f6e8ddfa7e2386a0e030d8a8534ba4e0cb40aa94 Mon Sep 17 00:00:00 2001 From: Filipe Esperandio Date: Fri, 12 May 2017 15:11:27 -0300 Subject: [PATCH 1/3] Expose docs generation through make --- Dockerfile | 2 ++ Makefile | 6 ++++++ 2 files changed, 8 insertions(+) diff --git a/Dockerfile b/Dockerfile index d97544c8..24ab906e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -8,6 +8,8 @@ RUN gem install bundler && \ bundle install -j 4 && \ rm -fr /usr/share/ri +RUN apk --update add git + RUN adduser -u 9000 -D app COPY . /usr/src/app RUN chown -R app:app /usr/src/app diff --git a/Makefile b/Makefile index 56c3da0b..13ef82e1 100644 --- a/Makefile +++ b/Makefile @@ -2,6 +2,12 @@ IMAGE_NAME ?= codeclimate/codeclimate-rubocop +docs: + docker run --rm \ + --workdir /usr/src/app \ + --volume $(PWD):/usr/src/app \ + $(IMAGE_NAME) sh -c "bundle exec rake docs:scrape" + image: docker build --rm -t $(IMAGE_NAME) . From c3443c5e469895aa5aa5a61bb96c155f44291e8a Mon Sep 17 00:00:00 2001 From: Filipe Esperandio Date: Fri, 12 May 2017 15:52:42 -0300 Subject: [PATCH 2/3] Move task to the bottom --- Makefile | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/Makefile b/Makefile index 13ef82e1..26d1f068 100644 --- a/Makefile +++ b/Makefile @@ -1,15 +1,15 @@ -.PHONY: image test +.PHONY: image test docs IMAGE_NAME ?= codeclimate/codeclimate-rubocop -docs: - docker run --rm \ - --workdir /usr/src/app \ - --volume $(PWD):/usr/src/app \ - $(IMAGE_NAME) sh -c "bundle exec rake docs:scrape" - image: docker build --rm -t $(IMAGE_NAME) . test: image docker run --rm $(IMAGE_NAME) sh -c "cd /usr/src/app && bundle exec rake" + +docs: image + docker run --rm \ + --workdir /usr/src/app \ + --volume $(PWD):/usr/src/app \ + $(IMAGE_NAME) sh -c "bundle exec rake docs:scrape" From f798c61f089bb6eff89589626e34fc27e2baca85 Mon Sep 17 00:00:00 2001 From: Filipe Esperandio Date: Tue, 16 May 2017 14:32:44 -0300 Subject: [PATCH 3/3] Fix permission problem running on linux --- Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/Makefile b/Makefile index 26d1f068..3071b349 100644 --- a/Makefile +++ b/Makefile @@ -10,6 +10,7 @@ test: image docs: image docker run --rm \ + --user root \ --workdir /usr/src/app \ --volume $(PWD):/usr/src/app \ $(IMAGE_NAME) sh -c "bundle exec rake docs:scrape"