-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile.test
42 lines (37 loc) · 1.23 KB
/
Dockerfile.test
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
# ------------------------------------------------------------------------------
# COVERAGE STAGE
# ------------------------------------------------------------------------------
FROM ragnaroek/kcov:v33
RUN apt-get update \
&& apt-get install --no-install-recommends --no-install-suggests -yq \
bc \
curl \
dnsutils \
git \
shellcheck \
sudo \
tree \
&& curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash - \
&& sudo apt-get install --no-install-recommends --no-install-suggests -yq \
nodejs \
build-essential \
&& rm -rf /var/lib/apt/lists/* \
&& npm i -g --unsafe \
semver \
&& npm cache clean -g -f \
&& cd /usr/src \
&& git clone https://github.com/bats-core/bats-core.git \
&& cd bats-core \
&& ./install.sh /usr/local \
&& mkdir -p /usr/src/app \
&& mkdir -p /usr/src/app/coverage \
&& ls -al /usr/src/app
WORKDIR /usr/src/app
COPY . /usr/src/app/
RUN ls -al \
&& kcov --include-path=/usr/src/app/scripts,/usr/src/app/tests /usr/src/app/coverage bats -r /usr/src/app/tests \
# && tar -czvf coverage.$(date +%Y%m%d-%H%M%S).tgz coverage \
&& tar -czvf coverage.tgz coverage \
&& ls -al \
&& echo "KCOV complete."
# CMD "bash <(curl -s https://codecov.io/bash)"