renamed environment to target
This commit is contained in:
parent
bfec51aee2
commit
c8467208ac
@ -22,7 +22,7 @@ drone:
|
||||
owner: <the owner of the git repository>
|
||||
project: <the git project>
|
||||
branch: <the branch in your git repository for the deployment>
|
||||
environment: <the environment used in your drone pipeline>
|
||||
target: <the target condition used in your drone pipeline>
|
||||
build: <the build number used as base for deployment> # leave empty and the addon will use the latest successfull build based on a push event
|
||||
|
||||
```
|
||||
@ -51,7 +51,7 @@ steps:
|
||||
- echo Hello World
|
||||
when:
|
||||
event: [ promote ]
|
||||
environment: [ website ]
|
||||
target: [ website ]
|
||||
```
|
||||
|
||||
- **config.yml** in your Cockpit config folder for an example project *myorganization/myproject*
|
||||
@ -64,7 +64,7 @@ drone:
|
||||
owner: myorganization
|
||||
project: myproject
|
||||
branch: master
|
||||
environment: website
|
||||
target: website
|
||||
token: XXXXXXXXXXXXXXXXXXXXX
|
||||
|
||||
```
|
||||
|
@ -15,7 +15,7 @@ if (COCKPIT_ADMIN && !COCKPIT_API_REQUEST) {
|
||||
if (!$settings || !isset($settings['url'],
|
||||
$settings['owner'],
|
||||
$settings['project'],
|
||||
$settings['environment'],
|
||||
$settings['target'],
|
||||
$settings['token'])) {
|
||||
return [];
|
||||
}
|
||||
@ -45,7 +45,7 @@ if (COCKPIT_ADMIN && !COCKPIT_API_REQUEST) {
|
||||
$build = $settings['build'];
|
||||
if ($unfiltered_deploys && is_array($unfiltered_deploys)) {
|
||||
foreach($unfiltered_deploys as $deploy) {
|
||||
if ($deploy->{target} == $branch && ($deploy->event == 'push' || ($deploy->event == 'promote' && $deploy->deploy_to == $settings['environment']))) {
|
||||
if ($deploy->{target} == $branch && ($deploy->event == 'push' || ($deploy->event == 'promote' && $deploy->deploy_to == $settings['target']))) {
|
||||
// find latest successful build
|
||||
if (!$build) {
|
||||
if ($deploy->event == 'push' && $deploy->status == 'success') {
|
||||
@ -90,7 +90,7 @@ if (COCKPIT_ADMIN && !COCKPIT_API_REQUEST) {
|
||||
if (!$fromBuild || !$settings || !isset($settings['url'],
|
||||
$settings['owner'],
|
||||
$settings['project'],
|
||||
$settings['environment'],
|
||||
$settings['target'],
|
||||
$settings['token'])) {
|
||||
|
||||
return array(
|
||||
@ -98,7 +98,7 @@ if (COCKPIT_ADMIN && !COCKPIT_API_REQUEST) {
|
||||
);
|
||||
}
|
||||
|
||||
$url = trim($settings['url'], "/") . '/api/repos/' . $settings['owner'] . '/' . $settings['project'] . '/builds/' . $fromBuild . '/promote?target=' . $settings['environment'];
|
||||
$url = trim($settings['url'], "/") . '/api/repos/' . $settings['owner'] . '/' . $settings['project'] . '/builds/' . $fromBuild . '/promote?target=' . $settings['target'];
|
||||
|
||||
$headers = [
|
||||
'Content-Type: application/json',
|
||||
|
Loading…
Reference in New Issue
Block a user