ReleaseCommands
extends AbstractCommands
in package
Provides commands to generate Toolkit release.
Table of Contents
Properties
- $changelog : string
- The changelog file.
- $releaseBranch : string
- The release branch.
Methods
- getConfigurationFile() : mixed
- Path to YAML configuration file containing command defaults.
- getJson() : array<string|int, mixed>
- Returns the JSON parsed content.
- getWorkingDir() : string
- Returns the current working directory.
- isWebsiteInstalled() : bool
- Check if the website is installed.
- toolkitChangelogWrite() : mixed
- Write the release changelog to the CHANGELOG.md file.
- toolkitPrepareRelease() : mixed
- Prepare a release for Toolkit.
- toolkitUpdateDefaultMockTag() : mixed
- Write the latest tag from toolkit-mock to the Mock class.
- toolkitVersionWrite() : mixed
- Write the specified version string into needed places.
- getBin() : string
- Validate and return the path to given bin.
- getBinPath() : string
- Return the path to given bin.
- getConfigValue() : mixed
- {@inheritdoc}
- getNodeBin() : string
- Validate and return the path to given bin from node packages.
- getNodeBinPath() : string
- Return the path to given bin from node packages.
- isSimulating() : bool
- Check if current command is being executed with option simulate.
- taskExecute() : mixed
- Execute a command.
- taskProcess() : mixed
- Process the file.
- taskReplaceBlock() : mixed
- Replace block in a file.
- getLatestChangelogVersion() : string
- Reads the changelog file and returns the latest version.
- prepareChangelog() : array<string|int, mixed>
- Get the git log and process it.
- prepareChangelogRow() : string
- Prepare the changelog row.
Properties
$changelog
The changelog file.
private
string
$changelog
= 'CHANGELOG.md'
$releaseBranch
The release branch.
private
string
$releaseBranch
= 'release/10.x'
Methods
getConfigurationFile()
Path to YAML configuration file containing command defaults.
public
getConfigurationFile() : mixed
Command classes should implement this method.
getJson()
Returns the JSON parsed content.
public
getJson(string $filename[, mixed $throwException = true ]) : array<string|int, mixed>
Parameters
- $filename : string
- $throwException : mixed = true
Return values
array<string|int, mixed>getWorkingDir()
Returns the current working directory.
public
getWorkingDir() : string
Return values
string —The current working directory.
isWebsiteInstalled()
Check if the website is installed.
public
isWebsiteInstalled() : bool
Return values
booltoolkitChangelogWrite()
Write the release changelog to the CHANGELOG.md file.
public
toolkitChangelogWrite(ConsoleIO $io, string $version[, string $from = '' ][, array<string|int, mixed> $options = ['show-name' => InputOption::VALUE_NONE, 'show-pr' => InputOption::VALUE_NONE, 'full-link' => InputOption::VALUE_NONE] ]) : mixed
Parameters
- $io : ConsoleIO
- $version : string
-
The version to set.
- $from : string = ''
-
The version to set.
- $options : array<string|int, mixed> = ['show-name' => InputOption::VALUE_NONE, 'show-pr' => InputOption::VALUE_NONE, 'full-link' => InputOption::VALUE_NONE]
-
Command options.
Tags
toolkitPrepareRelease()
Prepare a release for Toolkit.
public
toolkitPrepareRelease(string $version) : mixed
Parameters
- $version : string
-
The version to set.
Tags
toolkitUpdateDefaultMockTag()
Write the latest tag from toolkit-mock to the Mock class.
public
toolkitUpdateDefaultMockTag(ConsoleIO $io) : mixed
Parameters
- $io : ConsoleIO
Tags
toolkitVersionWrite()
Write the specified version string into needed places.
public
toolkitVersionWrite(ConsoleIO $io, string $version) : mixed
Parameters
- $io : ConsoleIO
- $version : string
-
The version to set.
Tags
getBin()
Validate and return the path to given bin.
protected
getBin(string $name) : string
Parameters
- $name : string
-
The bin to look for.
Tags
Return values
string —The bin path.
getBinPath()
Return the path to given bin.
protected
getBinPath(string $name) : string
Parameters
- $name : string
Return values
string —The path to given binary.
getConfigValue()
{@inheritdoc}
protected
getConfigValue(mixed $key[, mixed $default = null ]) : mixed
Parameters
- $key : mixed
- $default : mixed = null
getNodeBin()
Validate and return the path to given bin from node packages.
protected
getNodeBin(string $name) : string
Parameters
- $name : string
-
The bin to look for.
Tags
Return values
string —The bin path.
getNodeBinPath()
Return the path to given bin from node packages.
protected
getNodeBinPath(string $name) : string
Parameters
- $name : string
Return values
string —The path to given binary.
isSimulating()
Check if current command is being executed with option simulate.
protected
isSimulating() : bool
Return values
bool —True if using --simulate, false otherwise.
taskExecute()
Execute a command.
protected
taskExecute(array<string|int, mixed> $tasks) : mixed
Parameters
- $tasks : array<string|int, mixed>
-
An array with tasks to execute.
taskProcess()
Process the file.
protected
taskProcess(string $source[, string $destination = '' ]) : mixed
Parameters
- $source : string
-
The source file to process.
- $destination : string = ''
-
The destination file.
taskReplaceBlock()
Replace block in a file.
protected
taskReplaceBlock([string $filename = '' ]) : mixed
Parameters
- $filename : string = ''
-
The file to process.
getLatestChangelogVersion()
Reads the changelog file and returns the latest version.
private
getLatestChangelogVersion() : string
Return values
string —The latest version or empty string if not found.
prepareChangelog()
Get the git log and process it.
private
prepareChangelog(string $from, array<string|int, mixed> $options) : array<string|int, mixed>
Parameters
- $from : string
-
The row to process.
- $options : array<string|int, mixed>
-
The command options.
Return values
array<string|int, mixed> —An array containing the changelog.
prepareChangelogRow()
Prepare the changelog row.
private
prepareChangelogRow(array<string|int, mixed> $data, array<string|int, mixed> $options) : string
Parameters
- $data : array<string|int, mixed>
-
The row to process.
- $options : array<string|int, mixed>
-
The command options.
Return values
string —The prepared row.