Skip to content

Commit

Permalink
Fixes drush-ops#4468: Rename "master" branch to "10.x". (drush-ops#4503)
Browse files Browse the repository at this point in the history
* Fixes drush-ops#4468: Rename "master" branch to "10.x".

* Build Sami API reference from 10.x branch.
  • Loading branch information
greg-1-anderson committed Aug 2, 2020
1 parent e5c4cbd commit 6d7b341
Show file tree
Hide file tree
Showing 36 changed files with 79 additions and 79 deletions.
2 changes: 1 addition & 1 deletion .circleci/config.yml
Expand Up @@ -40,7 +40,7 @@ jobs:
- run: composer cs

# Mergeable test:
# FAIL if merging test branch with master produces conflicts
# FAIL if merging test branch with 10.x produces conflicts
# PASS if the test branch is out of date, but mergeable without conflicts
check_mergable:
<<: *defaults
Expand Down
2 changes: 1 addition & 1 deletion .circleci/mergable.sh
@@ -1,7 +1,7 @@
set -e

# No need to check for mergability on commits that are already merged.
if [ "$CIRCLE_BRANCH" == "master" ] || [ "$CIRCLE_BRANCH" == "9.x" ] ; then
if [ "$CIRCLE_BRANCH" == "10.x" ] || [ "$CIRCLE_BRANCH" == "9.x" ] ; then
exit 0
fi

Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/main.yml
@@ -1,19 +1,19 @@
name: Build static sites

# Controls when the action will run. Triggers the workflow on push or pull request
# events but only for the master branch
# events but only for the 10.x branch
on:
push:
branches: [master]
branches: [10.x]
# pull_request:
# branches: [master]
# branches: [10.x]

jobs:
build:
name: Build and Push
runs-on: ubuntu-latest
steps:
- name: Checkout master
- name: Checkout 10.x
uses: actions/checkout@v2

