Skip to content

Commit

Permalink
Issue backdrop-ops#6: Add drush local support so Pantheon users, dash…
Browse files Browse the repository at this point in the history
…board, and terminus, can run drush commands.
  • Loading branch information
Jen Lampton committed Jun 18, 2020
1 parent a30e924 commit d885f4a
Show file tree
Hide file tree
Showing 2,758 changed files with 291,799 additions and 0 deletions.
152 changes: 152 additions & 0 deletions drush/drush/.travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,152 @@
# Configuration file for unit test runner at http://travis-ci.org/#!/drush-ops/drush
branches:
only:
- master
- 8.x
- 7.x
- 6.x
- 5.x
- /^[[:digit:]]+\.[[:digit:]]+\.[[:digit:]]+.*$/
language: php
php:
# See master-fulltest branch for broader PHP version testing.
- 5.4
- 7.0

# Cache Composer & Unish directories.
cache:
directories:
- $HOME/.composer/cache
- /tmp/unish

# http://blog.travis-ci.com/2014-12-17-faster-builds-with-container-based-infrastructure/
sudo: false

env:
matrix:
#D6
- UNISH_DRUPAL_MAJOR_VERSION=6 PHPUNIT_ARGS=--group=base
- UNISH_DRUPAL_MAJOR_VERSION=6 PHPUNIT_ARGS=--group=commands
- UNISH_DRUPAL_MAJOR_VERSION=6 PHPUNIT_ARGS=--group=pm
- UNISH_DRUPAL_MAJOR_VERSION=6 PHPUNIT_ARGS=--exclude-group=base,make,commands,pm,quick-drupal
#D7
- UNISH_DRUPAL_MAJOR_VERSION=7 PHPUNIT_ARGS=--group=make
- UNISH_DRUPAL_MAJOR_VERSION=7 PHPUNIT_ARGS=--group=base
- UNISH_DRUPAL_MAJOR_VERSION=7 PHPUNIT_ARGS=--group=commands
- UNISH_DRUPAL_MAJOR_VERSION=7 PHPUNIT_ARGS=--group=pm
- UNISH_DRUPAL_MAJOR_VERSION=7 PHPUNIT_ARGS=--group=quick-drupal
- UNISH_DRUPAL_MAJOR_VERSION=7 PHPUNIT_ARGS=--exclude-group=base,make,commands,pm,quick-drupal
#D8
- UNISH_DRUPAL_MAJOR_VERSION=8 PHPUNIT_ARGS=--group=make
- UNISH_DRUPAL_MAJOR_VERSION=8 PHPUNIT_ARGS=--group=base
- UNISH_DRUPAL_MAJOR_VERSION=8 PHPUNIT_ARGS=--group=commands
- UNISH_DRUPAL_MAJOR_VERSION=8 PHPUNIT_ARGS=--group=pm
- UNISH_DRUPAL_MAJOR_VERSION=8 PHPUNIT_ARGS=--group=quick-drupal
- UNISH_DRUPAL_MAJOR_VERSION=8 PHPUNIT_ARGS=--exclude-group=base,make,commands,pm,quick-drupal TEST_CHILDREN="drush-ops/config-extra"

