8000 refactor: rename release action (#5825) · ovh/cds@266f0bc · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Commit 266f0bc

Browse files
authored
refactor: rename release action (#5825)
1 parent f8d2b30 commit 266f0bc

File tree

11 files changed

+43
-35
lines changed

11 files changed

+43
-35
lines changed

docs/content/docs/concepts/files/application-syntax.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ vcs_ssh_key: proj-ssh-key
129129
vcs_pgp_key: proj-pgp-key
130130
```
131131

132-
Now with this setup you will be able to use the actions [CheckoutApplication]({{< relref "../../actions/builtin-checkoutapplication/" >}}) and [Release]({{< relref "../../actions/builtin-release/" >}}) in your pipelines.
132+
Now with this setup you will be able to use the actions [CheckoutApplication]({{< relref "../../actions/builtin-checkoutapplication/" >}}) and [Release]({{< relref "../../actions/builtin-releasevcs/" >}}) in your pipelines.
133133

134134
## Deployment
135135

docs/content/docs/tutorials/step_by_step_build_tag_release.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@ Tag is created on GitHub.
232232
233233
## 9 - Release Action
234234
235-
[Release action]({{< relref "/docs/actions/builtin-release.md" >}}) action is implemented for GitHub only.
235+
[Release action]({{< relref "/docs/actions/builtin-releasevcs.md" >}}) action is implemented for GitHub only.
236236
You can use it to create a release from a tag and push some artifacts on it.
237237
238238
{{%expand "view screenshots..." %}}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
-- +migrate Up
2+
UPDATE action SET name = 'ReleaseVCS' WHERE name = 'Release' and type = 'Builtin'
3+
4+
-- +migrate Down
5+
UPDATE action SET name = 'Release' WHERE name = 'ReleaseVCS' and type = 'Builtin'
6+
7+
8+

engine/worker/internal/action/builtin_release.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import (
1313
"github.com/ovh/cds/sdk"
1414
)
1515

16-
func RunRelease(ctx context.Context, wk workerruntime.Runtime, a sdk.Action, secrets []sdk.Variable) (sdk.Result, error) {
16+
func RunReleaseVCS(ctx context.Context, wk workerruntime.Runtime, a sdk.Action, secrets []sdk.Variable) (sdk.Result, error) {
1717
var res sdk.Result
1818
res.Status = sdk.StatusFail
1919
jobID, err := workerruntime.JobID(ctx)

engine/worker/internal/action/builtin_release_test.go

Lines changed: 7 additions & 7 deletions
},
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ func TestRunRelease(t *testing.T) {
6666
Value: "999",
6767
6868
}...)
69-
res, err := RunRelease(ctx, wk,
69+
res, err := RunReleaseVCS(ctx, wk,
7070
sdk.Action{
7171
Parameters: []sdk.Parameter{
7272
{
@@ -110,7 +110,7 @@ func TestRunReleaseMissingTag(t *testing.T) {
110110
Value: "999",
111111
},
112112
}...)
113-
res, err := RunRelease(ctx, wk,
113+
res, err := RunReleaseVCS(ctx, wk,
114114
sdk.Action{
115115
Parameters: []sdk.Parameter{
116116
{
@@ -150,7 +150,7 @@ func TestRunReleaseMissingTitle(t *testing.T) {
150150
Value: "999",
151151
},
152152
}...)
153-
res, err := RunRelease(ctx, wk,
153+
res, err := RunReleaseVCS(ctx, wk,
154154
sdk.Action{
155155
Parameters: []sdk.Parameter{
156156
{
@@ -190,7 +190,7 @@ func TestRunReleaseMissingReleaseNote(t *testing.T) {
190190
Value: "999",
191191
},
192192
}...)
193-
res, err := RunRelease(ctx, wk,
193+
res, err := RunReleaseVCS(ctx, wk,
194194
sdk.Action{
195195
Parameters: []sdk.Parameter{
196196
{
@@ -226,7 +226,7 @@ func TestRunReleaseMissingProjectKey(t *testing.T) {
226226
Value: "999",
227227
},
228228
}...)
229-
res, err := RunRelease(ctx, wk,
229+
res, err := RunReleaseVCS(ctx, wk,
230230
sdk.Action{
231231
Parameters: []sdk.Parameter{
232232
{
@@ -266,7 +266,7 @@ func TestRunReleaseMissingWorkflowName(t *testing.T) {
266266
Value: "999",
267267
},
268268
}...)
269-
res, err := RunRelease(ctx, wk,
269+
res, err := RunReleaseVCS(ctx, wk,
270270
sdk.Action{
271271
Parameters: []sdk.Parameter{
272272
{
@@ -306,7 +306,7 @@ func TestRunReleaseMissingWorkflowRunNumber(t *testing.T) {
306306
Value: "workflow Name",
307307
},
308308
}...)
309-
res, err := RunRelease(ctx, wk,
309+
res, err := RunReleaseVCS(ctx, wk,
310310
sdk.Action{
311311
Parameters: []sdk.Parameter{
312312
{

engine/worker/internal/builtin.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ func init() {
2020
mapBuiltinActions[sdk.JUnitAction] = action.RunParseJunitTestResultAction
2121
mapBuiltinActions[sdk.GitCloneAction] = action.RunGitClone
2222
mapBuiltinActions[sdk.GitTagAction] = action.RunGitTag
23-
mapBuiltinActions[sdk.ReleaseAction] = action.RunRelease
23+
mapBuiltinActions[sdk.ReleaseVCSAction] = action.RunReleaseVCS
2424
mapBuiltinActions[sdk.CheckoutApplicationAction] = action.RunCheckoutApplication
2525
mapBuiltinActions[sdk.DeployApplicationAction] = action.RunDeployApplication
2626
mapBuiltinActions[sdk.CoverageAction] = action.RunParseCoverageResultAction

sdk/action.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ const (
2121
CoverageAction = "Coverage"
2222
GitCloneAction = "GitClone"
2323
GitTagAction = "GitTag"
24-
ReleaseAction = "Release"
24+
ReleaseVCSAction = "ReleaseVCS"
2525
CheckoutApplicationAction = "CheckoutApplication"
2626
DeployApplicationAction = "DeployApplication"
2727
InstallKeyAction = "InstallKey"

sdk/action/action.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ var List = []Manifest{
2121
GitTag,
2222
InstallKey,
2323
JUnit,
24-
Release,
24+
ReleaseVCS,
2525
Script,
2626
ServeStaticFiles,
2727
}

sdk/action/release.go renamed to sdk/action/release-vcs.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@ import (
55
"github.com/ovh/cds/sdk/exportentities"
66
)
77

8-
// Release action definition.
9-
var Release = Manifest{
8+
// ReleaseVCS action definition.
9+
var ReleaseVCS = Manifest{
1010
Action: sdk.Action{
11-
Name: sdk.ReleaseAction,
11+
Name: sdk.ReleaseVCSAction,
1212
Description: "This action creates a release on the git repository linked to the application, if repository manager implements it.",
1313
Parameters: []sdk.Parameter{
1414
{
@@ -68,7 +68,7 @@ var Release = Manifest{
6868
},
6969
},
7070
{
71-
Release: &exportentities.StepRelease{
71+
ReleaseVCS: &exportentities.StepReleaseVCS{
7272
Artifacts: "{{.cds.workspace}}/myFile",
7373
Title: "{{.cds.build.tag}}",
7474
ReleaseNote: "My release {{.cds.build.tag}}",

0 commit comments

Comments
 (0)
0