1
0
mirror of https://github.com/pypiserver/pypiserver synced 2025-02-16 23:09:34 +01:00

Add simple functional tests for docker

This commit is contained in:
Matthew Planchard 2018-06-26 21:19:03 -05:00
parent 47231ea5fb
commit 3e1a399fe3
2 changed files with 47 additions and 18 deletions

@ -1,3 +1,6 @@
jobs:
include:
- stage: test supported Python versions
sudo: false
language: python
python:
@ -19,3 +22,10 @@ script:
branches:
except:
- standalone
- stage: test Docker image
sudo: required
services:
- docker
scirpt:
- bin/test-docker.sh

19
bin/test-docker.sh Executable file

@ -0,0 +1,19 @@
#!/usr/bin/env sh
# Perform some simple validation to make sure the Docker image works
# Should be run from the repo root.
set -xe # exit on any error, show debug output
docker build . -t pypiserver:test
docker run pypiserver:test --help
CONTAINER_ID=$(docker run -d -p 8080:8080 pypiserver:test)
sleep 5 # give the contaienr some time to get going
# Ensure our home page is returning something
curl localhost:8080 | grep -q "pypiserver"
docker container stop "$CONTAINER_ID"