Skip to content
This repository has been archived by the owner on Dec 21, 2023. It is now read-only.

Commit

Permalink
Merge pull request #27 from BluesparkLabs/include-examples
Browse files Browse the repository at this point in the history
Include examples in main repository
  • Loading branch information
jameswilson authored Jul 30, 2018
2 parents fd7e506 + 98287fe commit ca83989
Show file tree
Hide file tree
Showing 30 changed files with 6,899 additions and 3 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
vendor
75 changes: 75 additions & 0 deletions .spark.example.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
# (Required) Project name. Should be alpha-numeric, spaces are allowed.
name: Spark Example

# (Required) Drupal 8 is currently the only platform spark supports.
platform: drupal8

# Automated testing command options.
test:
init:
- /var/www/html/scripts/behat.sh
exec:
- /opt/drupalextension/bin/behat --config /var/www/html/behat/behat.spark.yml

# (Optional) Command-specific options. See the complete list of commands with:
#
# $ composer run spark
#
command:
drupal:
backup:
options:
# (Optional) The number of days to keep backups on Amazon S3. This
# config may be excluded, as the default and recommended value is
# '15 days' for GDPR compliance. The format of this option should
# be parsable by PHP's `strtotime`.
keep: 15 days

# (Required) The S3 bucket name. Note, this value should be accessible
# with the AWS credentials specified in the current environment's
# `~/.aws/credentials` file or Environment variables. For additional
# information, please refer to:
#
# * http://bit.ly/aws-php-creds
# * http://bit.ly/aws-creds-file
#
bucket: bsp-myproject

# (Optional) The AWS region to connect to. If left blank, the default
# value of 'us-east-1' will be used. For a list of available regions,
# see http://bit.ly/s3-regions.
region: us-east-1

# (Optional) Comma-separated list of database tables whose data should
# be ignored when creating the backup. This will be passed through to
# the `--structure-tables-list` option of `drush sql-dump`. The values
# shown here are the defaults that will be used used internally if this
# option is not provided. Wildcards are supported if the project is
# using at least Drush version 8 on your project.
truncate: cache,cache_*,sessions,watchdog

# (Optional) Comma-separated list of database tables to complete ignore
# when creating the backup. This will be passed through to the
# `--skip-tables-list` option of `drush sql-dump`. The default value is
# the empty string. Wildcards are supported if the project is using
# at least Drush version 8 on your project.
skip: migrate_*

# This is the list of folders and/or files to include when creating
# the backup tarball. Any paths listed here should be relative to
# the project's root directory, from where the tarball will be created.
files:
- web/sites/default/files
- private

# Specific folder/filename patterns to exclude from the tarball.
# These values will be passed directly to the `tar` command's
# `--exclude` option.
exclude:
- css
- js
- styles
- xmlsitemap
- backup_migrate
- ctools
- php
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ The project is at an early stage, some directions are still definitely being sha

## Getting Started — How to Sparkify your Drupal project

Check out the example project: [spark-example-drupal8](https://github.com/BluesparkLabs/spark-example-drupal8).
Check out the [Drupal 8 example project](https://github.com/BluesparkLabs/spark/tree/master/examples/drupal8).

Here are the main steps outlined.

Expand Down Expand Up @@ -49,11 +49,11 @@ Here are the main steps outlined.

**4. Create a file named `.spark.yml` in your project's root.** This will be your project-specific configuration that Spark will use.

To learn about how to write your configuration, please refer to the [spark-example-drupal8 project's `.spark.yml` file](https://github.com/BluesparkLabs/spark-example-drupal8/blob/master/.spark.yml).
To learn about how to write your configuration, please refer to our [`.spark.example.yml` file](https://github.com/BluesparkLabs/spark/blob/master/.spark.example.yml).

### Recommended `composer.json` bits

See the [spark-example-drupal8 project's `composer.json` file](https://github.com/BluesparkLabs/spark-example-drupal8/blob/master/composer.json).
See the [Drupal 8 example project's `composer.json` file](https://github.com/BluesparkLabs/spark/blob/master/examples/drupal8/composer.json).

**1.** Composer by default installs all packages under a directory called `./vendor`. **Use [`composer/installers`](https://packagist.org/packages/composer/installers) to define installation destinations** for Drupal modules, themes etc. Example configuration in `composer.json`:

Expand Down
7 changes: 7 additions & 0 deletions examples/drupal8/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
vendor
web/core
web/modules/contrib
web/themes/contrib
web/profiles/contrib
web/sites/*/files
web/sites/default/settings.local.php
10 changes: 10 additions & 0 deletions examples/drupal8/.spark.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# For a full reference, please see the `.spark.example.yml` file in the repository's root.

name: Spark D8 Example
platform: drupal8

command:
drupal:
backup:
options:
bucket: bsp-spark-example-drupal8
20 changes: 20 additions & 0 deletions examples/drupal8/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Spark ✨ — Drupal 8 Example

[Spark](https://github.com/BluesparkLabs/spark) is a toolkit to develop, test and run Drupal websites. This is an example of a Sparkified Drupal 8 project. Please refer to the *Getting Started* guide in Spark's readme to learn more.

Getting this example site up and running

1. Clone Spark's repository and install packages for this example project:

$ cd examples/drupal8
$ composer install

2. Start Spark's containers:

$ composer run spark containers:start

2. Install Drupal when the database container is ready:

$ composer run spark db:check-ready && composer run spark drupal:install

3. Visit http://localhost:7500 in your brower. (Username and password is *admin/admin*.)
37 changes: 37 additions & 0 deletions examples/drupal8/composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
{
"name": "bluesparklabs/spark-example-drupal8",
"description": "Example Drupal 8 project built with `bluesparklabs/spark`.",
"type": "project",
"autoload": {
"psr-4": {
"BluesparkLabs\\Spark\\": "./vendor/bluesparklabs/spark/src/"
}
},
"require": {
"bluesparklabs/spark": "^0.1.1",
"composer/installers": "^1.5",
"drupal/core": "8.*",
"drupal-composer/drupal-scaffold": "^2.5"
},
"scripts": {
"drupal-scaffold": "DrupalComposer\\DrupalScaffold\\Plugin::scaffold",
"post-install-cmd": "composer run spark drupal:files",
"post-update-cmd": "composer run spark drupal:files",
"spark": "SPARK_WORKDIR=`pwd` robo --ansi --load-from vendor/bluesparklabs/spark"
},
"minimum-stability": "dev",
"prefer-stable": true,
"config": {
"sort-packages": true
},
"extra": {
"installer-paths": {
"web/core": ["type:drupal-core"],
"web/libraries/{$name}": ["type:drupal-library"],
"web/modules/contrib/{$name}": ["type:drupal-module"],
"web/profiles/contrib/{$name}": ["type:drupal-profile"],
"web/themes/contrib/{$name}": ["type:drupal-theme"],
"drush/contrib/{$name}": ["type:drupal-drush"]
}
}
}
Loading

0 comments on commit ca83989

Please sign in to comment.