Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes #506: Include config in deploy artifact. #511

Merged
merged 2 commits into from
Oct 7, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion phing/tasks/deploy.xml
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,6 @@
<property name="hook-name" value="post-deploy-build"/>
</phingcall>

<available property="simplesamlphp" file="${blt.root}/settings/simplesamlphp.settings.php"/>
<if>
<equals arg1="${simplesamlphp}" arg2="true"/>
<then>
Expand Down
1 change: 0 additions & 1 deletion phing/tasks/setup.xml
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@
<target name="setup:build" description="Generates all required files for a full build. E.g., (re)builds docroot, etc."
depends="setup:git-hooks, setup:drupal:settings, setup:behat, setup:composer:install, frontend">

<available property="simplesamlphp" file="${blt.root}/settings/simplesamlphp.settings.php"/>
<if>
<equals arg1="${simplesamlphp}" arg2="true"/>
<then>
Expand Down
28 changes: 11 additions & 17 deletions phing/tasks/simplesamlphp.xml
Original file line number Diff line number Diff line change
@@ -1,42 +1,41 @@
<project name="simplesamlphp" default="simplesamlphp:init">

<target name="simplesamlphp:init" description="Initializes SimpleSAMLphp for project.">

<!-- Adds simplesamlphp_auth as a dependency. -->
<available property="simplesamlphp" file="${blt.root}/settings/simplesamlphp.settings.php"/>

<if>
<not><equals arg1="${simplesamlphp}" arg2="true"/></not>
<then>

<!-- Adds simplesamlphp_auth as a dependency. -->
<phingcall target="simplesamlphp:lib:init"/>

<!-- Copies the configuration templates from the library to a simplesamlphp directory located in the project root. -->
<phingcall target="simplesamlphp:config:init"/>

<!-- Copies a settings file used by the simplesamlphp_auth module to blt's settings dir. -->
<phingcall target="simplesamlphp:settings"/>
<!-- Sets a value in project.yml to let other targets know simplesamlphp is installed -->
<echo>Updating project.yml.</echo>
<exec dir="${repo.root}" command="drupal yaml:update:value project.yml simplesamlphp true" logoutput="true" checkreturn="true" passthru="true" level="info"/>

<!-- Creates a symlink from the docroot to the web accessible library dir. -->
<echo>Creating a symbolic link from ${docroot}/simplesaml to web accessible directory in the simplesamlphp library</echo>
<symlink target="../vendor/simplesamlphp/simplesamlphp/www/" link="${docroot}/simplesaml" overwrite="true" />

<!-- Outputs a message to edit the new config files. -->
<phingcall target="simplesamlphp:init:complete"/>
</then>
<else>
<echo>SimpleSAMLphp has already been initialized by BLT.</echo>
</else>
</if>
<!-- Outputs a message to edit the new config files. -->
<phingcall target="simplesamlphp:init:complete"/>
</target>

<!-- Adds simplesamlphp_auth as a dependency. -->
<target name="simplesamlphp:lib:init" hidden="true">
<target name="simplesamlphp:lib:init" hidden="true" unless="simplesamlphp">
<echo>Adding SimpleSAMLphp Auth module as a dependency.</echo>
<exec dir="${repo.root}" command="composer require drupal/simplesamlphp_auth:8.3.x-dev#283994f" logoutput="true" checkreturn="true" passthru="true" level="info"/>
</target>

<!-- Copies the configuration templates from the library to a simplesamlphp directory located in the project root. -->
<target name="simplesamlphp:config:init" hidden="true">
<target name="simplesamlphp:config:init" hidden="true" unless="simplesamlphp">
<echo>Copying config files to ${repo.root}/simplesamlphp/config.</echo>
<copy todir="${repo.root}/simplesamlphp/config" overwrite="false">
<filelist dir="${repo.root}/vendor/simplesamlphp/simplesamlphp/config-templates" files="authsources.php, config.php"/>
Expand All @@ -53,12 +52,6 @@
<copy todir="${repo.root}/simplesamlphp/metadata" file="${repo.root}/vendor/simplesamlphp/simplesamlphp/metadata-templates/saml20-idp-remote.php" overwrite="false"/>
</target>

<!-- Copies a settings file used by simplesamlphp_auth to blt settings dir. -->
<target name="simplesamlphp:settings" hidden="true">
<echo>Adding a simplesamlphp.settings.php file.</echo>
<copy file="${blt.root}/scripts/simplesamlphp/simplesamlphp.settings.php" tofile="${blt.root}/settings/simplesamlphp.settings.php" overwrite="false"/>
</target>

<!-- Copies customized config files into the library on deployments. -->
<target name="simplesamlphp:deploy:config" description="Copies config template files to the appropriate place in simplesamlphp library." hidden="true">
<echo>Copying config files to the appropriate place in simplesamlphp library in the deploy artifact.</echo>
Expand Down Expand Up @@ -98,7 +91,8 @@
'blt simplesamlphp:build:config'

============================================================================
See simplesamlphp-setup.md for details on how to modify the files.
See http://blt.readthedocs.io/en/latest/readme/simplesamlphp-setup/
for details on how to modify the files.
============================================================================


Expand Down
2 changes: 1 addition & 1 deletion src/Drush/Command/BltDoctorCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ protected function setCiEnabled() {
* Sets SimpleSAMLphp enabled status.
*/
protected function setSimpleSamlPhpEnabled() {
if (file_exists($this->repoRoot . '/vendor/acquia/blt/settings/simplesamlphp.settings.php')) {
if ($this->config['simplesamlphp']) {
$this->SimpleSamlPhpEnabled = TRUE;
}
}
Expand Down