forked from Synss/python-mbedtls
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
87 lines (80 loc) · 1.89 KB
/
.travis.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
# vim: et:ts=2:sw=2
language: python
python: "3.8"
matrix:
include:
- sudo: required
services:
- docker
env:
- ARCH=x86_64
- MBEDTLS="2.16.9"
- TAGS="cp36-cp36m cp37-cp37m cp38-cp38 cp39-cp39"
before_install:
- |
IMAGE="synss/python-mbedtls_$ARCH"
- docker pull $IMAGE:builder
- >
docker build
--target builder
--cache-from $IMAGE:builder
--tag $IMAGE:builder
--build-arg ARCH=$ARCH
--build-arg MBEDTLS=$MBEDTLS
--build-arg TAGS="$TAGS"
.
- >
docker build
--cache-from $IMAGE:builder
--cache-from $IMAGE:latest
--tag $IMAGE:latest
--build-arg ARCH=$ARCH
--build-arg MBEDTLS=$MBEDTLS
--build-arg TAGS="$TAGS"
.
install:
- pip install -r requirements/travis.txt
- scripts/start-devpi.sh -u user -x dev http://localhost:3141
- export PIP_INDEX_URL=http://localhost:3141/user/dev/+simple/
script:
- CONTAINER=test
- >
docker run
--rm
--interactive
--tty
--detach
--name $CONTAINER
--network=host
--env PIP_INDEX_URL
$IMAGE:latest
/bin/sh
- docker cp $CONTAINER:/root/wheelhouse/ .
- ls -A wheelhouse | grep -q . && ls -A wheelhouse
- twine check wheelhouse/*
- python setup.py sdist -d sdist
- tar tf sdist/*
- devpi upload wheelhouse/* sdist/*
- devpi list python-mbedtls
- |
for PYTHON in `echo ${TAGS:?}`; do
docker exec $CONTAINER /bin/sh -c "./scripts/run-tests.sh /opt/python/$PYTHON/bin/python";
done
- docker rm --force --volumes $CONTAINER
after_script:
- scripts/stop-devpi.sh
after_success:
- |
if [ "$TRAVIS_PULL_REQUEST" == "false" ]; then
echo "$DOCKER_PASSWORD" \
| docker login -u "$DOCKER_USERNAME" --password-stdin
docker push $IMAGE:builder
docker push $IMAGE:latest
fi
deploy:
provider: script
skip_cleanup: true
script:
- scripts/deploy.sh
on:
tags: true