Skip to content
This repository was archived by the owner on Oct 13, 2020. It is now read-only.

Commit 2c0f2a6

Browse files
authored
Merge pull request #4 from electric-cloud-community/new-procedures
Added new procedures
2 parents 5785b15 + d7656ec commit 2c0f2a6

21 files changed

Lines changed: 662 additions & 84 deletions

File tree

META-INF/plugin.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<key>EC-Github</key>
44
<label>EC-Github</label>
55
<author>Polina</author>
6-
<category>Utilities</category>
6+
<category>Source Control</category>
77
<description>CloudBees Flow integration for Github API</description>
88
<configure>ec_config</configure>
99
<version>2.0.0</version>

config/pluginspec.yaml

Lines changed: 95 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
1-
pluginName: EC-Github
2-
version: 2.0.0
3-
description: CloudBees Flow integration for Github API
4-
author: Polina
5-
authorUrl: pshubina@cloudbees.com
1+
pluginInfo:
2+
pluginName: EC-Github
3+
version: 2.1.0
4+
description: CloudBees Flow integration for Github API
5+
author: Polina
6+
authorUrl: pshubina@cloudbees.com
7+
category: Source Control
68

79

810
configuration:
@@ -125,6 +127,91 @@ procedures:
125127
label: Asset Path
126128
type: entry
127129

130+
- name: Upload Files
131+
description: |
132+
This procedure uploads the provided files into the provided repository
133+
shell: ec-groovy
134+
hasConfig: true
135+
parameters:
136+
- name: ownerName
137+
required: true
138+
label: Repository Owner
139+
type: entry
140+
documentation: The name of the user or organization which owns the repository
141+
- name: repoName
142+
required: true
143+
label: Repository Name
144+
type: entry
145+
documentation: The name of the GH repository.
146+
- name: sourceDirectory
147+
required: false
148+
type: entry
149+
label: Source Directory
150+
documentation: |
151+
The directory resembling the repository source.
152+
If not provided, the current directory will be used.
153+
The relative paths of the files will be used to provide the path in the repository.
154+
- name: mapping
155+
documentation: |
156+
A mapping in JSON form to provide the path to file in the repository, e.g.
157+
{'file': "my/file"} where file is the path to the file relative to the source directory.
158+
type: textarea
159+
label: Mapping
160+
- name: files
161+
label: Files
162+
documentation: |
163+
A list of files relative to the source directory, newline-separated
164+
type: textarea
165+
- name: branch
166+
label: Branch
167+
value: master
168+
type: entry
169+
documentation: |
170+
A branch name to commit files to.
171+
If not master, the branch will be created from the master branch.
172+
- name: createPr
173+
type: checkbox
174+
label: Create Pull Request?
175+
checkedValue: true
176+
uncheckedValue: false
177+
documentation: |
178+
If checked, a PR will be created for the updated files.
179+
180+
- name: Get Files
181+
description: |
182+
This procedure fetches the content of the specified files and stores it in
183+
the filesystem or in the provided property
184+
shell: ec-groovy
185+
hasConfig: true
186+
parameters:
187+
- name: ownerName
188+
required: true
189+
label: Repository Owner
190+
type: entry
191+
documentation: The name of the user or organization which owns the repository
192+
- name: repoName
193+
required: true
194+
label: Repository Name
195+
type: entry
196+
documentation: The name of the GH repository.
197+
- name: files
198+
required: true
199+
label: Files
200+
documentation: |
201+
The newline-separated list of paths to the files
202+
type: textarea
203+
- name: destinationFolder
204+
required: false
205+
value: files
206+
label: Folder to Save Files
207+
type: entry
208+
documentation: The folder to save retrieved files, absolute or relative path
209+
- name: ref
210+
label: Git Reference
211+
required: false
212+
value: master
213+
documentation: Reference (branch, commit or tag to download file from)
214+
128215

