-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathcircle.yml
89 lines (86 loc) · 3.38 KB
/
circle.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
# https://circleci.com/docs/configuration#machine
machine:
php:
# https://circleci.com/docs/environment#php
version: 5.6.14
environment:
# DB config. Using default CircleCI's database.
DB_NAME: "circle_test"
DB_USERNAME: "ubuntu"
DB_PASSWORD: ""
DOCROOT: "$HOME/drupalcore"
SERVER: server.local
WEB_USER: $(whoami)
WEB_GROUP: www-data
hosts:
server.local: 127.0.0.1
dependencies:
cache_directories:
- ~/.composer/cache
pre:
- composer global require "hirak/prestissimo:^0.3"
- composer global require drush/drush:8.*
# @todo, composer is probably a bad/slow way to install core here.
# Use something like drush's
- git clone --branch 8.2.x https://git.drupal.org/project/drupal.git $DOCROOT
- cd $DOCROOT && composer install
# Add apache config.
# Modify user to make sure that there will be no permission issues.
- sudo usermod -a -G $WEB_GROUP $WEB_USER
# Add apache config.
- |
echo "<VirtualHost *:80>
UseCanonicalName Off
DocumentRoot %DOCROOT%
ServerName %SERVER%
<Directory %DOCROOT%>
Options FollowSymLinks
AllowOverride All
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule %DOCROOT%/(.*)$ index.php/?q=$1 [L,QSA]
Order allow,deny
Allow from all
</Directory>
</VirtualHost>" > apache-vhost.conf
- cp apache-vhost.conf /etc/apache2/sites-available/default
- sudo sed -e "s?%DOCROOT%?$DOCROOT?g" --in-place /etc/apache2/sites-available/default
- sudo sed -e "s?%SERVER%?$SERVER?g" --in-place /etc/apache2/sites-available/default
- sudo a2enmod rewrite
- sudo service apache2 restart
test:
pre:
# Copy the settings.local into place
# Disable sendmail binary to suppress any mailouts.
- echo 'sendmail_path = /bin/true' >> ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/circle.ini
- drush --yes --root=$DOCROOT site-install --db-url=mysql://$DB_USERNAME:[email protected]/$DB_NAME
- curl $SERVER
- cd $DOCROOT && drush en simpletest -y
- cd $DOCROOT && composer config repositories.d8lcache vcs [email protected]:lcache/drupal-8.git
- cd $DOCROOT && composer require "drupal/lcache:dev-8.x-1.x#$CIRCLE_SHA1"
- cd $DOCROOT && drush en lcache -y
override:
- ./vendor/bin/phpcs --report=full --extensions=php,module,inc,theme,info --standard=vendor/drupal/coder/coder_sniffer/Drupal/ --ignore=vendor .
- cd $DOCROOT && /home/ubuntu/.phpenv/shims/php core/scripts/run-tests.sh --url $SERVER --module lcache --php /home/ubuntu/.phpenv/shims/php --verbose --color
deployment:
feature:
branch: 8.x-1.x
commands:
# Make sure the full history from GitHub is present. If it is not,
# the push to drupal.org will fail.
- git fetch --unshallow
- git remote add drupalorg [email protected]:project/lcache.git
- git fetch drupalorg
- git push drupalorg $CIRCLE_BRANCH
release:
tag: /8.x-.*/
owner: lcache
commands:
# Make sure the full history from GitHub is present. If it is not,
# the push to drupal.org will fail.
- git fetch --unshallow
- git remote add drupalorg [email protected]:project/lcache.git
- git fetch drupalorg
- git push drupalorg --tags