-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Composer, bundler, drush for site install and file permissions fix.
- Loading branch information
1 parent
b075767
commit 4a11293
Showing
13 changed files
with
299 additions
and
901 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,10 @@ | ||
.vagrant | ||
.bundle | ||
puppet/modules/* | ||
!puppet/modules/README.md | ||
puppet/.librarian | ||
puppet/.tmp | ||
app | ||
patches | ||
vendor | ||
bin |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,71 +1,107 @@ | ||
<!-- | ||
name: build.xml | ||
description: The main project build file for phing operations. This file can | ||
description: The main project build file for phing operations. This file can | ||
be overridden with project specific configuration. | ||
--> | ||
|
||
<project name="vd8" default="prepare" phingVersion="2.4.11"> | ||
|
||
<!-- We set this to optional as is managed by composer --> | ||
<includepath classpath="vendor/nickschuch/drupal-install" /> | ||
<import file="vendor/nickschuch/drupal-install/build.xml" optional="true" /> | ||
|
||
<!-- --> | ||
<!-- Properties --> | ||
<!-- ============= --> | ||
|
||
<property name="app.uri" value="http://d8.dev" /> | ||
<property name="app.installUrl" value="core/install.php" /> | ||
|
||
<!-- User details. --> | ||
<property name="app.email" value="user@example.com" /> | ||
<property name="app.username" value="admin" /> | ||
<property name="app.password" value="password" /> | ||
|
||
<!-- Database options --> | ||
<property name="app.databaseHost" value="d8.dev" /> | ||
<property name="app.databasePort" value="3306" /> | ||
<property name="app.database" value="d8" /> | ||
<property name="app.databaseUser" value="d8" /> | ||
<property name="app.databasePass" value="d8" /> | ||
<!-- Drupal --> | ||
<property name="drupal.siteName" value="Drupal8" /> | ||
<property name="drupal.email" value="user@example.com" /> | ||
<property name="drupal.user" value="admin" /> | ||
<property name="drupal.pass" value="password" /> | ||
<property name="drupal.dir" value="${project.basedir}/app" /> | ||
|
||
<!-- Mysql --> | ||
<property name="mysql.host" value="d8.dev" /> | ||
<property name="mysql.port" value="3306" /> | ||
<property name="mysql.database" value="d8" /> | ||
<property name="mysql.user" value="d8" /> | ||
<property name="mysql.pass" value="d8" /> | ||
<property name="mysql.queryString" value="mysql://${mysql.user}:${mysql.pass}@${mysql.host}/${mysql.database}" /> | ||
|
||
<!-- Drush --> | ||
<property name="drush.cmd" value="bin/drush -r ${drupal.dir}" /> | ||
|
||
<!-- Vagrant --> | ||
<property name="vagrant.dir" value="/vagrant" /> | ||
|
||
<!-- Globals for exec commands. The main goal of these were for fast failingin the bot. --> | ||
<property name="test.output" value="true" /> | ||
<property name="test.passthru" value="true" /> | ||
|
||
<!-- Provide overrides. --> | ||
<property file="build.properties" override="true" /> | ||
|
||
<!-- Build MySQL connection string using properties --> | ||
<property name="app.mysql_connect" value="mysql -u${app.databaseUser} -p${app.databasePass} -h${app.databaseHost} -P${app.databasePort}" /> | ||
|
||
<!-- --> | ||
<!-- Basic targets --> | ||
<!-- ============= --> | ||
<!-- --> | ||
<!-- Targets --> | ||
<!-- ======= --> | ||
|
||
<!-- Prepare the project --> | ||
<target name="prepare" | ||
description="Prepare for build"> | ||
<exec command="composer install" /> | ||
<exec command="composer install --prefer-dist" | ||
logoutput="${test.output}" | ||
passthru="${test.passthru}" /> | ||
</target> | ||
|
||
<!-- --> | ||
<!-- Custom targets --> | ||
<!-- ============== --> | ||
<!-- Runs a command in the Vagrant host --> | ||
<target name="vagrant:run" | ||
if="drush.cmd" | ||
description="Run a command in the vagrant host."> | ||
<exec command="vagrant ssh -c '${vagrant.cmd}'" | ||
logoutput="${test.output}" | ||
passthru="${test.passthru}" /> | ||
</target> | ||
|
||
<!-- Reinstall the Drupal 8 site. --> | ||
<target name="reinstall" | ||
depends="prepare" | ||
description="Reinstall the Drupal 8 site."> | ||
<property name="app.default_site" value="${project.basedir}/app/sites/default" /> | ||
|
||
<!-- Drop and create the database --> | ||
<exec command="${app.mysql_connect} -e 'DROP DATABASE ${app.database}'" /> | ||
<exec command="${app.mysql_connect} -e 'CREATE DATABASE ${app.database}'" /> | ||
<exec command="${drush.cmd} sql-drop -y" | ||
logoutput="${test.output}" | ||
passthru="${test.passthru}"/> | ||
|
||
<!-- Ensure the files directory is clean --> | ||
<exec command="sudo rm -fR ${app.default_site}/files/*" /> | ||
<exec command="sudo rm -fR ${drupal.dir}/sites/default/files/*" | ||
logoutput="${test.output}" | ||
passthru="${test.passthru}" /> | ||
|
||
<!-- Ensure we have a fresh settings.php with correct permissions --> | ||
<exec command="sudo scp ${app.default_site}/default.settings.php ${app.default_site}/settings.php" /> | ||
<exec command="sudo chmod 777 ${app.default_site}/settings.php" /> | ||
<exec command="sudo scp ${drupal.dir}/sites/default/default.settings.php ${drupal.dir}/sites/default/settings.php" | ||
logoutput="${test.output}" | ||
passthru="${test.passthru}" /> | ||
<exec command="sudo chmod 777 ${drupal.dir}/sites/default/settings.php" | ||
logoutput="${test.output}" | ||
passthru="${test.passthru}" /> | ||
|
||
<!-- Install the site and simpletest module using Mink --> | ||
<!-- Install the site and simpletest --> | ||
<phingcall target="install" /> | ||
<phingcall target="enable:simpletest" /> | ||
<phingcall target="simpletest:enable" /> | ||
</target> | ||
|
||
<!-- Install the Drupal 8 site. --> | ||
<target name="install" | ||
description="Install the Drupal 8 site."> | ||
<phingcall target="vagrant:run"> | ||
<!-- After some properties for inside the Vagrant host. --> | ||
<property name="vagrant.cmd" value="cd ${vagrant.dir}; bin/drush -r ${vagrant.dir}/app site-install -y --db-url=${mysql.queryString} --account-mail=${drupal.email} --account-name=${drupal.user} --account-pass=${drupal.pass} --site-name=${drupal.siteName}" /> | ||
</phingcall> | ||
</target> | ||
|
||
<!-- Enable Simpletest module --> | ||
<target name="simpletest:enable" | ||
description="Enable the Testing module."> | ||
<phingcall target="vagrant:run"> | ||
<!-- After some properties for inside the Vagrant host. --> | ||
<property name="vagrant.cmd" value="cd ${vagrant.dir}; bin/drush -r ${vagrant.dir}/app en -y simpletest" /> | ||
</phingcall> | ||
</target> | ||
|
||
</project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,9 @@ | ||
{ | ||
"repositories": [ | ||
{ | ||
"type":"package", | ||
"package": { | ||
"name": "nickschuch/drupal-install", | ||
"version":"master", | ||
"source": { | ||
"url": "git@github.com:nickschuch/phing-drupal-install.git", | ||
"type": "git", | ||
"reference":"0.0.1" | ||
} | ||
} | ||
} | ||
], | ||
"require": { | ||
"guzzle/http": "3.7.*", | ||
"guzzle/plugin-cookie": "3.7.*", | ||
"zendframework/zend-feed": "2.2.*", | ||
"behat/mink": "1.4@stable", | ||
"behat/mink-goutte-driver": "*", | ||
"nickschuch/drupal-install": "master" | ||
"drush/drush": "dev-master" | ||
}, | ||
"minimum-stability": "dev" | ||
"minimum-stability": "dev", | ||
"config": { | ||
"bin-dir": "bin/" | ||
} | ||
} |
Oops, something went wrong.