-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstart_new_release.php
More file actions
32 lines (24 loc) · 1.14 KB
/
start_new_release.php
File metadata and controls
32 lines (24 loc) · 1.14 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
<?php
namespace Deployer;
const VERSION_TYPE_BUILD = 'build';
const VERSION_TYPE_RELEASE = 'release';
task('dev:release:start_new_release', function () {
$version = get('new_version');
/* new release version */
setVersion($version . '-RC');
/* new git branch */
info("create new branch: \"release-$version\"");
runLocally("git checkout -b \"release-$version\"");
commitVersion($version . '-RC');
})
->desc('Start a new release');
function setVersion(string $version): void {
info("set new version: \"{$version}\"");
runLocally("composer config version {$version} --working-dir " . get('composer_path_app'));
runLocally("composer update nothing -q " . get('composer_app_release_options') . " --working-dir " . get('composer_path_app'));
runLocally("composer validate --working-dir " . get('composer_path_app'));
}
function commitVersion(string $version, string $type = VERSION_TYPE_BUILD): void {
info("commit new version: \"{$version}\"");
commit(get('dev_git_message_new_version_' . $type) . " " . $version, [get('composer_path_app') . "/composer.json", get('composer_path_app') . "/composer.lock"]);
}