seafile-containerized/ci/ci.sh

50 lines
1.2 KiB
Bash
Raw Normal View History

2016-11-25 07:48:46 +00:00
#!/bin/bash
2018-10-16 07:16:51 +00:00
version=6.3.7
2016-11-25 07:48:46 +00:00
set -e -x
2018-04-03 02:58:14 +00:00
./ci/install_deps.sh
2016-11-25 07:48:46 +00:00
(
cd image
# pip install docker-squash
# make base squash-base server
make base
2018-04-03 02:58:14 +00:00
make pro-base
make pro-server
2016-11-25 07:48:46 +00:00
)
mkdir -p /opt/seafile-data
2018-05-09 10:36:10 +00:00
docker run -d --name seafile -e SEAFILE_SERVER_HOSTNAME=127.0.0.1 -v /opt/seafile-data:/shared -p 80:80 -p 443:443 seafileltd/seafile-pro:$version
2018-04-03 02:58:14 +00:00
cat > doc.md <<EOF
# Doc
Hello world.
EOF
sleep 50
python ci/upload.py doc.md
python ci/validate_file.py doc.md
docker restart seafile
2018-04-03 02:58:14 +00:00
sleep 30
python ci/validate_file.py doc.md
docker rm -f seafile
2018-05-09 10:36:10 +00:00
docker run -d --name seafile -e SEAFILE_SERVER_HOSTNAME=127.0.0.1 -v /opt/seafile-data:/shared -p 80:80 -p 443:443 seafileltd/seafile-pro:$version
2018-04-03 02:58:14 +00:00
sleep 30
python ci/validate_file.py doc.md
rm -rf doc.md
2016-12-21 08:02:49 +00:00
2018-04-03 02:58:14 +00:00
if [[ $TRAVIS_TAG =~ ^v([0-9]*?)(\.([0-9])*?){2}-pro$ ]]; then
ci/publish-pro-image.sh
elif [[ $TRAVIS_TAG =~ ^v([0-9]*?)(\.([0-9])*?){2}$ ]]; then
2016-12-21 08:02:49 +00:00
ci/publish-image.sh
2018-04-03 02:58:14 +00:00
elif [[ $TRAVIS_TAG =~ ^seafile-pro-base$ ]]; then
ci/publish-pro-base.sh
elif [[ $TRAVIS_TAG =~ ^seafile-base$ ]]; then
ci/publish-base.sh
2016-12-21 08:14:37 +00:00
else
echo "Not going to push the image to docker hub, since it's not a build triggered by a tag"
2016-12-21 08:02:49 +00:00
fi