docker-jetbrains-license-se.../.travis.yml
2018-11-25 20:46:46 +01:00

58 lines
4.0 KiB
YAML

sudo: required
services:
- docker
env:
global:
- VERSION=17955
- DOCKER_USERNAME=crazymax
- DOCKER_REPONAME=jetbrains-license-server
- QUAY_USERNAME=crazymax
- QUAY_REPONAME=jetbrains-license-server
- MICROBADGER_HOOK=https://hooks.microbadger.com/images/crazymax/jetbrains-license-server/PWF7sHnaK1djP4E9r5VY5suUqVk=
- secure: JwfXiiIM4c6E+80O6XHQBhw6IdkerfGxlKo+YHvmtkHyz5Fvpc1ZRvWSZYHZhxE1gocThbKUCy4GsgIyiq+dsER27kdAnnvp6JLw8SZ5OSqtOOLjqCKilN2hwFaS/g6Xc3mGvTo+4ScAc9CDJamDCwGY+6r2g/+IdmCbgqOo8yaD4VkhP4eVB3f4el6F7jEwjo626QDzFZ1LVS0qmmeVBSU+xxfL5HolG+j//hLQ/49XIIGnsWtQmHbX1u2trSESyNRTFdY/KZ7qaW8l+BgLhplKu+YXAExb1POGcKJnffSJjCl22ggX1JUHANMgrcQfZe2DKkUJFqr8FvTCktj+lfAuMYwl3k24zcZHe8eTyBFh8YLs7pn++tOFWg0XcKCWO9vzHgbTf/m95F6tpDMx4Y49jRclJIslxkjf8YIuNvDOO4kPKp2bw4ymqjsayPLx3P4xB8vgvyAZeFBQevUkh3ia/3uCfwEwzWimlT1FTeDUj8h4A9y+zRy/AqGf35LneC/Sbwt5dNaCujAwOGFeCvTp43uYd10S5Rz026ecH/8XlcHzuH4+nUvXDnesRI79+6NkaKl8PdcTx0ZC44jIAULn60rur5ybNkQmv5GWjem1C24izosPuC8bLHYY6BSRPn+vacNZH9SYTw2wHiVunxZORWz4FsYAidFkoaygt9E= # DOCKER_PASSWORD
- secure: Z+SIP2bLs70GcInLxGdYv68vXD47RIfowafFP8KpVt7EHki6AsIVJxrEH4/noj0jsx0Zyi93xAo+Z9Ms+BDsjUKeLjODS/mHjRQBrnryenjAnS8cRVvJUUDYcoY95SIOO4j6OSEIb+aI2d+6T2QX/iEgnEFDjiia2mLJ60orsWDtgoU7dgITB7ci4WkSMZl8VXtX7SUWKgVPRKkapfYX/AFUS41MZTnJvGQHCtTYlOMcS7fsf6ahjMvbTmf+otv2n688Mbg8Tz3cEw6YD5BHemfDq5qEJqjjnCtMIr5VSZttDwKwHsgmHrVEoiPq+Cdo+xwq3XCdfKu/qAD7NalBjNVaf6UjLjhkk4CWwLxQFnon1e8EC8GodXob4jQTGVOQX47lkPCvf6zM14GI1YxGMtofkv5ND7Ul/g+9fsn+b/QJFsuQb3ZA34pufjQQ5HRaj0ZU7izXIpUOu5EVo5ffrmUnrTisVNaSuIUonEt0p1WPFhdr1ScUc/VukF+wapDdSrSu/t8a5MXp0q3nZ+20NHlkm90o8umQqS8U1oo/n1hlEWTpC4PtRd4wggz0YNGTIKLpuxUt8HolU9rSPbGcbMLC53bNxnWd9KFaaFmRj5Np1GsBm2CDAPFYb3n/Dqyww+tg9Nk4MnCLMwROyZ+5Y7UQLtG5Tsh9tCtwPtT7Juk= # QUAY_PASSWORD
before_install:
- sudo apt-get update
- docker --version
- export BRANCH=$(if [ "$TRAVIS_PULL_REQUEST" == "false" ]; then echo $TRAVIS_BRANCH; else echo $TRAVIS_PULL_REQUEST_BRANCH; fi)
- export DOCKER_TAG=$(if [ "$BRANCH" == "master" ]; then echo "latest"; else echo $BRANCH; fi)
- export WAN_IP=$(dig +short myip.opendns.com @resolver1.opendns.com)
- echo "WAN_IP=$WAN_IP, TRAVIS_BRANCH=$TRAVIS_BRANCH, PR=$PR, BRANCH=$BRANCH, DOCKER_TAG=$DOCKER_TAG"
install:
- |
docker build --build-arg BUILD_DATE=`date -u +"%Y-%m-%dT%H:%M:%SZ"` \
--build-arg VCS_REF=${TRAVIS_COMMIT::8} \
--build-arg VERSION=${VERSION} \
-t docker_build .
before_script:
- docker run -d -p 8000:80 -e JLS_VIRTUAL_HOSTS=$WAN_IP --name $DOCKER_REPONAME docker_build
- sleep 20
- docker logs $DOCKER_REPONAME
script:
- docker ps | grep $DOCKER_REPONAME
- |
test $TRAVIS_PULL_REQUEST = false \
&& echo "$DOCKER_PASSWORD" | docker login --username "$DOCKER_USERNAME" --password-stdin \
&& docker tag docker_build $DOCKER_USERNAME/$DOCKER_REPONAME:$DOCKER_TAG \
&& docker tag docker_build $DOCKER_USERNAME/$DOCKER_REPONAME:$VERSION \
&& docker push $DOCKER_USERNAME/$DOCKER_REPONAME \
&& curl -X POST $MICROBADGER_HOOK \
&& echo "$QUAY_PASSWORD" | docker login quay.io --username "$QUAY_USERNAME" --password-stdin \
&& docker tag docker_build quay.io/$DOCKER_USERNAME/$DOCKER_REPONAME:$DOCKER_TAG \
&& docker tag docker_build quay.io/$DOCKER_USERNAME/$DOCKER_REPONAME:$VERSION \
&& docker push quay.io/$QUAY_USERNAME/$QUAY_REPONAME
branches:
except:
- /^[0-9]/
notifications:
webhooks:
secure: aSAfpOXZ2sZF4lR+e0Pi8O1/ePVft0wwSQm6L2nugmk+bIkZO/iC+SaNTK1rbbiba/zEjSmxvtA+3Sx+Sw9eOPZaP3sm6PvaVycukmZeUeVMlDUDDiV1xKshAisYuheVSO4kvRFzqoSo/IwClukHbGtYO9bquxgfy+Nan5wkzx0rzFDNsSChDbAEcnZKXxSrXSlOYVtY1fRcBTq52BwnBJzE4+6zDDNJz47sJY3dhAToodOpg+LkiX6b8kY8iAtEf25HKGrJ+O7mGLJOrtZmHLBQXAhcMHLNGtajuP3xZe/1Nq/rezRzbD/Tv7breXoIABnHR6y7oGf2Iry46Uzeg758AEYNU4FymD2sDz1zF1362OFBDq50pZm/MG2K4YqrKcWoy+TzCm4+H/XzsXG1jootRj2vsy1/QFL6zI/vVk6ZsN2ISSEFrJ2T/SZZWHxhYihGemfaSLoLZ0o316KrJxmzj37YucYjJYY/b+iAQruAFPJLd3vtanHfTaFQdUiXJdU7rrolESKI1zg/1cx5rV8PrnUZJXrSNATXgoyXsEvDRsdekHg8w+6ml6OenhgrNoJYG1c+GFtCf/cUaKe9bw6WniiqXtgw75Tdz0BqzNTu9BibhnDdeKYFBzT6wgsBRs47fgWcnmy++CryMvWymTdiiDnTaljUGB/rikA9QTk=