- name: Checkout gh-pages branch
Expand Down
6 changes: 3 additions & 3 deletions CONTRIBUTING.md
@@ -1,13 +1,13 @@
---
edit_url: https://github.com/drush-ops/drush/blob/master/CONTRIBUTING.md
edit_url: https://github.com/drush-ops/drush/blob/10.x/CONTRIBUTING.md
---
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.
* The latest changes are in the `master` branch. PR's should initially target this branch.
* The latest changes are in the `10.x` branch. PR's should initially target this branch.
* Try to make clean commits that are easily readable (including descriptive commit messages!)
* See the test-specific [README.md](https://github.com/drush-ops/drush/blob/master/tests/README.md) for instructions on running the test suite. Test before you push. Get familiar with Unish, our test suite. Optionally run tests in the provided Docker containers.
* See the test-specific [README.md](https://github.com/drush-ops/drush/blob/10.x/tests/README.md) for instructions on running the test suite. Test before you push. Get familiar with Unish, our test suite. Optionally run tests in the provided Docker containers.
* We maintain branches named 10.x, 9.x, etc. These are release branches. From these branches, we make new tags for patch and minor versions.

## Development Environment
Expand Down
8 changes: 4 additions & 4 deletions README.md
@@ -1,5 +1,5 @@
---
edit_url: https://github.com/drush-ops/drush/blob/master/README.md
edit_url: https://github.com/drush-ops/drush/blob/10.x/README.md
---
Drush is a command line shell and Unix scripting interface for Drupal. Drush core ships with lots of [useful commands](commands/10.x/all.md) 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. Developers love the [generate command](commands/10.x/generate.md), which jump starts your coding project by writing ready-to-customize PHP and YML files. Drush can be extended by [3rd party commandfiles](https://www.drupal.org/project/project_module?f[2]=im_vid_3%3A4654).

Expand All @@ -10,10 +10,10 @@ Resources
* [Installing and Upgrading](install.md) ([Drush 8](https://docs.drush.org/en/8.x/install/))
* [General Documentation](usage.md) ([Drush 8](https://docs.drush.org/en/8.x/install/))
* [Drush Commands](commands/10.x/all.md)
* [API Documentation](/api/master/index.html)
* [API Documentation](/api/10.x/index.html)
* [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 our CI bots.
* Drush comes with a [full test suite](https://github.com/drush-ops/drush/blob/10.x/tests/README.md) powered by [PHPUnit](https://github.com/sebastianbergmann/phpunit). Each commit gets tested by our CI bots.

Support
-----------
Expand All @@ -37,7 +37,7 @@ 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.

#### Does Drush have unit tests?
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.
Drush has an excellent suite of unit tests. See [tests/README.md](https://github.com/drush-ops/drush/blob/10.x/tests/README.md) for more information.


Credits
Expand Down
2 changes: 1 addition & 1 deletion appveyor.yml
Expand Up @@ -4,7 +4,7 @@ platform: 'x86'
clone_folder: C:\projects\work
branches:
only:
- master
- 10.x

## Cache composer bits
cache:
Expand Down
2 changes: 1 addition & 1 deletion docs/bootstrap.md
Expand Up @@ -29,7 +29,7 @@ Set up and test for a valid Drupal root, either through the --root options, or e

@bootstrap site
------------------------------
Set up a Drupal site directory and the correct environment variables to allow Drupal to find the configuration file. If no site is specified with the --uri options, Drush will assume the site is 'default', which mimics Drupal's behaviour. Note that it is necessary to specify a full URI, e.g. --uri=http://example.com, in order for certain Drush commands and Drupal modules to behave correctly. See the [example Config file](https://github.com/drush-ops/drush/blob/master/examples/example.drush.yml) for more information. Any code that needs to modify or interact with a specific Drupal site's settings.php file should bootstrap to this phase.
Set up a Drupal site directory and the correct environment variables to allow Drupal to find the configuration file. If no site is specified with the --uri options, Drush will assume the site is 'default', which mimics Drupal's behaviour. Note that it is necessary to specify a full URI, e.g. --uri=http://example.com, in order for certain Drush commands and Drupal modules to behave correctly. See the [example Config file](https://github.com/drush-ops/drush/blob/10.x/examples/example.drush.yml) for more information. Any code that needs to modify or interact with a specific Drupal site's settings.php file should bootstrap to this phase.

@bootstrap configuration
---------------------------------------
Expand Down
8 changes: 4 additions & 4 deletions docs/commands.md
Expand Up @@ -7,9 +7,9 @@ Creating a new Drush command or porting a legacy command is easy. Follow the ste
1. (optional) Drush will also prompt for the path to a legacy command file to port. See [tips on porting command to Drush 9](https://weitzman.github.io/blog/port-to-drush9)
1. The module selected must already exist and be enabled. Use `drush generate module-standard` to create a new module.
1. Drush will then report that it created a commandfile, a drush.services.yml file and a composer.json file. Edit those files as needed.
1. Use the classes for the core Drush commands at [/src/Drupal/Commands](https://github.com/drush-ops/drush/tree/master/src/Drupal/Commands) as inspiration and documentation.
1. Use the classes for the core Drush commands at [/src/Drupal/Commands](https://github.com/drush-ops/drush/tree/10.x/src/Drupal/Commands) as inspiration and documentation.
1. See the [dependency injection docs](dependency-injection.md) for interfaces you can implement to gain access to Drush config, Drupal site aliases, etc.
1. Write PHPUnit tests based on [Drush Test Traits](https://github.com/drush-ops/drush/tree/master/tests#drush-test-traits).
1. Write PHPUnit tests based on [Drush Test Traits](https://github.com/drush-ops/drush/tree/10.x/tests#drush-test-traits).
1. Once your two files are ready, run `drush cr` to get your command recognized by the Drupal container.

## Specifying the Services File
Expand Down Expand Up @@ -54,7 +54,7 @@ In order to alter an existing command info, follow the steps below:
For an example, see the alterer class provided by the testing 'woot' module: `tests/functional/resources/modules/d8/woot/src/WootCommandInfoAlterer.php`.

## Site-Wide Drush Commands
Commandfiles that are installed in a Drupal site and are not bundled inside a Drupal module are called 'site-wide' commandfiles. Site-wide commands may either be added directly to the Drupal site's repository (e.g. for site-specific policy files), or via `composer require`. See the [examples/Commands](https://github.com/drush-ops/drush/tree/master/examples/Commands) folder for examples. In general, it's better to use modules to carry your Drush commands, as module-based commands may [participate in Drupal's dependency injection via the drush.services.yml](#specifying-the-services-file).
Commandfiles that are installed in a Drupal site and are not bundled inside a Drupal module are called 'site-wide' commandfiles. Site-wide commands may either be added directly to the Drupal site's repository (e.g. for site-specific policy files), or via `composer require`. See the [examples/Commands](https://github.com/drush-ops/drush/tree/10.x/examples/Commands) folder for examples. In general, it's better to use modules to carry your Drush commands, as module-based commands may [participate in Drupal's dependency injection via the drush.services.yml](#specifying-the-services-file).

If you still prefer using site-wide commandfiles, here are some examples of valid commandfile names and namespaces:

Expand Down Expand Up @@ -106,4 +106,4 @@ With this configuration in place, global commands may be placed as described in
It is recommended that you avoid global Drush commands, and favor site-wide commandfiles instead. If you really need a command or commands that are not part of any Drupal site, consider making a stand-alone script or custom .phar instead. See [ahoy](https://github.com/ahoy-cli/ahoy), [Robo](https://github.com/consolidation/robo) and [g1a/starter](https://github.com/g1a/starter) as potential starting points.

!!! warning "Symlinked packages"
While it is good practice to make your custom commands into a Composer package, please beware that symlinked packages (by using the composer repository type [Path](https://getcomposer.org/doc/05-repositories.md#path)) will **not** be discovered by Drush. When in development, it is recommended to [specify your package's](https://github.com/drush-ops/drush/blob/master/examples/example.drush.yml#L52-L67) path in your `drush.yml` to have quick access to your commands.
While it is good practice to make your custom commands into a Composer package, please beware that symlinked packages (by using the composer repository type [Path](https://getcomposer.org/doc/05-repositories.md#path)) will **not** be discovered by Drush. When in development, it is recommended to [specify your package's](https://github.com/drush-ops/drush/blob/10.x/examples/example.drush.yml#L52-L67) path in your `drush.yml` to have quick access to your commands.
4 changes: 2 additions & 2 deletions docs/deploycommand.md
Expand Up @@ -19,9 +19,9 @@ Below are the 3 types of update functions run by this command, in order. Choose
| --- | --- | --- |
| [HOOK_update_n()](https://api.drupal.org/api/drupal/core!lib!Drupal!Core!Extension!module.api.php/function/hook_update_N) | Not allowed | Low level changes. |
| [HOOK_post_update_NAME()](https://api.drupal.org/api/drupal/core!lib!Drupal!Core!Extension!module.api.php/function/hook_post_update_NAME) | Allowed | Runs *before* config is imported. |
| [HOOK_deploy_NAME()](https://github.com/drush-ops/drush/blob/master/tests/functional/resources/modules/d8/woot/woot.deploy.php) | Allowed | Runs *after* config is imported. |
| [HOOK_deploy_NAME()](https://github.com/drush-ops/drush/blob/10.x/tests/functional/resources/modules/d8/woot/woot.deploy.php) | Allowed | Runs *after* config is imported. |

## Configuration

If you need to customize this command, you should use Drush configuration for the
subcommands listed above (e.g. [updatedb](commands/10.x/updatedb.md), [config:import](commands/10.x/config_import.md), etc.).
subcommands listed above (e.g. [updatedb](commands/10.x/updatedb.md), [config:import](commands/10.x/config_import.md), etc.).
4 changes: 2 additions & 2 deletions docs/examples/ArtCommands.php.md
@@ -1,7 +1,7 @@
---
edit_url: https://github.com/drush-ops/drush/blob/master/examples/Commands/ArtCommands.php
edit_url: https://github.com/drush-ops/drush/blob/10.x/examples/Commands/ArtCommands.php
---

```php
--8<-- "examples/Commands/ArtCommands.php"
```
```
4 changes: 2 additions & 2 deletions docs/examples/PolicyCommands.php.md
@@ -1,6 +1,6 @@
---
edit_url: https://github.com/drush-ops/drush/blob/master/examples/Commands/PolicyCommands.php
edit_url: https://github.com/drush-ops/drush/blob/10.x/examples/Commands/PolicyCommands.php
---
```php
--8<-- "examples/Commands/PolicyCommands.php"
```
```
4 changes: 2 additions & 2 deletions docs/examples/SiteAliasAlterCommands.php.md
@@ -1,6 +1,6 @@
---
edit_url: https://github.com/drush-ops/drush/blob/master/examples/Commands/SiteAliasAlterCommands.php
edit_url: https://github.com/drush-ops/drush/blob/10.x/examples/Commands/SiteAliasAlterCommands.php
---
```php
--8<-- "examples/Commands/SiteAliasAlterCommands.php"
```
```
4 changes: 2 additions & 2 deletions docs/examples/SyncViaHttpCommands.php.md
@@ -1,6 +1,6 @@
---
edit_url: https://github.com/drush-ops/drush/blob/master/examples/Commands/SyncViaHttpCommands.php
edit_url: https://github.com/drush-ops/drush/blob/10.x/examples/Commands/SyncViaHttpCommands.php
---
```php
--8<-- "examples/Commands/SyncViaHttpCommands.php"
```
```
4 changes: 2 additions & 2 deletions docs/examples/XkcdCommands.php.md
@@ -1,6 +1,6 @@
---
edit_url: https://github.com/drush-ops/drush/blob/master/examples/Commands/XkcdCommands.php
edit_url: https://github.com/drush-ops/drush/blob/10.x/examples/Commands/XkcdCommands.php
---
```php
--8<-- "examples/Commands/XkcdCommands.php"
```
```
4 changes: 2 additions & 2 deletions docs/examples/example.bashrc.md
@@ -1,6 +1,6 @@
---
edit_url: https://github.com/drush-ops/drush/blob/master/examples/example.bashrc
edit_url: https://github.com/drush-ops/drush/blob/10.x/examples/example.bashrc
---
```shell
--8<-- "examples/example.bashrc"
```
```
4 changes: 2 additions & 2 deletions docs/examples/example.prompt.sh.md
@@ -1,6 +1,6 @@
---
edit_url: https://github.com/drush-ops/drush/blob/master/examples/example.prompt.sh
edit_url: https://github.com/drush-ops/drush/blob/10.x/examples/example.prompt.sh
---
```shell
--8<-- "examples/example.prompt.sh"
```
```
4 changes: 2 additions & 2 deletions docs/examples/example.site.yml.md
@@ -1,6 +1,6 @@
---
edit_url: https://github.com/drush-ops/drush/blob/master/examples/example.site.yml
edit_url: https://github.com/drush-ops/drush/blob/10.x/examples/example.site.yml
---
```yaml
--8<-- "examples/example.site.yml"
```
```
4 changes: 2 additions & 2 deletions docs/examples/git-bisect.example.sh.md
@@ -1,6 +1,6 @@
---
edit_url: https://github.com/drush-ops/drush/blob/master/examples/git-bisect.example.sh
edit_url: https://github.com/drush-ops/drush/blob/10.x/examples/git-bisect.example.sh
---
```shell
--8<-- "examples/git-bisect.example.sh"
```
```
4 changes: 2 additions & 2 deletions docs/examples/helloworld.script.md
@@ -1,6 +1,6 @@
---
edit_url: https://github.com/drush-ops/drush/blob/master/examples/helloworld.script
edit_url: https://github.com/drush-ops/drush/blob/10.x/examples/helloworld.script
---
```php
--8<-- "examples/helloworld.script"
```
```
10 changes: 5 additions & 5 deletions docs/generators.md
@@ -1,16 +1,16 @@
# Overview
Generators jump start your coding by building all the boring boilerplate code for you. After running the [generate command](commands/10.x/generate.md), you have a guide for where to insert your custom logic.

Drush's generators reuse classes provided by the excellent [Drupal Code Generator](https://github.com/Chi-teck/drupal-code-generator) project. See its [Commands directory](https://github.com/Chi-teck/drupal-code-generator/tree/master/src/Command) for inspiration.
Drush's generators reuse classes provided by the excellent [Drupal Code Generator](https://github.com/Chi-teck/drupal-code-generator) project. See its [Commands directory](https://github.com/Chi-teck/drupal-code-generator/tree/10.x/src/Command) for inspiration.

## Writing Custom Generators
Drupal modules may supply their own Generators, just like they can supply Commands.

See [Woot module](https://github.com/drush-ops/drush/blob/master/tests/functional/resources/modules/d8/woot), which Drush uses for testing. Specifically,
See [Woot module](https://github.com/drush-ops/drush/blob/10.x/tests/functional/resources/modules/d8/woot), which Drush uses for testing. Specifically,

1. Write a class similar to [ExampleGenerator](https://github.com/drush-ops/drush/tree/master/tests/functional/resources/modules/d8/woot/src/Generators/). Implement your custom logic in the interact() method. Typically this class is placed in the src/Generators directory.
1. Write a class similar to [ExampleGenerator](https://github.com/drush-ops/drush/tree/10.x/tests/functional/resources/modules/d8/woot/src/Generators/). Implement your custom logic in the interact() method. Typically this class is placed in the src/Generators directory.
1. Add a .twig file to the same directory. This template specifies what gets output from the generator.
1. Add your class to your module's drush.services.yml file ([example](https://github.com/drush-ops/drush/blob/master/tests/functional/resources/modules/d8/woot/drush.services.yml)). Use the tag `drush.generator` instead of `drush.command`.
1. Add your class to your module's drush.services.yml file ([example](https://github.com/drush-ops/drush/blob/10.x/tests/functional/resources/modules/d8/woot/drush.services.yml)). Use the tag `drush.generator` instead of `drush.command`.
1. Perform a `drush cache-rebuild` to compile your drush.services.yml changes into the Drupal container.

## Global Generators
Expand All @@ -23,4 +23,4 @@ Generators that don't ship inside Drupal modules are called *global* generators.
1. The enclosing directory must be named `Generators`
1. The directory above Generators must be one of:
1. A Folder listed in the *--include* option. include may be provided via config or via CLI.
1. `../drush`, `/drush` or `/sites/all/drush`. These paths are relative to Drupal root.
1. `../drush`, `/drush` or `/sites/all/drush`. These paths are relative to Drupal root.
2 changes: 1 addition & 1 deletion docs/hooks.md
Expand Up @@ -6,7 +6,7 @@ All commandfiles may implement methods that are called by Drush at various times

## Custom Hooks

Drush commands can define custom events that other command files can hook. You can find examples in [CacheCommands](https://github.com/drush-ops/drush/blob/master/src/Commands/core/CacheCommands.php) and [SanitizeCommands](https://github.com/drush-ops/drush/blob/master/src/Drupal/Commands/sql/SanitizeCommands.php)
Drush commands can define custom events that other command files can hook. You can find examples in [CacheCommands](https://github.com/drush-ops/drush/blob/10.x/src/Commands/core/CacheCommands.php) and [SanitizeCommands](https://github.com/drush-ops/drush/blob/10.x/src/Drupal/Commands/sql/SanitizeCommands.php)

First, the command must implement CustomEventAwareInterface and use CustomEventAwareTrait, as described in the [dependency injection](dependency-injection.md) documentation.

Expand Down
2 changes: 1 addition & 1 deletion docs/install.md
Expand Up @@ -30,7 +30,7 @@ Drupal Compatibility
</tr>
<tr>
<td> Drush 10 </td>
<td> master </td>
<td> 10.x </td>
<td> 7.1+ </td>
<!-- Released Oct 2019 -->
<td> <i>TBD</i> </td>
Expand Down
4 changes: 2 additions & 2 deletions docs/overrides/main.html
Expand Up @@ -13,7 +13,7 @@
<meta property="og:title" content="{{ title }}" />
<meta property="og:description" content="{{ config.site_description }}" />
<meta property="og:url" content="{{ page.canonical_url }}" />
<meta property="og:image" content="https://raw.githubusercontent.com/drush-ops/drush/master/drush_logo-black.png" />
<meta property="og:image" content="https://raw.githubusercontent.com/drush-ops/drush/10.x/drush_logo-black.png" />
<meta property="og:image:type" content="image/png" />
<meta property="og:image:width" content="218" />
<meta property="og:image:height" content="215" />
Expand All @@ -29,6 +29,6 @@
<meta name="twitter:creator" content="@weitzman" />
<meta name="twitter:title" content="{{ title }}" />
<meta name="twitter:description" content="{{ config.site_description }}" />
<meta name="twitter:image" content="https://raw.githubusercontent.com/drush-ops/drush/master/drush_logo-black.png" />
<meta name="twitter:image" content="https://raw.githubusercontent.com/drush-ops/drush/10.x/drush_logo-black.png" />
{% endblock %}

0 comments on commit 6d7b341

Please sign in to comment.