Skip to content

Instantly share code, notes, and snippets.

@jmolivas
Last active June 10, 2019 22:18
Show Gist options
  • Save jmolivas/4b8f9855f3f2aa4c46e1e7639ab7350a to your computer and use it in GitHub Desktop.
Save jmolivas/4b8f9855f3f2aa4c46e1e7639ab7350a to your computer and use it in GitHub Desktop.
Automate DrupalConsole release process

Automate DrupalConsole release process

This script run the following tasks on multiple repos from the CLI.

  • Creates a new tag.
  • Push new created tag.
  • Create a new release.
  • Build the phar file. (only for drupal-console-launcher)
  • Upload the phar file (only for drupal-console-launcher)

To execute this proces is required to install

drupal version:new --placeholder="directory:/Users/jmolivas/develop/drupal/modules/" --placeholder="version:0.0.1"
command:
name: version:new
description: 'Create new Drupal Console version'
commands:
# Create tag & release drupal-console-extend
- command: exec
arguments:
bin: drupal version:tag:release --placeholder="directory:%{{directory}}/drupal-console-extend" --placeholder="version:%{{version}}" --placeholder="repo:drupal-console-extend"
options:
working-directory: %{{directory}}/drupal-console-extend
# Create tag & release drupal-console-en
- command: exec
arguments:
bin: drupal version:tag:release --placeholder="directory:%{{directory}}/drupal-console-en" --placeholder="version:%{{version}}" --placeholder="repo:drupal-console-en"
options:
working-directory: %{{directory}}/drupal-console-en
# Create tag & release drupal-console-core
- command: exec
arguments:
bin: drupal version:tag:release --placeholder="directory:%{{directory}}/drupal-console-core" --placeholder="version:%{{version}}" --placeholder="repo:drupal-console-core"
options:
working-directory: %{{directory}}/drupal-console-core
# Create tag & release drupal-console
- command: exec
arguments:
bin: drupal version:tag:release --placeholder="directory:%{{directory}}/drupal-console" --placeholder="version:%{{version}}" --placeholder="repo:drupal-console"
options:
working-directory: %{{directory}}/drupal-console
# Create tag & release drupal-console-launcher
- command: exec
arguments:
bin: drupal version:tag:release --placeholder="directory:%{{directory}}/drupal-console-launcher" --placeholder="version:%{{version}}" --placeholder="repo:drupal-console-launcher"
options:
working-directory: %{{directory}}/drupal-console-launcher
# Create drupal.phar
- command: exec
arguments:
bin: box build
options:
working-directory: %{{directory}}/drupal-console-launcher
# Create shasum
- command: exec
arguments:
bin: shasum drupal.phar | awk '{print $1}' > drupal.phar.version
options:
working-directory: %{{directory}}/drupal-console-launcher
# Upload phar
- command: exec
arguments:
bin: github-release upload --user hechoendrupal --repo drupal-console-extend --tag %{{version}} --name "drupal.phar" --file drupal.phar
options:
working-directory: %{{directory}}/drupal-console-launcher
# Upload shasum
- command: exec
arguments:
bin: github-release upload --user hechoendrupal --repo drupal-console-extend --tag %{{version}} --name "drupal.phar.version" --file drupal.phar.version
options:
working-directory: %{{directory}}/drupal-console-launcher
command:
name: version:tag:release
description: 'Create new Drupal Console tag and release'
commands:
# Create tag
- command: exec
arguments:
bin: git tag %{{version}}
options:
working-directory: %{{directory}}
# Push tag
- command: exec
arguments:
bin: git push upstream --tags
options:
working-directory: %{{directory}}
# Create release
- command: exec
arguments:
bin: github-release release --user hechoendrupal --repo %{{repo}} --tag %{{version}} --name "v%{{version}}" --description ""
options:
working-directory: %{{directory}}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment