Modifying the docker file to install docker on a separate step so we can cache that bit to speed up testing. also adding a script that will run some quick tests
This commit is contained in:
parent
8afdad88b4
commit
cbf3f58102
@ -1,7 +1,8 @@
|
|||||||
FROM python:3.6.2-slim
|
FROM python:3.6.2-slim
|
||||||
RUN apt-get update && apt-get install -y curl &&\
|
RUN apt-get update && apt-get install curl -y &&\
|
||||||
pip3 install requests discord.py docker pybooru && \
|
|
||||||
curl -Lks get.docker.com | bash
|
curl -Lks get.docker.com | bash
|
||||||
|
|
||||||
|
RUN pip install requests discord.py docker pybooru termcolor
|
||||||
|
|
||||||
ADD app /app
|
ADD app /app
|
||||||
CMD python app/dragon-bot.py
|
CMD python app/dragon-bot.py
|
@ -6,6 +6,7 @@ import help_methods
|
|||||||
import discord
|
import discord
|
||||||
import docker
|
import docker
|
||||||
from pybooru import Danbooru
|
from pybooru import Danbooru
|
||||||
|
from termcolor import colored
|
||||||
|
|
||||||
# Client object
|
# Client object
|
||||||
client = discord.Client()
|
client = discord.Client()
|
||||||
@ -260,7 +261,7 @@ async def on_message(message):
|
|||||||
|
|
||||||
# Check if there is a command line argument after script
|
# Check if there is a command line argument after script
|
||||||
if len(sys.argv) > 1:
|
if len(sys.argv) > 1:
|
||||||
print("If you're seeing this, the python compiled")
|
print(colored("If you're seeing this, the python compiled", 'green'))
|
||||||
sys.exit()
|
sys.exit()
|
||||||
|
|
||||||
token = "MzM5NDQ2NTgwMTU3MzQ5ODg4.DFkGYg.z-XD17nFP4rtBq-YsNbOJHuBWfQ" # get from the bot page. must be a bot, not a discord app
|
token = "MzM5NDQ2NTgwMTU3MzQ5ODg4.DFkGYg.z-XD17nFP4rtBq-YsNbOJHuBWfQ" # get from the bot page. must be a bot, not a discord app
|
||||||
|
8
test_container.sh
Executable file
8
test_container.sh
Executable file
@ -0,0 +1,8 @@
|
|||||||
|
#!/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
|
Loading…
x
Reference in New Issue
Block a user