Last active
October 24, 2016 08:24
-
-
Save nhp/032ff06fa2bff72cb5f7d49f408eb377 to your computer and use it in GitHub Desktop.
Deployer task to create release in jira
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
task('deploy:jira:release', function() { | |
$curl = curl_init(); | |
curl_setopt_array($curl, [ | |
//change this to your data | |
CURLOPT_URL => "https://company-cloud-name.atlassian.net/rest/api/latest/version", | |
CURLOPT_RETURNTRANSFER => 1, | |
CURLOPT_POST => 1, | |
CURLOPT_HTTPHEADER => array('Content-type: application/json'), | |
//change this to your data | |
CURLOPT_USERPWD => 'user:password', | |
CURLOPT_POSTFIELDS => json_encode([ | |
"description" => "Automatic version by deployment", | |
"name" => "Release {{release_name}}", | |
"releaseDate" => date('Y-m-d'), | |
//change this to your data | |
"project" => "DEV", | |
"archived" => false, | |
"released" => true, | |
]) | |
]); | |
curl_exec($curl); | |
curl_close($curl); | |
})->desc('Create new version in JIRA to clean up board') | |
//ensure only one release is created | |
->onlyOn(['WebNode.2']); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment