diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 00000000..89660678 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,2 @@ +.bundle +.git diff --git a/Dockerfile b/Dockerfile index 8e2ee969..c86ebefa 100644 --- a/Dockerfile +++ b/Dockerfile @@ -17,4 +17,7 @@ USER app RUN cd /usr/src/app && \ rake docs:scrape +VOLUME /code +WORKDIR /code + CMD ["/usr/src/app/bin/codeclimate-rubocop"] diff --git a/Makefile b/Makefile new file mode 100644 index 00000000..56c3da0b --- /dev/null +++ b/Makefile @@ -0,0 +1,9 @@ +.PHONY: image test + +IMAGE_NAME ?= codeclimate/codeclimate-rubocop + +image: + docker build --rm -t $(IMAGE_NAME) . + +test: image + docker run --rm $(IMAGE_NAME) sh -c "cd /usr/src/app && bundle exec rake" diff --git a/bin/codeclimate-rubocop b/bin/codeclimate-rubocop index 62d6b97f..7dc9723f 100755 --- a/bin/codeclimate-rubocop +++ b/bin/codeclimate-rubocop @@ -11,4 +11,4 @@ else engine_config = {} end -CC::Engine::Rubocop.new("/code", engine_config, STDOUT).run +CC::Engine::Rubocop.new(Dir.pwd, engine_config, STDOUT).run diff --git a/circle.yml b/circle.yml index dbaf35a3..d7d59697 100644 --- a/circle.yml +++ b/circle.yml @@ -10,11 +10,11 @@ machine: dependencies: override: - - docker build -t=$PRIVATE_REGISTRY/$CIRCLE_PROJECT_REPONAME:b$CIRCLE_BUILD_NUM . + - echo "no-op" test: override: - - docker run $PRIVATE_REGISTRY/$CIRCLE_PROJECT_REPONAME:b$CIRCLE_BUILD_NUM bundle exec rake + - IMAGE_NAME="$PRIVATE_REGISTRY/$CIRCLE_PROJECT_REPONAME:b$CIRCLE_BUILD_NUM" make test deployment: registry: