Skip to content
Permalink
Browse files

Copy files, update docker run instructions

  • Loading branch information...
patthiel committed Aug 13, 2018
1 parent 00ed510 commit 3b301d8ab77b81e95fe3c8ddf5cddcfb443be818
Showing with 18 additions and 6 deletions.
  1. +2 −0 .dockerignore
  2. +7 −6 Dockerfile-bats
  3. +9 −0 README.rst
@@ -0,0 +1,2 @@
build
dist
@@ -10,23 +10,24 @@ 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
WORKDIR /src/linode-cli

COPY . .

# Build and Install Linode CLI
RUN git clone https://github.com/linode/linode-cli.git \
&& cd linode-cli \
&& git submodule init \
RUN 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

WORKDIR /src

# 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
CMD bats /src/linode-cli/test/linodes /src/linode-cli/test/domains
@@ -233,6 +233,15 @@ Running the tests is simple. The only requirement is that you have a .linode-cli

./test/test-runner.sh

**Running Tests via Docker**

Run the following command to build the tests container:

docker build -f Dockerfile-bats -t linode-cli-tests --build-arg TOKEN=$INSERT_YOUR_TOKEN_HERE .

Run the following command to run the test

docker run --rm linode-cli-tests

Contributing
------------

0 comments on commit 3b301d8

Please sign in to comment.
You can’t perform that action at this time.