forked from contentacms/contenta_jsonapi
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis.yml
100 lines (88 loc) · 3.2 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
dist: trusty
group: edge
language: php
addons:
chrome: stable
php:
- 7.1
- 7.2
cache:
directories:
- "$HOME/.composer/cache/files"
notifications:
webhooks:
urls:
- http://ec2-54-244-218-244.us-west-2.compute.amazonaws.com/issue
on_success: never
on_failure: always
on_start: never
on_cancel: never
on_error: always
env:
global:
- PROJECT_NAME=contentacms
- PROJECT_BASE_PATH=$HOME/$PROJECT_NAME
- PROJECT_RELEASE_BRANCH=${PROJECT_RELEASE_BRANCH:-8.x-1.x}
branches:
only:
- /^8\.x\-[0-9]+\.x$/
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
- mkdir $PROJECT_BASE_PATH
# Load .env and .local.env
- source ./scripts/ci/travis/load_env.sh
install:
- composer run-script install-contenta $PROJECT_BASE_PATH --timeout=0
- composer run-script ci:helper setup_anonymous_user "$PROJECT_BASE_PATH" --timeout=0
before_script:
# Start Contenta Local Server
- sleep 8 # give web server some time to start
script:
- composer run-script ci:helper run_functional_tests "$PROJECT_BASE_PATH" --timeout=0
after_script:
- killall php
# This stanza creates Travis Stages that are sequentially dependent.
jobs:
include:
# Deployment Stage
# This stage promotes a successful artifact from the deployment branch to GitHub
- stage: Release
php: 7.2
install: skip
before_script: skip
script: skip
before_deploy:
# Install Contenta
- composer run-script install-contenta $PROJECT_BASE_PATH --timeout=0
# Set Deployment Variable
- RELEASE_DATE=$( date +%Y-%m-%d)
- TRAVIS_TAG="v1.${TRAVIS_BUILD_NUMBER}"
# Clean the Contenta 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
- 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"
after_deploy:
# Clone the demo site repo to trigger an automated.
- git clone git@github.com:contentacms/contenta_jsonapi_demo.git contenta_jsonapi_demo
# Navigate inside the cloned project.
- cd contenta_jsonapi_demo
- echo -e " * Profile update -> buildNum=[$CIRCLE_BUILD_NUM]($CIRCLE_BUILD_URL) on [$CIRCLE_PR_REPONAME]($CIRCLE_REPOSITORY_URL)@CIRCLE_SHA1\n" >> DEPLOYS.md
- git add DEPLOYS.md
- 'git commit -m "ci(Deploy): Trigger a deploy to the demo site"'
- git push origin master