File tree 5 files changed +50
-15
lines changed
lib/cc/engine/bundler_audit
5 files changed +50
-15
lines changed Original file line number Diff line number Diff line change 1
- FROM codeclimate/alpine-ruby:b38
1
+ FROM alpine:3.6
2
+
3
+ RUN adduser -u 9000 -D app
2
4
3
5
WORKDIR /usr/src/app
4
- RUN apk --update add ruby ruby-bundler git
5
6
6
- COPY Gemfile* /usr/src/app/
7
- RUN bundle install --jobs 4 && \
8
- rm -rf /usr/share/ri
7
+ RUN apk add --no-cache ruby ruby-json git && \
8
+ gem install --no-ri --no-rdoc bundler && \
9
+ rm -r ~/.gem
9
10
10
- RUN adduser -u 9000 -D app
11
- USER app
11
+ COPY Gemfile* /usr/src/app/
12
+ RUN bundle install --without=test --no-cache && \
13
+ rm -rf ~/.bundle /usr/lib/ruby/gems/2.4.0/cache/* /usr/share/ri
12
14
13
15
COPY DATABASE_VERSION /usr/src/app/DATABASE_VERSION
14
16
15
- RUN bundle-audit update
17
+ COPY bin bin/
18
+ COPY lib lib/
19
+ RUN chown -R app:app .
20
+
21
+ USER app
16
22
17
- COPY . /usr/src/app
23
+ # The following step has to be ran by app user aas it depends on $HOME
24
+ RUN bundle-audit update && \
25
+ for f in ~/.local/share/ruby-advisory-db/* ~/.local/share/ruby-advisory-db/.*; do \
26
+ name="$(basename " $f")" ; \
27
+ test "$name" = "gems" || \
28
+ test "$name" = "." || \
29
+ test "$name" = ".." || \
30
+ test "$name" = ".git" || \
31
+ rm -r "$f" ; \
32
+ done
18
33
19
34
CMD ["/usr/src/app/bin/bundler-audit" ]
Original file line number Diff line number Diff line change
1
+ FROM codeclimate/codeclimate-bundler-audit
2
+
3
+ USER root
4
+
5
+ RUN bundler install --no-cache --with="development test"
6
+
7
+ COPY Rakefile ./
8
+ COPY spec spec/
9
+ RUN chown -R app:app Rakefile spec
10
+
11
+ user app
12
+
13
+ CMD ["bundle", "exec", "rake"]
Original file line number Diff line number Diff line change 1
1
.PHONY : image test citest update_version
2
2
3
3
IMAGE_NAME ?= codeclimate/codeclimate-bundler-audit
4
+ TEST_IMAGE_NAME ?= $(IMAGE_NAME ) -test
4
5
5
6
image :
6
7
docker build --rm -t $(IMAGE_NAME ) .
7
8
8
- test : image
9
- docker run -e PAGER=more --tty --interactive --rm $( IMAGE_NAME ) bundle exec rake
9
+ test-image : image
10
+ docker build --rm -t $( TEST_IMAGE_NAME ) -f Dockerfile.test .
10
11
11
- citest :
12
- docker run --rm $(IMAGE_NAME ) bundle exec rake
12
+ test :
13
+ @$(MAKE ) test-image > /dev/null
14
+ docker run \
15
+ -e PAGER=more \
16
+ --tty --interactive --rm \
17
+ $(TEST_IMAGE_NAME)
13
18
14
19
update_database :
15
20
date > DATABASE_VERSION
Original file line number Diff line number Diff line change @@ -12,11 +12,11 @@ dependencies:
12
12
--env GCR_JSON_KEY
13
13
--volume /var/run/docker.sock:/var/run/docker.sock
14
14
codeclimate/patrick pull || true
15
- - make image
15
+ - make test- image
16
16
17
17
test :
18
18
override :
19
- - make citest
19
+ - make test
20
20
21
21
deployment :
22
22
registry :
Original file line number Diff line number Diff line change
1
+ require "tmpdir"
2
+
1
3
module CC
2
4
module Engine
3
5
module BundlerAudit
You can’t perform that action at this time.
0 commit comments