129216
- name: Create Release
130217
description: This procedure can create a new Github Release or update an existing one.
@@ -148,6 +235,8 @@ procedures:
148235
value: recreate
149236
- name: Fail
150237
value: fail
238+
- name: Update
239+
value: update
151240

152241
- name: releaseName
153242
label: Release Name
@@ -187,4 +276,4 @@ procedures:
187276
label: Delete Old Tag?
188277
documentation: If checked, the old tag associated with the old release will be deleted.
189278
checkedValue: true
190-
uncheckedValue: false
279+
uncheckedValue: false

dsl/com/electriccloud/commander/dsl/util/BasePlugin.groovy

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
// Version: Thu Oct 25 16:10:18 2018
2+
// Please do not edit this file
23
package com.electriccloud.commander.dsl.util
34

45
import groovy.io.FileType

dsl/procedures/CreateConfiguration/procedure.dsl

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11

2-
// === configuration starts ===
3-
// This part is auto-generated and will be regenerated upon subsequent updates
2+
// DO NOT EDIT THIS BLOCK === configuration starts ===
43
procedure 'CreateConfiguration', description: 'Creates a plugin configuration', {
54

65
step 'createConfiguration',
@@ -13,5 +12,5 @@ procedure 'CreateConfiguration', description: 'Creates a plugin configuration',
1312
timeLimitUnits: 'minutes'
1413

1514
property 'ec_checkConnection', value: ''
16-
// === configuration ends, checksum: 8e292d191415a8f02e2350128b9946c2 ===
15+
// DO NOT EDIT THIS BLOCK === configuration ends, checksum: 5a7ab0ec556cc89190941f496f1191b0 ===
1716
}

dsl/procedures/CreateConfiguration/steps/createConfiguration.pl

Lines changed: 3 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,6 @@
11

2-
## === createConfiguration starts ===
3-
#
4-
# Copyright 2016 Electric Cloud, Inc.
5-
#
6-
# Licensed under the Apache License, Version 2.0 (the "License");
7-
# you may not use this file except in compliance with the License.
8-
# You may obtain a copy of the License at
9-
#
10-
# http://www.apache.org/licenses/LICENSE-2.0
11-
#
12-
# Unless required by applicable law or agreed to in writing, software
13-
# distributed under the License is distributed on an "AS IS" BASIS,
14-
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15-
# See the License for the specific language governing permissions and
16-
# limitations under the License.
17-
#
18-
19-
#########################
20-
## createcfg.pl
21-
#########################
22-
2+
## DO NOT EDIT THIS BLOCK === createConfiguration starts ===
3+
# Please do not edit this file
234
use ElectricCommander;
245
use ElectricCommander::PropDB;
256
use JSON;
@@ -204,4 +185,4 @@ sub createConfigurationPropertySheet {
204185
$cfg->setCol("$opts->{config}", "$key", "$opts->{$key}");
205186
}
206187
}
207-
## === createConfiguration ends, checksum: b9c4ad2aeb2b3997dfbec1b845c4d7b4 ===
188+
## DO NOT EDIT THIS BLOCK === createConfiguration ends, checksum: 99e7a2462ebf0450ab27f98d7b6b987a ===

dsl/procedures/CreateRelease/form.xml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,10 @@
3737
<name>Fail</name>
3838
<value>fail</value>
3939
</option>
40+
<option>
41+
<name>Update</name>
42+
<value>update</value>
43+
</option>
4044
</formElement>
4145
<formElement>
4246
<type>entry</type>

