Skip to content
This repository was archived by the owner on Mar 5, 2025. It is now read-only.

Commit 3e36560

Browse files
committed
Merge pull request #122 from grasmash/drupalvm-first
Adding local.protocol and local.hostname.
2 parents a18c6bf + d48c277 commit 3e36560

File tree

8 files changed

+24
-13
lines changed

8 files changed

+24
-13
lines changed

.travis.yml

+6
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ cache:
1010
apt: true
1111
directories:
1212
- "$HOME/.composer/cache"
13+
- "$HOME/.console"
1314
- "$HOME/.drush/cache"
1415
- "$HOME/.nvm"
1516
- "vendor"
@@ -39,6 +40,8 @@ before_install:
3940
install:
4041
- composer install
4142
- export PATH=$TRAVIS_BUILD_DIR/vendor/bin:$PATH
43+
# Initialize drupal consile default configuration.
44+
- drupal init
4245

4346
before_script:
4447
# Clear drush release history cache, to pick up new releases.
@@ -49,13 +52,16 @@ before_script:
4952
script:
5053
# Generate a new 'blted' project.
5154
- ./blt.sh configure
55+
# The local.hostname must be set to 127.0.0.1:8888 because we are using drush runserver to run the site on Travis CI.
56+
- drupal yaml:update:value project.yml project.local.hostname '127.0.0.1:8888'
5257
- ./blt.sh create
5358
# Call targets in the new 'blted' project.
5459
- ../blted8/blt.sh ci:build:validate:test -Dcreate_alias=false -Dbehat.run-server=true -Dbehat.launch-phantom=true
5560
# Deploy build artifact.
5661
- ../blted8/blt.sh deploy:artifact:build -Ddeploy.commitMsg="Automated commit by Travis CI for Build ${TRAVIS_BUILD_ID}" -Ddeploy.branch="8.x-build"
5762
# Validate and run 'blt' phpunit tests.
5863
- phpcs --standard=../blted8/vendor/drupal/coder/coder_sniffer/Drupal/ruleset.xml tests
64+
# Run phpunit tests, excluding deploy-push tests.
5965
- phpunit tests/phpunit --exclude-group deploy-push
6066

6167
deploy:

build/phing/build.xml

+4-9
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212

1313
<!-- Load the root project.yml file for this project. -->
1414
<property file="${blt.root}/project.yml" override="true"/>
15+
<!-- Load the core build.yml. -->
16+
<property file="${blt.root}/template/build/core/phing/build.yml" />
1517

1618
<taskdef name="randomString" classname="${blt.root}.vendor.platinumpixs.phing-random-string.src.PlatinumPixs.RandomString.GenerateTask" />
1719

@@ -26,7 +28,6 @@
2628
<target name="clean" description="Removes generated configuration files from BLT directory.">
2729
<delete file="${blt.root}/project.yml" quiet="true"/>
2830
<delete file="${blt.root}/local.settings.php" quiet="true"/>
29-
<delete file="${blt.root}/local.drushrc.php" quiet="true"/>
3031
<delete file="${blt.root}/template/sites/default/settings/local.settings.php" quiet="true"/>
3132
<delete file="${blt.root}/template/tests/behat/local.yml" quiet="true"/>
3233
<delete dir="${blt.root}/template/vendor" quiet="true"/>
@@ -42,18 +43,12 @@
4243
<expandproperties />
4344
</filterchain>
4445
</copy>
45-
<copy file="${blt.root}/template/docroot/sites/default/settings/default.local.settings.php" tofile="${blt.root}/local.settings.php" />
46-
<copy file="${blt.root}/template/docroot/sites/default/default.local.drushrc.php" tofile="${blt.root}/local.drushrc.php">
47-
<filterchain>
48-
<expandproperties />
49-
</filterchain>
50-
</copy>
46+
<copy file="${blt.root}/template/docroot/sites/default/settings/default.local.settings.php" tofile="${blt.root}/local.settings.php"/>
5147

5248
<echo></echo>
5349
<echo>The following files have been generated:</echo>
5450
<echo>${blt.root}/project.yml</echo>
5551
<echo>${blt.root}/local.settings.php</echo>
56-
<echo>${blt.root}/local.drushrc.php</echo>
5752
<echo></echo>
5853
<echo>Modify these files and then run "./blt.sh create" to generate a new project.</echo>
5954
</target>
@@ -103,7 +98,7 @@
10398
<!-- Copy configuration files to new project. -->
10499
<copy file="${blt.root}/project.yml" tofile="${blt.new.dir}/project.yml" overwrite="true" />
105100
<copy file="${blt.root}/local.settings.php" tofile="${blt.new.dir}/docroot/sites/default/settings/local.settings.php" overwrite="true" />
106-
<copy file="${blt.root}/local.drushrc.php" tofile="${blt.new.dir}/docroot/sites/default/local.drushrc.php" overwrite="true">
101+
<copy file="${blt.root}/template/docroot/sites/default/default.local.drushrc.php" tofile="${blt.new.dir}/docroot/sites/default/local.drushrc.php">
107102
<filterchain>
108103
<expandproperties />
109104
</filterchain>

template/build/core/phing/build.yml

+4
Original file line numberDiff line numberDiff line change
@@ -42,3 +42,7 @@ multisite:
4242
reports:
4343
localDir: ${repo.root}/reports
4444
remoteDir: reports
45+
46+
project:
47+
local:
48+
uri: ${project.local.protocol}://${project.local.hostname}

template/build/core/phing/tasks/properties.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,5 +21,5 @@
2121
<phpVariable file="${repo.root}/drush/drushrc.php" variable="options[uri]" outputProperty="local_url" />
2222

2323
<!-- Default drush alias. -->
24-
<property name="drush.alias" value="self" override="false" />
24+
<property name="drush.alias" value="${drush.default_alias}" override="false" />
2525
</project>

template/docroot/sites/default/default.local.drushrc.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@
44
* Local drush configuration for this project.
55
*/
66

7-
$options['uri'] = 'http://127.0.0.1:8888';
7+
$options['uri'] = '${project.local.uri}';

template/project.yml

+6
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,10 @@ project:
1616
- thunder
1717
# These are random strings used to configure the hash salt.
1818
hash_salt: ${project.hash_salt}
19+
# This will be used as the local uri for all developers.
20+
local:
21+
protocol: http
22+
hostname: ${project.machine_name}.localhost
1923

2024
# Configuration settings for new git repository.
2125
git:
@@ -33,6 +37,8 @@ drush:
3337
local: self
3438
# The drush alias against which all ci commands are run.
3539
ci: self
40+
# The default drush alias to be used when no environment is specified.
41+
default_alias: ${drush.aliases.local}
3642

3743
# Hosting environment flags.
3844
# Examples: acsf (Acquia Cloud Site Factory), ac (Acquia Cloud)

template/tests/behat/example.local.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ local:
2626
Behat\MinkExtension:
2727
javascript_session: selenium2
2828
# configure the base url for your site
29-
base_url: ${local_url}
29+
base_url: ${project.local.uri}
3030
# set default command for "Show last response" step.
3131
show_cmd: "open %s"
3232
# ADDITIONAL OPTIONS FOR WEB DRIVERS

template/tests/phpunit/DrushTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ public function testDrushConfig() {
3030
print "Executing \"$command\" in $dir \n";
3131
// If it contains the local URI, we know it is correctly loading
3232
// drushrc.php.
33-
$this->assertContains('http://127.0.0.1:8888', shell_exec($command));
33+
$this->assertContains($this->config['project']['local']['hostname'], shell_exec($command));
3434
}
3535
}
3636

0 commit comments

Comments
 (0)