forked from headwirecom/peregrine-cms
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
43 lines (36 loc) · 1.61 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
branches:
only:
- master
- develop
services:
- docker
env:
global:
- DOCKER_IMAGE=peregrinecms/peregrine-cms
- DOCKER_USERNAME=gastongonzalez
matrix:
- secure: x21cQdxtCEHV9BrGPmP+FzaraSoRbTAty2DDeNbycAjcJZsJt4hMcUy5tOBShCY2o/IlF6jVDHmDo3inRPbPQvhop9b4iK3vSfnzfk1cT+K2/TJw9r0ZtWS55A2nkxkG6QidJE03Oc557MY1ouJX5JTSoAm2FO5AQ+AOXorxtwSpBCGQTHGNOmRhV6CayerReaqoG8zEiVLin/uRf/vv0IqyW86vSe5mQWCRIK0V4Rjm1E8so9y/yjTxDU4KazTN6+Yu37m70pV3J42OcNr1nfF7tMjqu9RLUtxArDzmGPMKuAXYisq6tARkcB5MRZ1xVT0u25IFEKLyBYySbjMeD/fF3gra4yCnijnqGraYeXQ2IdPxf/5kcrtt85OMRG4OV3KDCrCOt64yX0t254UWccD1xN5nWm8ht61gAcpvZ8/yy/bD1MKeJvWBCpMYG5MblO33da78sMO0yY8ziSO0wO7fLx0b/0wspfz7dSlXo8FKKgj/+xKUnmi0ZWnhxwvi5fhvJIBANwmdE5Tmcy+OtgbhRoMfNHIQv3Bwqdolpp9Z8ROQxGnpUd4W4qUGz1UoO49DCwAEUz/j7E4zZKJyG4U+ZyHcFotN1KTCXkxR5O/d2Nej1jAL0fQWzuk2pAGsBkQAAbvcHtJIkmK5hCxXm3wVK9S/Cii68zfIb8QUudI=
before_script:
- branch="$(echo ${TRAVIS_BRANCH} | tr '/' '-' | tr '[:upper:]' '[:lower:]')"
- version="$(awk '$2 == "APP_VERSION" { print $3; exit }' docker/Dockerfile)"
- tag="${branch}-${version}"
script:
- cd docker && ./builddocker.sh
after_script:
- docker images
before_deploy:
- docker login -u "$DOCKER_USERNAME" -p "$DOCKER_PASSWORD"
- docker tag "$DOCKER_IMAGE" "${DOCKER_IMAGE}:latest"
- docker tag "$DOCKER_IMAGE" "${DOCKER_IMAGE}:${branch}"
- docker tag "$DOCKER_IMAGE" "${DOCKER_IMAGE}:${tag}"
deploy:
# Stable release
provider: script
script: docker push ${DOCKER_IMAGE}:${tag}
on:
branch: master
# Development release
provider: script
script: docker push ${DOCKER_IMAGE}:${branch} && docker push ${DOCKER_IMAGE}:latest
on:
branch: develop