dsl/procedures/CreateRelease/procedure.dsl

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,16 @@
11
// This procedure.dsl was generated automatically
2-
// === procedure_autogen starts ===
3-
procedure 'Create Release', description: 'This procedure can create a new Github Release or update an existing one.', {
2+
// DO NOT EDIT THIS BLOCK === procedure_autogen starts ===
3+
procedure 'Create Release', description: '''This procedure can create a new Github Release or update an existing one.''', {
44

55
step 'Create Release', {
66
description = ''
77
command = new File(pluginDir, "dsl/procedures/CreateRelease/steps/CreateRelease.groovy").text
8+
// TODO altered shell
89
shell = 'ec-groovy'
910

1011
postProcessor = ''''''
1112
}
12-
// === procedure_autogen ends, checksum: e75ae2fc97e8d0b7207a3e3fb41bc80d ===
13+
// DO NOT EDIT THIS BLOCK === procedure_autogen ends, checksum: e1f39a29469ce11a5ea278b00706e4be ===
1314
// Do not update the code above the line
1415
// procedure properties declaration can be placed in here, like
1516
// property 'property name', value: "value"
Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11

2-
// === procedure_autogen starts ===
3-
procedure 'Create Repository', description: 'Creates a GitHub Repository', {
2+
// DO NOT EDIT THIS BLOCK === procedure_autogen starts ===
3+
procedure 'Create Repository', description: '''Creates a GitHub Repository''', {
44

55
step 'Create Repository', {
66
description = ''
77
command = new File(pluginDir, "dsl/procedures/CreateRepository/steps/CreateRepository.groovy").text
8+
// TODO altered shell
89
shell = 'ec-groovy'
910

1011
postProcessor = ''''''
1112
}
12-
// === procedure_autogen ends, checksum: 9e8e485c7e1c0c68e76405aa1ee22414 ===
13+
// DO NOT EDIT THIS BLOCK === procedure_autogen ends, checksum: 4f13e44746feee914ee6c05288698eef ===
1314
}

dsl/procedures/DeleteRelease/procedure.dsl

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,16 @@
11
// This procedure.dsl was generated automatically
2-
// === procedure_autogen starts ===
3-
procedure 'Delete Release', description: 'Deletes a tag and an attached release from Github', {
2+
// DO NOT EDIT THIS BLOCK === procedure_autogen starts ===
3+
procedure 'Delete Release', description: '''Deletes a tag and an attached release from Github''', {
44

55
step 'Delete Release', {
66
description = ''
77
command = new File(pluginDir, "dsl/procedures/DeleteRelease/steps/DeleteRelease.groovy").text
8+
// TODO altered shell
89
shell = 'ec-groovy'
910

1011
postProcessor = ''''''
1112
}
12-
// === procedure_autogen ends, checksum: 420b71563fb3e061e50d6725cd7a8022 ===
13+
// DO NOT EDIT THIS BLOCK === procedure_autogen ends, checksum: 082f96095acf81c8caa3e5f42acd0304 ===
1314
// Do not update the code above the line
1415
// procedure properties declaration can be placed in here, like
1516
// property 'property name', value: "value"

dsl/procedures/DownloadReleaseAsset/procedure.dsl

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,16 @@
11
// This procedure.dsl was generated automatically
2-
// === procedure_autogen starts ===
3-
procedure 'Download Release Asset', description: 'Downloads the specified release asset from Github.', {
2+
// DO NOT EDIT THIS BLOCK === procedure_autogen starts ===
3+
procedure 'Download Release Asset', description: '''Downloads the specified release asset from Github.''', {
44

55
step 'Download Release Asset', {
66
description = ''
77
command = new File(pluginDir, "dsl/procedures/DownloadReleaseAsset/steps/DownloadReleaseAsset.groovy").text
8+
// TODO altered shell
89
shell = 'ec-groovy'
910

1011
postProcessor = ''''''
1112
}
12-
// === procedure_autogen ends, checksum: ef595f86961464d70f2ced0e3197da86 ===
13+
// DO NOT EDIT THIS BLOCK === procedure_autogen ends, checksum: 186a88b00b674bdc1293a2d584c610a0 ===
1314
// Do not update the code above the line
1415
// procedure properties declaration can be placed in here, like
1516
// property 'property name', value: "value"

0 commit comments

Comments
 (0)