travis: Model via stages
This avoids building the docker images for each Python version test. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
This commit is contained in:
parent
49cb9b7a7b
commit
c329e850d4
32
.travis.yml
32
.travis.yml
@ -21,18 +21,22 @@ install:
|
|||||||
script:
|
script:
|
||||||
- scripts/checkcode.sh .
|
- scripts/checkcode.sh .
|
||||||
- pytest
|
- pytest
|
||||||
- docker build -t kasproject/kas .
|
|
||||||
- docker build -t kasproject/kas-isar -f Dockerfile.isar .
|
|
||||||
|
|
||||||
after_success:
|
jobs:
|
||||||
- if [ "$TRAVIS_BRANCH" == "master" ] || [ "$TRAVIS_BRANCH" == "next" ]; then
|
include:
|
||||||
docker login -u="$DOCKER_USERNAME" -p="$DOCKER_PASSWORD";
|
- stage: docker
|
||||||
for IMAGE in kasproject/kas kasproject/kas-isar; do
|
python: "3.6"
|
||||||
docker push $IMAGE;
|
script:
|
||||||
if [ "$TRAVIS_BRANCH" == "master" ] && git describe --exact-match 2>/dev/null >/dev/null; then
|
- docker build -t kasproject/kas .
|
||||||
VERSION="$(/usr/bin/python3 -c 'from kas import __version__; print(__version__)')";
|
- docker build -t kasproject/kas-isar -f Dockerfile.isar .
|
||||||
docker tag $IMAGE $IMAGE:$VERSION;
|
- if [ "$TRAVIS_BRANCH" == "master" ] || [ "$TRAVIS_BRANCH" == "next" ]; then
|
||||||
docker push $IMAGE:$VERSION;
|
docker login -u="$DOCKER_USERNAME" -p="$DOCKER_PASSWORD";
|
||||||
fi
|
for IMAGE in kasproject/kas kasproject/kas-isar; do
|
||||||
done
|
docker push $IMAGE;
|
||||||
fi
|
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
|
||||||
|
Loading…
Reference in New Issue
Block a user