-
Notifications
You must be signed in to change notification settings - Fork 27
/
.travis.yml
83 lines (70 loc) · 2.95 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
dist: trusty
language: php
services:
- mysql
php:
- 7.2
git:
depth: 200
before_install:
# Create mautictest database
- mysql -e 'CREATE DATABASE mautictest;'
# turn off XDebug
- phpenv config-rm xdebug.ini || return
# install dependencies in parallel
- travis_retry composer global require hirak/prestissimo
# set to test environment for Symfony's commands in post install commands
- export SYMFONY_ENV="test"
install:
# There are 2 build variants to be built based on the branch name:
#
# build.sh - Standard Mautic (default)
# Includes latest release and standard dependencies.
# Pretty much just a standard `composer install`.
#
# build-dev.sh - Custom distribution (for branches containing the word "dev")
# Includes a specific (recent) sha, core patches, custom theme, and additional plugins.
# This build is Used for advanced testing and deployment by DMS.
- if [[ "$TRAVIS_BRANCH" = *"dev"* ]]; then ./scripts/build-dev.sh; else bash ./scripts/build.sh; fi
script:
# Run PHPUnit on the complete build.
- cd mautic
- bin/phpunit -d memory_limit=2048M --bootstrap vendor/autoload.php --configuration app/phpunit.xml.dist --stop-on-failure
- cd -
before_deploy:
# Generate a version label based on git describe and preserve description before above.
- VERSION=`git describe --long --tags --always`
- DESCRIPTION=`git log -n 1 --pretty=%B`
- export ELASTIC_BEANSTALK_LABEL="$VERSION"
- echo "Version label is '$ELASTIC_BEANSTALK_LABEL'"
- export ELASTIC_BEANSTALK_DESCRIPTION="$DESCRIPTION"
- echo "Version description is '$ELASTIC_BEANSTALK_DESCRIPTION'"
# Travis uses .gitignore instead of .ebignore https://github.com/travis-ci/dpl/issues/411
# Overcome this issue by pretending everything has been committed, and removing all .gitignore files
# This will allow Travis to deploy in effectively the same way as `eb deploy`
- find . -name ".gitignore" -type f -exec rm -f '{}' \;
- cd mautic ; find . -name ".git" -type d -exec rm -rf '{}' \; ; cd -
- cd vendor ; find . -name ".git" -type d -exec rm -rf '{}' \; ; cd -
- cd mautic_custom ; find . -name ".git" -type d -exec rm -rf '{}' \; ; cd -
- cd plugins ; find . -name ".git" -type d -exec rm -rf '{}' \; ; cd -
- cp .ebignore .gitignore
- git config --global user.email "NA"
- git config --global user.name "NA"
- git add -A
- git commit -m "Surpassing Travis EB incompatibility" --quiet
deploy:
# Optional deployment to Elastic Beanstalk (Environment Variables must be configured in your Travis settings)
provider: elasticbeanstalk
access_key_id: $AWS_ACCESS_KEY_ID
secret_access_key: $AWS_SECRET_ACCESS_KEY
region: $AWS_REGION
app: $AWS_EB_APP
env: $AWS_EB_ENV
bucket_name: $AWS_S3_BUCKET_NAME
bucket_path: $AWS_S3_BUCKET_PATH
skip_cleanup: true
on:
branch: dev
# http://docs.travis-ci.com/user/notifications/
notifications:
slack: dmsgroup:3nPbmvUU584YtdeDVOweIMWg