From 08d3b319746c424b3325098b3b7058741c0cb629 Mon Sep 17 00:00:00 2001 From: Luke Robles Date: Tue, 8 Aug 2017 16:51:21 -0700 Subject: [PATCH] Making the dockerfile test the python code during the build --- Dockerfile | 2 ++ README.md | 7 ++++--- test_container.sh | 8 -------- 3 files changed, 6 insertions(+), 11 deletions(-) delete mode 100755 test_container.sh diff --git a/Dockerfile b/Dockerfile index 6625290c..a2aac5dd 100644 --- a/Dockerfile +++ b/Dockerfile @@ -5,4 +5,6 @@ RUN apt-get update && apt-get install curl -y &&\ RUN pip install requests discord.py docker pybooru termcolor ADD app /app +# Run this to test that the python compiles when we actually go live +RUN python /app/dragon-bot.py test CMD python app/dragon-bot.py \ No newline at end of file diff --git a/README.md b/README.md index f04d54ec..6c59fe46 100644 --- a/README.md +++ b/README.md @@ -9,12 +9,13 @@ A discord bot for the trifecta discord channel ### How do I get set up? ### * You'll need to install docker - * as root (`sudo -s`) + * as root (`sudo -s`) * `curl -Ls get.docker.com | bash` ### Testing your changes ### -* There is a bash file in the root of the repo, `test_container.sh` - * run this to validate your python syntax. On first run, it will take a while to build +* Test that you can actually build the container + * `docker build -t testing .` + * `docker run --rm testing` * pipeline [here](https://cloud.docker.com/app/ldooks/repository/docker/ldooks/dragon-bot/builds) ### Contribution guidelines ### diff --git a/test_container.sh b/test_container.sh deleted file mode 100755 index a70749d5..00000000 --- a/test_container.sh +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/bash -printf "\nStarting tests\n" - -printf "Building docker container\n" -docker build -t tests . - -printf "Running docker container to test your python code\n" -docker run --rm tests python /app/dragon-bot.py test \ No newline at end of file