Skip to content

Commit

Permalink
Adds Drupal Orange.
Browse files Browse the repository at this point in the history
  • Loading branch information
Hubbs committed May 4, 2017
1 parent 2cdca74 commit 5a02366
Show file tree
Hide file tree
Showing 28 changed files with 11,030 additions and 0 deletions.
20 changes: 20 additions & 0 deletions .gitignore
@@ -0,0 +1,20 @@
# Ignore directories generated by Composer
/bin/
/drush/contrib/
/vendor/
/web/core/
/web/modules/contrib/
/web/themes/contrib/
/web/profiles/contrib/

# Ignore Drupal's file directory
/web/sites/*/files/

# Ignore SimpleTest multi-site environment.
/web/sites/simpletest/

# Ignore local settings
web/sites/default/settings.local.php

# Ignore files generated by PhpStorm
/.idea/
39 changes: 39 additions & 0 deletions .travis.yml
@@ -0,0 +1,39 @@
language: php
php:
- 5.5
- 5.6
- 7.0

sudo: false

env:
global:
- SIMPLETEST_DB=sqlite://tmp/site.sqlite
- SIMPLETEST_BASE_URL="http://127.0.0.1:8080"
matrix:
- RELEASE=stable COMPOSER_CHANNEL=stable
- RELEASE=dev COMPOSER_CHANNEL=stable
- RELEASE=stable COMPOSER_CHANNEL=snapshot

before_install:
- echo 'sendmail_path = /bin/true' >> ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/travis.ini
- phpenv config-rm xdebug.ini
- composer --verbose self-update --$COMPOSER_CHANNEL
- composer --version

install:
- composer --verbose install

script:
- if [[ $RELEASE = dev ]]; then composer --verbose require --no-update drupal/core:8.2.x-dev; fi;
- if [[ $RELEASE = dev ]]; then composer --verbose update; fi;
- cd $TRAVIS_BUILD_DIR/web
- ./../bin/drupal --version
- ./../bin/drupal init
- ./../bin/drupal site:install --db-type=sqlite --db-file=sites/default/files/.ht.sqlite --no-interaction
- ./../bin/drupal server 127.0.0.1:8080 &
- sleep 3
# Skip core/tests/Drupal/Tests/ComposerIntegrationTest.php because web/ has no composer.json
# Skip core tests altogether - ./../bin/phpunit -c core --testsuite unit --exclude-group Composer,DependencyInjection,PageCache
# Exit if the install profile didn't default.
- ./../bin/drupal site:status || grep -q "DrupalOrange" || exit 1;
339 changes: 339 additions & 0 deletions LICENSE

Large diffs are not rendered by default.

126 changes: 126 additions & 0 deletions README.md
@@ -0,0 +1,126 @@
# Drupal Orange Project Template

[![Build Status](https://travis-ci.org/AcroMedia/drupalorange-project-template.svg?branch=8.x)](https://travis-ci.org/AcroMedia/drupalorange-project-template)

Use [Composer](https://getcomposer.org/) to get Drupal + Commerce 2.x with all dependencies.

Fork of [drupalcommerce/project-base](https://github.com/drupalcommerce/project-base). Which is based on
[drupal-composer/drupal-project](https://github.com/drupal-composer/drupal-project).

## Usage

First you need to [install composer](https://getcomposer.org/doc/00-intro.md#installation-linux-unix-osx).

> Note: The instructions below refer to the [global composer installation](https://getcomposer.org/doc/00-intro.md#globally).
You might need to replace `composer` with `php composer.phar` (or similar)
for your setup.

After that you can create the project:

```
composer create-project acromedia/drupalorange-project-template some-dir --stability dev --no-interaction
```

Alternatively, you can create the platform.sh version using this command:

```
composer create-project acromedia/drupalorange-project-template:dev-8.x-platformsh some-dir --stability dev --no-interaction
```


Done! Use `composer require ...` to download additional modules and themes:

```
cd some-dir
composer require "drupal/devel:1.x-dev"
```

The `composer create-project` command passes ownership of all files to the
project that is created. You should create a new git repository, and commit
all files not excluded by the .gitignore file.

## What does the template do?

* Drupal is installed in the `web` directory.
* Modules (packages of type `drupal-module`) are placed in `web/modules/contrib/`
* Theme (packages of type `drupal-theme`) are placed in `web/themes/contrib/`
* Profiles (packages of type `drupal-profile`) are placed in `web/profiles/contrib/`
* Creates default writable versions of `settings.php` and `services.yml`.
* Creates the `sites/default/files` directory.
* Latest version of DrupalConsole is installed locally for use at `bin/drupal`.

## Updating Drupal Core

This project will attempt to keep all of your Drupal Core files up-to-date; the
project [drupal-composer/drupal-scaffold](https://github.com/drupal-composer/drupal-scaffold)
is used to ensure that your scaffold files are updated every time drupal/core is
updated. If you customize any of the "scaffolding" files (commonly .htaccess),
you may need to merge conflicts if any of your modified files are updated in a
new release of Drupal core.

Follow the steps below to update your core files.

1. Run `composer update drupal/core --with-dependencies` to update Drupal Core and its dependencies.
1. Run `git diff` to determine if any of the scaffolding files have changed.
Review the files for any changes and restore any customizations to
`.htaccess` or `robots.txt`.
1. Commit everything all together in a single commit, so `web` will remain in
sync with the `core` when checking out branches or running `git bisect`.
1. In the event that there are non-trivial conflicts in step 2, you may wish
to perform these steps on a branch, and use `git merge` to combine the
updated core files with your customized files. This facilitates the use
of a [three-way merge tool such as kdiff3](http://www.gitshah.com/2010/12/how-to-setup-kdiff-as-diff-tool-for-git.html). This setup is not necessary if your changes are simple;
keeping all of your modifications at the beginning or end of the file is a
good strategy to keep merges easy.

## Generate composer.json from existing project

With using [the "Composer Generate" drush extension](https://www.drupal.org/project/composer_generate)
you can now generate a basic `composer.json` file from an existing project. Note
that the generated `composer.json` might differ from this project's file.

## FAQ

### Should I commit the contrib modules I download?

Composer recommends **no**. They provide [argumentation against but also
workarounds if a project decides to do it anyway](https://getcomposer.org/doc/faqs/should-i-commit-the-dependencies-in-my-vendor-directory.md).

### Should I commit the scaffolding files?

The [drupal-scaffold](https://github.com/drupal-composer/drupal-scaffold) plugin can download the scaffold files (like
index.php, update.php, …) to the web/ directory of your project. If you have not customized those files you could choose
to not check them into your version control system (e.g. git). If that is the case for your project it might be
convenient to automatically run the drupal-scaffold plugin after every install or update of your project. You can
achieve that by registering `@drupal-scaffold` as post-install and post-update command in your composer.json:

```json
"scripts": {
"drupal-scaffold": "DrupalComposer\\DrupalScaffold\\Plugin::scaffold",
"post-install-cmd": [
"@drupal-scaffold",
"..."
],
"post-update-cmd": [
"@drupal-scaffold",
"..."
]
},
```
### How can I apply patches to downloaded modules?

If you need to apply patches (depending on the project being modified, a pull
request is often a better solution), you can do so with the
[composer-patches](https://github.com/cweagans/composer-patches) plugin.

To add a patch to drupal module foobar insert the patches section in the extra
section of composer.json:
```json
"extra": {
"patches": {
"drupal/foobar": {
"Patch description": "URL to patch"
}
}
}
```
94 changes: 94 additions & 0 deletions composer.json
@@ -0,0 +1,94 @@
{
"name": "acromedia/drupalorange-project-template",
"description": "AcroMedia's Commerce 2.x project template",
"type": "project",
"license": "GPL-2.0+",
"authors": [
{
"name": "",
"role": ""
}
],
"repositories": {
"drupal": {
"type": "composer",
"url": "https://packages.drupal.org/8"
}
},
"config": {
"bin-dir": "bin"
},
"require": {
"ext-curl": "*",
"composer/installers": "^1.2",
"drupal-composer/drupal-scaffold": "^2.2",
"cweagans/composer-patches": "~1.0",
"drupal/core": "~8.3.0",
"drupal/console": "~1.0",
"drupal/commerce": "2.x-dev",
"drupal/swiftmailer": "1.x-dev",
"drupal/config_inspector": "1.x-dev",
"drupal/entity": "1.x",
"acromedia/drupalorange_profile": "dev-8.x-1.x",
"drupal/menu_block": "^1.4",
"drupal/webform": "5.x-dev",
"drupal/field_group": "1.x-dev"
},
"require-dev": {
"behat/mink": "~1.7",
"behat/mink-goutte-driver": "~1.2",
"jcalderonzumba/gastonjs": "~1.0.2",
"jcalderonzumba/mink-phantomjs-driver": "~0.3.1",
"mikey179/vfsStream": "~1.2",
"phpunit/phpunit": "~4.8",
"symfony/css-selector": "~2.8",
"drupal/devel": "1.x-dev"
},
"conflict": {
"drupal/drupal": "*"
},
"minimum-stability": "dev",
"prefer-stable": true,
"autoload": {
"classmap": [
"scripts/composer/ScriptHandler.php"
]
},
"scripts": {
"drupal-scaffold": "DrupalComposer\\DrupalScaffold\\Plugin::scaffold",
"pre-install-cmd": [
"DrupalProject\\composer\\ScriptHandler::checkComposerVersion"
],
"pre-update-cmd": [
"DrupalProject\\composer\\ScriptHandler::checkComposerVersion"
],
"post-install-cmd": [
"DrupalProject\\composer\\ScriptHandler::createRequiredFiles"
],
"post-update-cmd": [
"DrupalProject\\composer\\ScriptHandler::createRequiredFiles"
]
},
"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"
]
}
}
}

0 comments on commit 5a02366

Please sign in to comment.