Skip to content

Commit 34e641a

Browse files
committed
Added separate installation/configuration scripts for Travis (still PHP 5.5.9)
1 parent 02246b3 commit 34e641a

File tree

4 files changed

+73
-14
lines changed

4 files changed

+73
-14
lines changed

.travis.yml

+6-14
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,6 @@
11
language: php
22
php:
3-
# - 5.5
4-
# - 5.4
5-
- 5.3
6-
7-
#before_install:
8-
# - sudo apt-get update
3+
- 5.5.9
94

105
env:
116
global:
@@ -15,14 +10,14 @@ env:
1510
- secure: "XRsqGDqdu5uhdj2lF4SZ6qv6Y0PdcRPcvE13XvVGnIYRZaITelP3eJNSvLPO+Q5k4mBmKCz8t+ws/OVRRwSAXYaKe0Z8ZXgEcNyo1nEwGekC35mTuG1FFfB/pbuBp5/OWjw6bgz2tEHhKuFIbHytpT9zJQYy+D07rzOYeUsZjOY="
1611

1712
before_script:
18-
- sudo chmod +x scripts/install.sh
19-
- scripts/install.sh
13+
- sudo chmod +x scripts/travis_install.sh
14+
- scripts/travis_install.sh
2015
- cd /opt/codebender/builder/Symfony
2116
- sudo chmod -R 777 app/cache app/logs
22-
- echo 'error_reporting = E_ALL & ~E_NOTICE & ~E_STRICT & ~E_DEPRECATED' >> ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/travis.ini
17+
- echo 'error_reporting = E_ALL' >> ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/travis.ini
2318
- cd /opt/codebender/builder
24-
- sudo chmod +x scripts/apache_install.sh
25-
- scripts/apache_install.sh
19+
- sudo chmod +x scripts/travis_apache_install.sh
20+
- scripts/travis_apache_install.sh
2621
- cd /opt/codebender/builder/Symfony
2722

2823
script:
@@ -37,6 +32,3 @@ after_script:
3732

3833
notifications:
3934
irc: "chat.freenode.net#codebender.cc"
40-
# email:
41-
# recipients:
42-

apache-config-2.2

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<VirtualHost *:80>
2+
DocumentRoot /var/www
3+
<Directory /var/www/>
4+
Options -Indexes FollowSymLinks MultiViews
5+
AllowOverride All
6+
Order allow,deny
7+
Allow from all
8+
</Directory>
9+
</VirtualHost>

scripts/travis_apache_install.sh

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#!/bin/bash
2+
set -x
3+
set -e
4+
5+
PACKAGENAME=builder
6+
7+
sudo ln -s /opt/codebender/$PACKAGENAME/Symfony/web /var/www/$PACKAGENAME
8+
sudo cp /opt/codebender/$PACKAGENAME/apache-config-2.2 /etc/apache2/sites-available/codebender-$PACKAGENAME
9+
cd /etc/apache2/sites-enabled
10+
sudo ln -s ../sites-available/codebender-$PACKAGENAME 00-codebender.conf
11+
sudo service apache2 restart

scripts/travis_install.sh

+47
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
#!/bin/bash
2+
set -x
3+
set -e
4+
5+
PACKAGENAME=builder
6+
7+
echo "Configuring environment for Linux (Ubuntu 12.04)"
8+
9+
# Make sure we have up-to-date stuff
10+
sudo apt-get update
11+
12+
# Install dependencies
13+
sudo apt-get install -y apache2 libapache2-mod-php5 php-pear php5-curl php5-sqlite php5-mysql acl curl git
14+
# Enable Apache configs
15+
sudo a2enmod rewrite
16+
sudo a2enmod alias
17+
# Restart Apache
18+
sudo service apache2 restart
19+
20+
HTTPDUSER=`ps aux | grep -E '[a]pache|[h]ttpd|[_]www|[w]ww-data|[n]ginx' | grep -v root | head -1 | cut -d\ -f1`
21+
22+
sudo mkdir -p /opt/codebender
23+
sudo cp -r . /opt/codebender/$PACKAGENAME
24+
sudo chown -R `whoami`:$HTTPDUSER /opt/codebender/$PACKAGENAME
25+
cd /opt/codebender/$PACKAGENAME
26+
27+
#Set permissions for app/cache and app/logs
28+
29+
rm -rf Symfony/app/cache/*
30+
rm -rf Symfony/app/logs/*
31+
32+
# Need to create cache and logs directories, as they do not pre-exist in new deployments
33+
mkdir -p `pwd`/Symfony/app/cache/
34+
mkdir -p `pwd`/Symfony/app/logs/
35+
36+
cd Symfony
37+
38+
set +x
39+
cat app/config/parameters.yml.dist | grep -iv "compiler:" | grep -iv "library:" > app/config/parameters.yml
40+
echo " compiler: '$COMPILER_URL'" >> app/config/parameters.yml
41+
42+
echo " library: '$LIBRARY_URL'" >> app/config/parameters.yml
43+
set -x
44+
45+
46+
curl -s http://getcomposer.org/installer | php
47+
php composer.phar install

0 commit comments

Comments
 (0)