# - UNISH_DB_URL=sqlite://none/of/this/matters PHPUNIT_ARGS=--group=make
# - UNISH_DB_URL=sqlite://none/of/this/matters PHPUNIT_ARGS=--group=base
# - UNISH_DB_URL=sqlite://none/of/this/matters PHPUNIT_ARGS=--group=commands
# - UNISH_DB_URL=sqlite://none/of/this/matters PHPUNIT_ARGS=--group=pm
# - UNISH_DB_URL=sqlite://none/of/this/matters PHPUNIT_ARGS=--group=quick-drupal
# - UNISH_DB_URL=sqlite://none/of/this/matters PHPUNIT_ARGS=--exclude-group=base,make,commands,pm,quick-drupal
# - UNISH_DB_URL=pgsql://postgres:@localhost PHPUNIT_ARGS=--group=make
# - UNISH_DB_URL=pgsql://postgres:@localhost PHPUNIT_ARGS=--group=base
# - UNISH_DB_URL=pgsql://postgres:@localhost PHPUNIT_ARGS=--group=commands
# - UNISH_DB_URL=pgsql://postgres:@localhost PHPUNIT_ARGS=--group=pm
# - UNISH_DB_URL=pgsql://postgres:@localhost PHPUNIT_ARGS=--group=quick-drupal
# - UNISH_DB_URL=pgsql://postgres:@localhost PHPUNIT_ARGS=--exclude-group=base,make,commands,pm,quick-drupal
global:
# Github deploy
- secure: VfYokT2CchfuBRJp9/gSwfVGPfsVfkZdDVEuNWEqxww3z4vq+5aLKqoCtPL54E5EIMjhyCE3GVo+biG35Gab1KOVgUs8zD1hAUWA1FPKfMFhoPDfI3ZJC2rX2T1iWK4ZR90pBtcPzS+2OObzTYz8go0PfeSTT6eq69Na1KcNLaE=
- UNISH_NO_TIMEOUTS=y
- UNISH_DB_URL=mysql://root:@127.0.0.1

matrix:
exclude:
# Drupal 6 does not work with php 7, so skip all of the Drupal 6 tests with this php.
- php: 7.0
env: UNISH_DRUPAL_MAJOR_VERSION=6 PHPUNIT_ARGS=--group=base
- php: 7.0
env: UNISH_DRUPAL_MAJOR_VERSION=6 PHPUNIT_ARGS=--group=commands
- php: 7.0
env: UNISH_DRUPAL_MAJOR_VERSION=6 PHPUNIT_ARGS=--group=pm
- php: 7.0
env: UNISH_DRUPAL_MAJOR_VERSION=6 PHPUNIT_ARGS=--exclude-group=base,make,commands,pm,quick-drupal
# Drupal 8 requires a minimum php of 5.5, so skip all of the Drupal 8 tests with this php.
- php: 5.4
env: UNISH_DRUPAL_MAJOR_VERSION=8 PHPUNIT_ARGS=--group=make
- php: 5.4
env: UNISH_DRUPAL_MAJOR_VERSION=8 PHPUNIT_ARGS=--group=base
- php: 5.4
env: UNISH_DRUPAL_MAJOR_VERSION=8 PHPUNIT_ARGS=--group=commands
- php: 5.4
env: UNISH_DRUPAL_MAJOR_VERSION=8 PHPUNIT_ARGS=--group=pm
- php: 5.4
env: UNISH_DRUPAL_MAJOR_VERSION=8 PHPUNIT_ARGS=--group=quick-drupal
- php: 5.4
env: UNISH_DRUPAL_MAJOR_VERSION=8 PHPUNIT_ARGS=--exclude-group=base,make,commands,pm,quick-drupal TEST_CHILDREN="drush-ops/config-extra"

before_install:
- echo 'mbstring.http_input = pass' >> ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/travis.ini
- echo 'mbstring.http_output = pass' >> ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/travis.ini
- travis_retry composer selfupdate

install: travis_retry composer install --no-interaction

before_script:
- phpenv config-rm xdebug.ini
- echo 'sendmail_path = /bin/true' >> ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/travis.ini
# - echo "sendmail_path='true'" >> `php --ini | grep "Loaded Configuration" | awk '{print $4}'`
- export UNISH_DRUSH="${PWD}/drush"

script: ${PWD}/unish.sh $PHPUNIT_ARGS

# Background: https://github.com/drush-ops/drush/pull/1426
after_success: ${PWD}/tests/testChildren.sh

