This avoids building the docker images for each Python version test. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
43 lines
1.1 KiB
YAML
43 lines
1.1 KiB
YAML
language: python
|
|
|
|
python:
|
|
- "3.4"
|
|
- "3.5"
|
|
- "3.6"
|
|
|
|
sudo: required
|
|
|
|
services:
|
|
- docker
|
|
|
|
install:
|
|
# install kas to have all kas dependencies:
|
|
- pip install .
|
|
# checkcode dependencies:
|
|
- pip install pylint pep8 doc8 Pygments
|
|
# test dependencies:
|
|
- pip install pytest
|
|
|
|
script:
|
|
- scripts/checkcode.sh .
|
|
- pytest
|
|
|
|
jobs:
|
|
include:
|
|
- stage: docker
|
|
python: "3.6"
|
|
script:
|
|
- docker build -t kasproject/kas .
|
|
- docker build -t kasproject/kas-isar -f Dockerfile.isar .
|
|
- if [ "$TRAVIS_BRANCH" == "master" ] || [ "$TRAVIS_BRANCH" == "next" ]; then
|
|
docker login -u="$DOCKER_USERNAME" -p="$DOCKER_PASSWORD";
|
|
for IMAGE in kasproject/kas kasproject/kas-isar; do
|
|
docker push $IMAGE;
|
|
if [ "$TRAVIS_BRANCH" == "master" ] && git describe --exact-match 2>/dev/null >/dev/null; then
|
|
VERSION="$(/usr/bin/python3 -c 'from kas import __version__; print(__version__)')";
|
|
docker tag $IMAGE $IMAGE:$VERSION;
|
|
docker push $IMAGE:$VERSION;
|
|
fi
|
|
done
|
|
fi
|