forked from contentacms/contenta_jsonapi
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
74 lines (69 loc) · 2.67 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
language: php
php: 7.2
cache:
directories:
- "$HOME/.composer/cache/files"
services:
- mysql
env:
global:
- PROJECT_NAME=contentacms
- PROJECT_BASE_PATH=$HOME/$PROJECT_NAME
- PROJECT_RELEASE_BRANCH=${PROJECT_RELEASE_BRANCH:-8.x-3.x}
- SIMPLETEST_BASE_URL=http://127.0.0.1:8888
- DB_NAME=drupal8_${TRAVIS_BUILD_NUMBER}
- SIMPLETEST_DB=mysql://[email protected]/drupal8_${TRAVIS_BUILD_NUMBER}
branches:
only:
- /^8\.x\-[0-9]+\.x$/
jobs:
include:
-
stage: test
before_install:
# Fixes Composer exhausting the memory when using PHP 5.6.
- echo "memory_limit=-1" >> ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/travis.ini
# Fix failing tests due to email sending.
- echo 'sendmail_path = /bin/true' >> ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/travis.ini
- composer selfupdate
- mkdir $PROJECT_BASE_PATH
- mysql -e "CREATE DATABASE IF NOT EXISTS $DB_NAME;"
install: composer run-script install-contenta $PROJECT_BASE_PATH --timeout=0
before_script:
# Start Contenta CMS Local Server
- composer run-script start-contenta $PROJECT_BASE_PATH --timeout=0 &
- until curl -sS $SIMPLETEST_BASE_URL; do sleep 1; done > /dev/null
- echo "Connected to the test server at ${SIMPLETEST_BASE_URL}"
script: composer run-script ci:helper run_functional_tests "$PROJECT_BASE_PATH" --timeout=0
after_script:
- mysql -e "DROP DATABASE $DB_NAME;"
- mysql -e "SHOW DATABASES;"
- killall php
-
stage: release
before_install:
- composer selfupdate
install: composer run-script install-contenta $PROJECT_BASE_PATH --timeout=0
before_script: skip
script: skip
before_deploy:
# Set Deployment Variable
- RELEASE_DATE=$( date +%Y-%m-%d)
# Clean the Contenta CMS Profile Folder
- composer run-script ci:before-deploy contentacms_profile_cleanup "$PROJECT_BASE_PATH/web" --timeout=0
# Remove Site files
- composer run-script ci:before-deploy rm_site "$PROJECT_BASE_PATH/web" --timeout=0
# Zip Folder
- TRAVIS_TAG="v3.0.${TRAVIS_BUILD_NUMBER}"
- composer run-script ci:before-deploy zip_folder "$HOME" "$PROJECT_NAME" "$TRAVIS_TAG" --timeout=0
deploy:
provider: releases
api_key:
secure: $SECURE_TOKEN
file: "$TRAVIS_TAG.zip"
skip_cleanup: true
name: "Release: ${RELEASE_DATE} build ${TRAVIS_BUILD_NUMBER}"
on:
# Only release if it $PROJECT_RELEASE_BRANCH gets updated
branch: $PROJECT_RELEASE_BRANCH
repo: "contentacms/contenta_jsonapi"