before_deploy:
- gem install mime-types -v 2.6.2 # https://github.com/travis-ci/travis-ci/issues/5145
- curl -LSs https://box-project.github.io/box2/installer.php | php
- php box.phar build
- test $TRAVIS_TAG=true && mkdir s3-stable && cp drush.phar s3-stable/drush.phar
- test $TRAVIS_BRANCH=master && mkdir s3-unstable && cp drush.phar s3-unstable/drush-unstable.phar
deploy:
# http://docs.travis-ci.com/user/deployment/releases/
- provider: releases
api_key:
secure: vRtKwJNzm+FXS5VCsaCu5YM4IS02tAdqV4G557HEyVzNgRmSgPWkaHDR/95TnXtZRjmxuTI++rccEj9+jzjknQ9LWkWhl13WiJdZYobnb240f9Ja8g0gs6/r+EEZG2+DTTerK9zicpf51h5hUaE46zObHjSmzIuGxZBO1syDld8=
file: drush.phar
on:
tags: true
repo: drush-ops/drush
all_branches: true
# Latest unstable from master
# http://docs.travis-ci.com/user/deployment/s3/
- provider: s3
# @weitzman's S3 for now.
access_key_id: "AKIAJFNCWLIBISLQYHPA"
secret_access_key:
secure: X9qpkhXxTsIcvO/sp0iBXnHKuZm27KJLsHhimDW2uviS+vt62reCeKl+JtGZUGEJWI6fITbyzJ71vy8+Iibpa261ShYVFJWtiG2cfHKPHsu9TdjSi/f0CW7bEA4IHwnLwxhTUH4wMCjIorKkf21UIH6dCb8qo9xexPb65eDfocs=
bucket: files.drush.org
skip_cleanup: true
local_dir: s3-unstable
detect_encoding: true
on:
repo: drush-ops/drush
branch: master
# Latest stable
# http://docs.travis-ci.com/user/deployment/s3/
- provider: s3
# @weitzman's S3 for now.
access_key_id: "AKIAJFNCWLIBISLQYHPA"
secret_access_key:
secure: X9qpkhXxTsIcvO/sp0iBXnHKuZm27KJLsHhimDW2uviS+vt62reCeKl+JtGZUGEJWI6fITbyzJ71vy8+Iibpa261ShYVFJWtiG2cfHKPHsu9TdjSi/f0CW7bEA4IHwnLwxhTUH4wMCjIorKkf21UIH6dCb8qo9xexPb65eDfocs=
bucket: "files.drush.org"
skip_cleanup: true
local_dir: s3-stable
detect_encoding: true
on:
tags: true
repo: drush-ops/drush
branch: master
22 changes: 22 additions & 0 deletions drush/drush/CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
Drush is built by people like you! Please [join us](https://github.com/drush-ops/drush).

## Git and Pull requests
* Contributions are submitted, reviewed, and accepted using Github pull requests. [Read this article](https://help.github.com/articles/using-pull-requests) for some details. We use the _Fork and Pull_ model, as described there.
* To help keep track of [your assigned issues](https://github.com/dashboard/issues/assigned), simply open an issue to be added as an [Outside Collaborator](https://github.com/orgs/drush-ops/outside-collaborators). A maintainer can now assign any issue to you at your request.
* The latest changes are in the `master` branch.
* Make a new branch for every feature you're working on.
* Try to make clean commits that are easily readable (including descriptive commit messages!)
* Test before you push. Get familiar with Unish, our test suite. See the test-specific [README.md](tests/README.md)
* Make small pull requests that are easy to review but make sure they do add value by themselves.
* We maintain branches named 7.x, 6.x, etc. These are release branches. From these branches, we make new tags for patch and minor versions.

## Coding style
* Do write comments. You don't have to comment every line, but if you come up with something thats a bit complex/weird, just leave a comment. Bear in mind that you will probably leave the project at some point and that other people will read your code. Undocumented huge amounts of code are nearly worthless!
* We use [Drupal's coding standards](https://drupal.org/coding-standards).
* Don't overengineer. Don't try to solve any possible problem in one step, but try to solve problems as easy as possible and improve the solution over time!
* Do generalize sooner or later! (if an old solution, quickly hacked together, poses more problems than it solves today, refactor it!)
* Keep it compatible. Do not introduce changes to the public API, or configurations too lightly. Don't make incompatible changes without good reasons!

## Documentation
* The docs are in the [docs](docs) and [examples](examples) folders in the git repository, so people can easily find the suitable docs for the current git revision. You can read these from within Drush, with the `drush topic` command.
* Documentation should be kept up-to-date. This means, whenever you add a new API method, add a new hook or change the database model, pack the relevant changes to the docs in the same pull request.
46 changes: 46 additions & 0 deletions drush/drush/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
Drush is a command line shell and Unix scripting interface for Drupal. Drush core ships with lots of useful commands for interacting with code like modules/themes/profiles. Similarly, it runs update.php, executes sql queries and DB migrations, and misc utilities like run cron or clear cache. Drush can be extended by [3rd party commandfiles](https://www.drupal.org/project/project_module?f[2]=im_vid_3%3A4654).

[![Latest Stable Version](https://poser.pugx.org/drush/drush/v/stable.png)](https://packagist.org/packages/drush/drush) [![Total Downloads](https://poser.pugx.org/drush/drush/downloads.png)](https://packagist.org/packages/drush/drush) [![Latest Unstable Version](https://poser.pugx.org/drush/drush/v/unstable.png)](https://packagist.org/packages/drush/drush) [![License](https://poser.pugx.org/drush/drush/license.png)](https://packagist.org/packages/drush/drush)[![Documentation Status](https://readthedocs.org/projects/drush/badge/?version=master)](https://readthedocs.org/projects/drush/?badge=master)

Resources
-----------
* [Installing (and Upgrading)](http://docs.drush.org/en/master/install/)
* [General Documentation](http://docs.drush.org)
* [API Documentation](http://api.drush.org)
* [Drush Commands](http://drushcommands.com)
* Subscribe [this atom feed](https://github.com/drush-ops/drush/releases.atom) to receive notification on new releases. Also, [Version eye](https://www.versioneye.com/).
* [Drush packages available via Composer](https://packagist.org/search/?type=drupal-drush)
* [A list of modules that include Drush integration](https://www.drupal.org/project/project_module?f[2]=im_vid_3%3A4654&solrsort=ds_project_latest_release+desc)
* Drush comes with a [full test suite](https://github.com/drush-ops/drush/blob/master/tests/README.md) powered by [PHPUnit](https://github.com/sebastianbergmann/phpunit). Each commit gets tested by the awesome [Travis.ci continuous integration service](https://travis-ci.org/drush-ops/drush).

Support
-----------
* Post support requests to [Drupal Answers](http://drupal.stackexchange.com/questions/tagged/drush).
* Report bugs and request features in the [GitHub Drush Issue Queue](https://github.com/drush-ops/drush/issues).
* Use pull requests (PRs) to contribute to Drush.

FAQ
------

> Q: What does "drush" stand for?<br>
> A: The Drupal Shell.
>
> Q: How do I pronounce Drush?<br>
> A: Some people pronounce the *dru* with a long 'u' like Dr*u*pal. Fidelity points
> go to them, but they are in the minority. Most pronounce Drush so that it
> rhymes with hush, rush, flush, etc. This is the preferred pronunciation.
>
> Q: Does Drush have unit tests?<br>
> A: Drush has an excellent suite of unit tests. See
> [tests/README.md](https://github.com/drush-ops/drush/blob/master/tests/README.md) for more information.

Credits
-----------

* Originally developed by [Arto Bendiken](http://bendiken.net) for Drupal 4.7.
* Redesigned by [Franz Heinzmann](http://unbiskant.org) in May 2007 for Drupal 5.
* Maintained by [Moshe Weitzman](http://drupal.org/moshe) with much help from
the folks listed at https://github.com/orgs/drush-ops/people.

![Drush Logo](drush_logo-black.png)
88 changes: 88 additions & 0 deletions drush/drush/appveyor.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
build: false
shallow_clone: true
platform: 'x86'
clone_folder: C:\projects\drush
matrix:
allow_failures:
# Don't record a failure until we have a passing test suite.
- UNISH_NO_TIMEOUTS: y
branches:
only:
- master
- 8.x

init:
#https://github.com/composer/composer/blob/master/appveyor.yml
#- SET ANSICON=121x90 (121x90)

# Inspired by https://github.com/Codeception/base/blob/master/appveyor.yml and https://github.com/phpmd/phpmd/blob/master/appveyor.yml
install:
- cinst -y curl
- SET PATH=C:\Program Files\curl;%PATH%
#which is only needed by the test suite.
- cinst -y which
- SET PATH=C:\Program Files\which;%PATH%
- git clone -q https://github.com/acquia/DevDesktopCommon.git #For tar, cksum, ...
- SET PATH=%APPVEYOR_BUILD_FOLDER%/DevDesktopCommon/bintools-win/msys/bin;%PATH%
- SET PATH=C:\Program Files\MySql\MySQL Server 5.7\bin\;%PATH%
#Install PHP
- cinst -y php
- cd c:\tools\php
- copy php.ini-production php.ini

- echo extension_dir=ext >> php.ini
- echo extension=php_openssl.dll >> php.ini
- echo date.timezone="UTC" >> php.ini
- echo variables_order="EGPCS" >> php.ini #Debugging related to https://github.com/drush-ops/drush/pull/646. May be unneeded.
- echo mbstring.http_input=pass >> php.ini
- echo mbstring.http_output=pass >> php.ini
- echo sendmail_path=nul >> php.ini
- echo extension=php_mbstring.dll >> php.ini
- echo extension=php_curl.dll >> php.ini
- echo extension=php_pdo_mysql.dll >> php.ini
- echo extension=php_pdo_pgsql.dll >> php.ini
- echo extension=php_pdo_sqlite.dll >> php.ini
- echo extension=php_pgsql.dll >> php.ini
- echo extension=php_gd2.dll >> php.ini
- SET PATH=C:\tools\php;%PATH%
#Install Composer
- cd %APPVEYOR_BUILD_FOLDER%
#- appveyor DownloadFile https://getcomposer.org/composer.phar
- php -r "readfile('http://getcomposer.org/installer');" | php
#Install Drush's dependencies via Composer
- php composer.phar -q install --prefer-dist -n
- SET PATH=%APPVEYOR_BUILD_FOLDER%;%APPVEYOR_BUILD_FOLDER%/vendor/bin;%PATH%
#Create a sandbox for testing.
- mkdir c:\drush_temp

services:
- mysql

test_script:
- phpunit --configuration tests %PHPUNIT_ARGS%

# environment variables
environment:
global:
UNISH_NO_TIMEOUTS: y
UNISH_DB_URL: "mysql://root:Password12!@localhost"
UNISH_TMP: c:\drush_temp

matrix:
- UNISH_DRUPAL_MAJOR_VERSION: 7
PHPUNIT_ARGS: --group=base

- UNISH_DRUPAL_MAJOR_VERSION: 7
PHPUNIT_ARGS: --group=commands

- UNISH_DRUPAL_MAJOR_VERSION: 7
PHPUNIT_ARGS: --group=pm

- UNISH_DRUPAL_MAJOR_VERSION: 7
PHPUNIT_ARGS: --group=quick-drupal

- UNISH_DRUPAL_MAJOR_VERSION: 7
PHPUNIT_ARGS: --exclude-group=base,make,commands,pm,quick-drupal

- UNISH_DRUPAL_MAJOR_VERSION: 7
PHPUNIT_ARGS: --group=make
26 changes: 26 additions & 0 deletions drush/drush/box.json.dist
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"alias": "drush.phar",
"chmod": "0755",
"compactors": [],
"directories": ["commands", "docs", "examples", "includes", "lib", "misc"],
"files": ["drush.api.php", "drush.complete.sh", "drush.info", "drush.launcher", "drush.php", "drush_logo-black.png", "README.md"],
"finder": [
{
"name": "*.php",
"exclude": [
"phing",
"test",
"tests",
"Test",
"Tests",
"Tester"
],
"in": "vendor"
}
],
"git-commit": "git-commit",
"git-version": "git-version",
"output": "drush.phar",
"main": "drush",
"stub": true
}
Loading

0 comments on commit d885f4a

Please sign in to comment.