forked from bmlt-enabled/bmlt-root-server
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
124 lines (115 loc) · 7.21 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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
language: php
php:
- '7.1'
env:
global:
- ZIP_FILENAME=bmlt-root-server-build${TRAVIS_BUILD_NUMBER}-${TRAVIS_COMMIT}.zip
- S3_BUCKET=archives.bmlt.app
- S3_KEY=bmlt-root-server
jobs:
include:
- stage: lint
install:
- composer install --dev
script:
- find . -name "*.php" ! -path '*/vendor/*' -print0 | xargs -0 -n1 -P8 php -l
- main_server/vendor/squizlabs/php_codesniffer/bin/phpcs --warning-severity=6 --standard=PSR2 --ignore=vendor --extensions=php --report=summary main_server
- stage: zip file
env:
- BUILD_DIR=build
- DIST_DIR_S3=dist/s3
- DIST_DIR_GITHUB=dist/github
- GITHUB_RELEASE_FILENAME=bmlt-root-server.zip
install:
- composer install --no-dev
script:
- cp LICENSE.txt main_server && cp .htaccess main_server/vendor
- find ./main_server -type d | xargs chmod 755
- find ./main_server -name '*.php' | xargs chmod 644
- mkdir $BUILD_DIR && zip -r $BUILD_DIR/$ZIP_FILENAME main_server
before_deploy:
- mkdir -p $DIST_DIR_S3 && cp $BUILD_DIR/$ZIP_FILENAME $DIST_DIR_S3/$ZIP_FILENAME
- mkdir -p $DIST_DIR_GITHUB && cp $BUILD_DIR/$ZIP_FILENAME $DIST_DIR_GITHUB/$GITHUB_RELEASE_FILENAME
deploy:
- provider: s3
access_key_id: AKIAI7JHYFA6DI3WYP5A
secret_access_key:
secure: "XXmslPjsNSisQoGp9ftbULzhnFnnwScLVXM7D/6Y2gwk3WLr/nEUX33WkWM9mWZrEkaWkPjHthBifOoX2t0sPVTvF00B3V9kdw6Y7FwCkm2soi13x64fKCiDA8Ed2bala+5uuC05sI8uGk4/4To2G67bVi0Lnhx1JDUn31EbvxvZc86F2mHfnRZyZNrmBSkOxMvWnHMspKFiOIf5KcuBrciaB5ZilYPuwJJXnQFy9srwifjA0mYOKJ6djyvP6RGWABHe8iuiKHx73m57vIRv57yOxVQ2zpiaoEu1RGZpwB+S1lqAC7TBziNk4i1aWpLide3lts8E2fARVYTSkZfnhVRarLWYNUhXBs8P93SVJkKsd/di5iVuv88mICDCA6KhVw3CtYzd5LX/1ocL1sxNOVeXeLNNADubfB9DGYcauowyUjkjmliDbfcjjXTeWgicfcEWysOMP8Zc9bXhI2+hJD2vvbZat9pCqF+Z1Px94PjQXiKzudmVnEitcO8N9fQvaljIXAF712dFKYiqkjDHNelQ3jRQk1gt+51jTCpCI0ZAclzBaOc8zjrVVqhfC9y8lEVoYdPhdroLHH34OmT4VEaxKgWb4ncDYA1+w33xXl2rlrjOvZDW0EqAhDni5jJ+wTYj5e+/7szN91wYswU0jhF2yv7jIxULXABghdmixwk="
bucket: $S3_BUCKET
local_dir: $DIST_DIR_S3
upload-dir: $S3_KEY
skip_cleanup: true
on:
all_branches: true
- provider: releases
api_key:
secure: "IU6COo9Q0JUZKxRp+tgps1ZSibpXy4gMonko0FyMwSF1GNP6JJit7JAPulK+ccl5k4y+16a5w/ho/EwGc+PI5py5SLk5+KzfJgS3YaWRptvLuX886M5egmNtgvE0SfkaQkfMipgzDc8FFENHaIFKSIDkiMNr5IKGoAz32qqr5sYHFBX5BmTBfa+sjPuZm1REri9ft2vR5zF1IZlD8BvCiMt4GD8+zYS26CiAEZjuh8tZNC/esamqunGGiu+z8Pn2vMqR3A6qwOD1GjFHXrjLB0osei6BiCQJDtzyz9ZpPCBYyDujUkDjSx7ap6PDAJZNOC1Cw78leGMW8oDEZK6iv/QRuF5EDvD986xZtJMB7tLAdDUS2NhgTeJVm4s9JJU11LO/p30PiWeYFIETxHvKOt9k+05VOV79uJKITxG6ifNrionGD2+eY0h6YnjBDb5Gg8AjFIfZ4y1xsmm5UlnEhfL2yEc0rjoWXL1Q4VtoVrZ4nwPkauC/DokuwKoslCUQ0H3G1d7y3ookmSUCV7Jfaid/Puvxmfe2TyPgVQMnQOfJbHxpn5kR5LhmAmNUaKc8Wi/72u0VNwsaLeiYcTTRu7YRe6BwUFg/S0QIdbbrhw4qtkj2xKYrknMNye3vBJLP/e7+Fq07bYYJlLlA0RQYcSqVKi6Z8E9so5dKs0KWKnw="
file: $DIST_DIR_GITHUB/$GITHUB_RELEASE_FILENAME
skip_cleanup: true
name: $TRAVIS_TAG
on:
tags: true
- stage: docker images
if: branch IN (master, unstable) OR tag IS present
services:
- docker
install:
- if [ "$TRAVIS_PULL_REQUEST" == "false" ]; then wget https://$S3_BUCKET/$S3_KEY/$ZIP_FILENAME && rm -rf main_server && unzip $ZIP_FILENAME; fi
script:
- docker build -f docker/Dockerfile-bmlt . -t bmlt-root-server:$TRAVIS_COMMIT
- docker build -f docker/Dockerfile-db . -t bmlt-root-server-sample-db:$TRAVIS_COMMIT
before_deploy:
- chmod +x travis/deploy-docker-images.sh
deploy:
- provider: script
script: travis/deploy-docker-images.sh
skip_cleanup: true
on:
branch: master
- provider: script
script: travis/deploy-docker-images.sh
skip_cleanup: true
on:
branch: unstable
- provider: script
script: travis/deploy-docker-images.sh
skip_cleanup: true
on:
tags: true
- stage: deploy to ecs
if: branch IN (master, unstable) AND type != pull_request
env:
- AWS_DEFAULT_REGION=us-east-1
- secure: "He2FsOfRQILckDqmVInhUeG743pp2baqSBOvpX+JQogDwNIMeLbSdC59bb+9twaAoWvGJzZjcxrkO3QQoPwCMFuSUE8wU/YIfDsYJY0ONaRYvAX/ZnpRKHVePBwJccOfUGnk+62EubM3n3QoiFa/h6NzQ6EzjR1fyg0q30jmpOA2H+tLhF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BwC5GUBYn51Z692mbrY159ktcKoMybcuMAq1XahSLNPntG8ZeFxH2ywE8V1guk3t6zoB19W+w/4tYUoOUoYyi8TsLuuaLAghg9idj1KtcIJiOBFJTR/ZKQtc3ypQ="
install:
- cd terraform
- wget https://releases.hashicorp.com/terraform/0.12.18/terraform_0.12.18_linux_amd64.zip
- unzip terraform_0.12.18_linux_amd64.zip
- rm -f terraform_0.12.18_linux_amd64.zip
script:
- ./terraform init -input=false
- ./terraform taint -allow-missing aws_ecs_task_definition.bmlt_$(if [ $TRAVIS_BRANCH == "master" ]; then echo latest; else echo unstable; fi)
- ./terraform apply -input=false -auto-approve
- stage: deploy docs to gh-pages
addons:
apt:
packages:
- doxygen
script:
- mkdir docs && cd doc
- doxygen Doxyfile
deploy:
- provider: pages
skip_cleanup: true
local_dir: docs
target_branch: gh-pages
github_token: $GITHUB_API_KEY
on:
branch: master
notifications:
slack:
rooms:
- secure: "bmoIugz9sorNakDw7LnfC3iB7a4CnhuZeZBAVxefSoqipbZAGLoA86pSaDwSK3kNsCRAUXyHJ0pBxxJuCO5jrQKhl9TNBFQQ60KPvn3LQj9OXXTSHp4qoqBytipQGyjeqySu4fJt8Lc0u8FQ0qinxn21qF7K7c54aygVKQd+nxf/+9rVzSOJIY+c6UEBb9FwKfHl9cOJy8nTHYPNl0ZbQaYVS1gvyOV2jzrlurOXb0t2xYs2W9EOAjUd2E4ZVaD8EEyRZ9zcvy8ne41qZGBLMJjHZo6TdN4x0AdEYiITst5fKj+YILNCaVQMyURu5h65RPVXyjZ/eIOUixSt1EOpMTxWcRiDn3H7B2F7eEUIXyo/c5x1AEWEQFLGK+/PEqWx/zaBG0rJJdzVbLaqet2kg5piy+f84EBCZiXm7CZIYPMSjLJo9AJDcY9iSRgvpRnkSagHZAgMILNut53aNPd8i3FoOeycPwux/KDQpSz0uIpn4xu26VY0bzxJ8N27VugUhmNhLCN05Hgw8GoDjEoh4EgPPsdNVzXT4mzpjx2GfhRZOm/78LUSDB/w3oIAEPzRFfhberBAo0l2w9T5+Ynbw9yyquYgNUOW/nMhbwqOPbWqndHa8Xume0DXp2COHEqoSZx4gDIIRRKjKdsrFjjasWB5K7IQXQfBoiGAL7EscNA="
on_success: change
email: false