forked from raveberry/raveberry
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
62 lines (58 loc) · 3.9 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
language: python
python: "3.7"
env:
global:
- DOCKER_USERNAME=raveberry
- secure: "n2xAJLXA5l+L+6W9FHTjGOrZ6PGiaZot19tt5mT5O3rA0FjxKkqQBze/IeA4OC5hM5B4Sj0xfXqXcTJNz5qzLpM92bXVTbl9mDPfr6zYKpWNFH9c6p1p1HlLn+aiYNT/+S/JjnuXTjLnS3TKDVsB+zATSko4iwlWdMzkZebfADHAYrKoBYiUzcXKanxVdoi18ntSiiMsriPGjPsaq0pOhJ/psjKV6jWCOZTUghoGX8bv3y1N1kZGuly2m9HIAFQYpVx+59IWAoAsUn64KKh9zh67euC9tS+GgJ6JOIh9v9VJMpCjCQbSJ9ZQh7OZ7rR0SQJ4NS8zQFRQcJvxo18QcqEjnP+XTA0xIPhW6NBTQ9n01qR5j3rWssl42bZwk7uqkCYkR17uKLQHqifgA/bfjbQ6HOX0Wd0wXhUxD4doPAF/7GwsiF3QRg5Y3Hpuozxqc38mPR3wujeprPg4Wz0MTivgs4CvcgkRjOxhdo6L3T7MyUwGgYcHfIQKJMW7B16RxsK3+QZFvUMmB94ZfNjAZ3cHamvwLKvMvu5G7It39F1oFPTnNr+823Zs/a+2CkotqlTH/yXwnRNkGFzgEyXoAmpdAcfUqWIwV0IXHBWl5irp05Yn0F9GqEvBKKLyRBUs2g4f63M3E043QXVLmHm5PM98dQA3wx7XeGwor8vEyfI="
services:
- docker
install:
- docker build -f docker/tests.Dockerfile -t raveberry-test .
script:
- docker-compose -f tests/docker-compose.yml up --exit-code-from daphne
before_deploy:
- yarn install
- scripts/clean_libs.sh
- mkdir raveberry
# move all files except those needed for packaging
- mv `\ls -A1 | grep -v -E '(setup.py|MANIFEST.in|raveberry)'` raveberry
deploy:
provider: pypi
user: __token__
password:
secure: "PeaYlNTZGABTbpTN9cjoNr+JEjq1KGk6S4GmgBelwVhfM88WuZi0DzLOVpLbWVIR77szSqGMNJN+P5WSdf75YsfWcDs9h4+fn9oj13OiZIYNEEXPpu3QC8Dcqe4t/XRc11pE79CXSkz3pvCUdwrSHt8RKJTypGpu1n5Pgt7YDoRzcHwzOQmLhm9gx6gJ6f8bKoEdbIoNtvNMRw1GM/SGPh+v5lkodfwEAQynWruqSR6HaYuvWqefwHouvVaSU5htItsVhU4h0nXxpQ5kMFZPmyX5/eb0R0z+ZxaYT7DdA6WquFPn5mp+/qtikd1xZXzRTifr5+bvV6yPIYYzvfb7kIYwnoGaFbYNazJ+M0mEWXjV5D/rcPT1H5tJU6gIrLXBw0BLReBfzNy9T8CnD7SG88dOH2JCpRBwi/L1XvBuAQqFSzmtlvTN+rYvowu8F8cwnLB6hsMqVILhqtOYsEEtgcjzR6Y05c7lotzF2Ek6tr75F4FclzB5SkPkT7cZg7w35laix5XG1yUgYDMGhW3N7SMtYlAy+rV8AR+6CmsHdO2PBgHXeB+xlN1fGMEfCt3o2XSUwW+CTsi8jutsqTC36eCXot+hfNRp/nTyZjh2EyvopdblPfFeH1Q4ZY4uTMEWCZ1hPgKaXosYykz9MFHlvNFB7RiP1WUlTVdEpX7qgmQ="
skip_cleanup: true
skip_existing: true
distributions: "sdist bdist_wheel"
after_deploy:
- cd raveberry
# read and trim the version from the latest docker image
- DOCKER_VERSION=$(docker pull raveberry/raveberry >/dev/null && docker run -it raveberry/raveberry pip freeze --path /opt | tr -d '[:space:]')
# read and trim the version of this folder
- PYPI_VERSION="raveberry==$(cat VERSION | tr -d '[:space:]')"
- echo $DOCKER_VERSION
- echo $PYPI_VERSION
# stop the build here if they are equal to skip unnecessary builds
- if [ "$DOCKER_VERSION" == "$PYPI_VERSION" ]; then exit 0; fi
# wait some time until until the new package is available on pypi
- sleep 60
# update docker
- curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
- sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
- sudo apt-get update
- sudo apt-get -y -o Dpkg::Options::="--force-confnew" install docker-ce
# setup cross compilation requirements
- sudo apt-get -y install qemu-user qemu-user-static
# https://github.com/docker/for-linux/issues/56#issuecomment-502263368
- git clone https://github.com/computermouth/qemu-static-conf.git
- sudo mkdir -p /lib/binfmt.d
- sudo cp qemu-static-conf/*.conf /lib/binfmt.d/
- sudo systemctl restart systemd-binfmt.service
- export DOCKER_CLI_EXPERIMENTAL=enabled
- sudo systemctl restart docker
- echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin
# https://stackoverflow.com/questions/59365141/pushing-images-to-docker-hub-for-multiple-architectures-e-g-amd64-arm64-and
- docker buildx create --driver docker-container --name local --use unix:///var/run/docker.sock
# no quiet mode, pipe to /dev/null to not exceed maximum log length with buildx's fancy output
# https://github.com/docker/buildx/blob/master/commands/build.go#L79
- docker buildx build --platform linux/amd64,linux/arm/v7 --output type=registry -f docker/Dockerfile -t raveberry/raveberry . 2>&1 | head -n 1000