forked from linode/linode-cli
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile-bats
32 lines (25 loc) · 992 Bytes
/
Dockerfile-bats
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
FROM python:2
ARG SPEC=https://developers.linode.com/openapi.yaml
ARG TOKEN
RUN apt-get update && apt-get install -y python3 python3-pip bats
RUN pip install requests terminaltables colorclass PyYAML enum34
RUN pip3 install requests terminaltables colorclass PyYAML enum34
ENV PYTHONPATH=.
ENV PATH="/usr/local/bin:/usr/local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/root/.local/bin"
WORKDIR /src
# Build and Install Linode CLI
RUN git clone https://github.com/linode/linode-cli.git \
&& cd linode-cli \
&& git submodule init \
&& git submodule update \
&& make requirements \
&& make build SPEC=${SPEC} \
&& make install SPEC=${SPEC} \
&& cd dist \
&& pip install --user $(ls) \
&& echo -n "[DEFAULT]\ntoken = ${TOKEN}" > /root/.linode-cli
# Install BATS testing framework
RUN git clone https://github.com/bats-core/bats-core.git \
&& cd bats-core \
&& ./install.sh /usr/local
CMD bats /src/linode-cli/test/linodes