forked from github.com/pypiserver
Add simple functional tests for docker
This commit is contained in:
parent
47231ea5fb
commit
3e1a399fe3
46
.travis.yml
46
.travis.yml
@ -1,21 +1,31 @@
|
||||
sudo: false
|
||||
language: python
|
||||
python:
|
||||
- 2.7
|
||||
- 3.4
|
||||
- 3.5
|
||||
- 3.6
|
||||
- pypy
|
||||
- pypy3
|
||||
jobs:
|
||||
include:
|
||||
- stage: test supported Python versions
|
||||
sudo: false
|
||||
language: python
|
||||
python:
|
||||
- 2.7
|
||||
- 3.4
|
||||
- 3.5
|
||||
- 3.6
|
||||
- pypy
|
||||
- pypy3
|
||||
|
||||
install:
|
||||
- pip install -U setuptools pip sphinx tox tox-travis
|
||||
install:
|
||||
- pip install -U setuptools pip sphinx tox tox-travis
|
||||
|
||||
script:
|
||||
- ./bin/test_standalone.sh
|
||||
- tox
|
||||
- ./bin/check_readme.sh
|
||||
script:
|
||||
- ./bin/test_standalone.sh
|
||||
- tox
|
||||
- ./bin/check_readme.sh
|
||||
|
||||
branches:
|
||||
except:
|
||||
- standalone
|
||||
branches:
|
||||
except:
|
||||
- standalone
|
||||
|
||||
- stage: test Docker image
|
||||
sudo: required
|
||||
services:
|
||||
- docker
|
||||
scirpt:
|
||||
- bin/test-docker.sh
|
||||
|
19
bin/test-docker.sh
Executable file
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"
|
Loading…
Reference in New Issue
Block a user