Skip to content

Commit bbbce0d

Browse files
committed
pull main
2 parents eda6038 + 73b1216 commit bbbce0d

File tree

12 files changed

+55
-56
lines changed

12 files changed

+55
-56
lines changed

apptrust/commands/application/create_app_cmd.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ func (cac *createAppCommand) ServerDetails() (*coreConfig.ServerDetails, error)
3737
}
3838

3939
func (cac *createAppCommand) CommandName() string {
40-
return commands.CreateApp
40+
return commands.AppCreate
4141
}
4242

4343
func (cac *createAppCommand) buildRequestPayload(ctx *components.Context) (*model.AppDescriptor, error) {
@@ -118,18 +118,18 @@ func GetCreateAppCommand(appContext app.Context) components.Command {
118118
applicationService: appContext.GetApplicationService(),
119119
}
120120
return components.Command{
121-
Name: "create",
122-
Description: "Create a new application",
121+
Name: commands.AppCreate,
122+
Description: "Create a new application.",
123123
Category: common.CategoryApplication,
124-
Aliases: []string{"c"},
124+
Aliases: []string{"ac"},
125125
Arguments: []components.Argument{
126126
{
127127
Name: "application-key",
128-
Description: "The key of the application to create",
128+
Description: "The key of the application to create.",
129129
Optional: false,
130130
},
131131
},
132-
Flags: commands.GetCommandFlags(commands.CreateApp),
132+
Flags: commands.GetCommandFlags(commands.AppCreate),
133133
Action: cmd.prepareAndRunCommand,
134134
}
135135
}

apptrust/commands/application/delete_app_cmd.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ func (dac *deleteAppCommand) ServerDetails() (*coreConfig.ServerDetails, error)
3434
}
3535

3636
func (dac *deleteAppCommand) CommandName() string {
37-
return commands.DeleteApp
37+
return commands.AppDelete
3838
}
3939

4040
func (dac *deleteAppCommand) prepareAndRunCommand(ctx *components.Context) error {
@@ -58,14 +58,14 @@ func GetDeleteAppCommand(appContext app.Context) components.Command {
5858
applicationService: appContext.GetApplicationService(),
5959
}
6060
return components.Command{
61-
Name: "delete",
62-
Description: "Delete an application",
61+
Name: commands.AppDelete,
62+
Description: "Delete an application.",
6363
Category: common.CategoryApplication,
64-
Aliases: []string{"d"},
64+
Aliases: []string{"ad"},
6565
Arguments: []components.Argument{
6666
{
6767
Name: "application-key",
68-
Description: "The key of the application to delete",
68+
Description: "The key of the application to delete.",
6969
Optional: false,
7070
},
7171
},

apptrust/commands/application/update_app_cmd.go

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,6 @@ import (
1515
coreConfig "github.com/jfrog/jfrog-cli-core/v2/utils/config"
1616
)
1717

18-
const UpdateApp = "update-app"
19-
2018
type updateAppCommand struct {
2119
serverDetails *coreConfig.ServerDetails
2220
applicationService applications.ApplicationService
@@ -37,7 +35,7 @@ func (uac *updateAppCommand) ServerDetails() (*coreConfig.ServerDetails, error)
3735
}
3836

3937
func (uac *updateAppCommand) CommandName() string {
40-
return UpdateApp
38+
return commands.AppUpdate
4139
}
4240

4341
func (uac *updateAppCommand) buildRequestPayload(ctx *components.Context) (*model.AppDescriptor, error) {
@@ -108,18 +106,18 @@ func GetUpdateAppCommand(appContext app.Context) components.Command {
108106
applicationService: appContext.GetApplicationService(),
109107
}
110108
return components.Command{
111-
Name: "update",
109+
Name: commands.AppUpdate,
112110
Description: "Update an existing application",
113111
Category: common.CategoryApplication,
114-
Aliases: []string{"u"},
112+
Aliases: []string{"au"},
115113
Arguments: []components.Argument{
116114
{
117115
Name: "application-key",
118116
Description: "The key of the application to update",
119117
Optional: false,
120118
},
121119
},
122-
Flags: commands.GetCommandFlags(commands.UpdateApp),
120+
Flags: commands.GetCommandFlags(commands.AppUpdate),
123121
Action: cmd.prepareAndRunCommand,
124122
}
125123
}

apptrust/commands/flags.go

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,16 @@ import (
88
)
99

1010
const (
11-
Ping = "ping"
12-
CreateAppVersion = "version-create"
13-
PromoteAppVersion = "version-promote"
11+
Ping = "ping"
12+
VersionCreate = "version-create"
13+
VersionPromote = "version-promote"
14+
VersionDelete = "version-delete"
1415
ReleaseAppVersion = "version-release"
15-
DeleteAppVersion = "version-delete"
16-
PackageBind = "package-bind"
17-
PackageUnbind = "package-unbind"
18-
CreateApp = "app-create"
19-
UpdateApp = "app-update"
20-
DeleteApp = "app-delete"
16+
PackageBind = "package-bind"
17+
PackageUnbind = "package-unbind"
18+
AppCreate = "app-create"
19+
AppUpdate = "app-update"
20+
AppDelete = "app-delete"
2121
)
2222

2323
const (
@@ -85,7 +85,7 @@ var flagsMap = map[string]components.Flag{
8585
}
8686

8787
var commandFlags = map[string][]string{
88-
CreateAppVersion: {
88+
VersionCreate: {
8989
url,
9090
user,
9191
accessToken,
@@ -98,7 +98,7 @@ var commandFlags = map[string][]string{
9898
SpecFlag,
9999
SpecVarsFlag,
100100
},
101-
PromoteAppVersion: {
101+
VersionPromote: {
102102
url,
103103
user,
104104
accessToken,
@@ -120,7 +120,7 @@ var commandFlags = map[string][]string{
120120
IncludeReposFlag,
121121
PropsFlag,
122122
},
123-
DeleteAppVersion: {
123+
VersionDelete: {
124124
url,
125125
user,
126126
accessToken,
@@ -148,7 +148,7 @@ var commandFlags = map[string][]string{
148148
serverId,
149149
},
150150

151-
CreateApp: {
151+
AppCreate: {
152152
url,
153153
user,
154154
accessToken,
@@ -166,7 +166,7 @@ var commandFlags = map[string][]string{
166166
SpecVarsFlag,
167167
},
168168

169-
UpdateApp: {
169+
AppUpdate: {
170170
url,
171171
user,
172172
accessToken,
@@ -183,7 +183,7 @@ var commandFlags = map[string][]string{
183183
SpecVarsFlag,
184184
},
185185

186-
DeleteApp: {
186+
AppDelete: {
187187
url,
188188
user,
189189
accessToken,

apptrust/commands/package/bind_package_cmd.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ func GetBindPackageCommand(appContext app.Context) components.Command {
5858
cmd := &bindPackageCommand{packageService: appContext.GetPackageService()}
5959
return components.Command{
6060
Name: commands.PackageBind,
61-
Description: "Bind packages to an application",
61+
Description: "Bind packages to an application.",
6262
Category: common.CategoryPackage,
6363
Aliases: []string{"pb"},
6464
Arguments: []components.Argument{

apptrust/commands/package/unbind_package_cmd.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ func GetUnbindPackageCommand(appContext app.Context) components.Command {
5858
cmd := &unbindPackageCommand{packageService: appContext.GetPackageService()}
5959
return components.Command{
6060
Name: commands.PackageUnbind,
61-
Description: "Unbind packages from an application",
61+
Description: "Unbind packages from an application.",
6262
Category: common.CategoryPackage,
6363
Aliases: []string{"pu"},
6464
Arguments: []components.Argument{

apptrust/commands/system/ping_cmd.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ func GetPingCommand(appContext app.Context) components.Command {
4949
cmd := &pingCommand{systemService: appContext.GetSystemService()}
5050
return components.Command{
5151
Name: commands.Ping,
52-
Description: "Ping the application server",
52+
Description: "Ping AppTrust server.",
5353
Category: common.CategorySystem,
5454
Aliases: []string{"p"},
5555
Arguments: []components.Argument{},

apptrust/commands/version/create_app_version_cmd.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ func (cv *createAppVersionCommand) ServerDetails() (*coreConfig.ServerDetails, e
4444
}
4545

4646
func (cv *createAppVersionCommand) CommandName() string {
47-
return commands.CreateAppVersion
47+
return commands.VersionCreate
4848
}
4949

5050
func (cv *createAppVersionCommand) prepareAndRunCommand(ctx *components.Context) error {
@@ -137,18 +137,18 @@ func validateCreateAppVersionContext(ctx *components.Context) error {
137137
func GetCreateAppVersionCommand(appContext app.Context) components.Command {
138138
cmd := &createAppVersionCommand{versionService: appContext.GetVersionService()}
139139
return components.Command{
140-
Name: commands.CreateAppVersion,
141-
Description: "Create application version",
140+
Name: commands.VersionCreate,
141+
Description: "Create application version.",
142142
Category: common.CategoryVersion,
143143
Aliases: []string{"vc"},
144144
Arguments: []components.Argument{
145145
{
146146
Name: "version-name",
147-
Description: "The name of the version",
147+
Description: "The name of the version.",
148148
Optional: false,
149149
},
150150
},
151-
Flags: commands.GetCommandFlags(commands.CreateAppVersion),
151+
Flags: commands.GetCommandFlags(commands.VersionCreate),
152152
Action: cmd.prepareAndRunCommand,
153153
}
154154
}

apptrust/commands/version/delete_app_version_cmd.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ func (dv *deleteAppVersionCommand) ServerDetails() (*coreConfig.ServerDetails, e
3434
}
3535

3636
func (dv *deleteAppVersionCommand) CommandName() string {
37-
return commands.DeleteAppVersion
37+
return commands.VersionDelete
3838
}
3939

4040
func (dv *deleteAppVersionCommand) prepareAndRunCommand(ctx *components.Context) error {
@@ -57,23 +57,23 @@ func (dv *deleteAppVersionCommand) prepareAndRunCommand(ctx *components.Context)
5757
func GetDeleteAppVersionCommand(appContext app.Context) components.Command {
5858
cmd := &deleteAppVersionCommand{versionService: appContext.GetVersionService()}
5959
return components.Command{
60-
Name: commands.DeleteAppVersion,
61-
Description: "Delete application version",
60+
Name: commands.VersionDelete,
61+
Description: "Delete application version.",
6262
Category: common.CategoryVersion,
6363
Aliases: []string{"vd"},
6464
Arguments: []components.Argument{
6565
{
6666
Name: "application-key",
67-
Description: "The application key",
67+
Description: "The application key.",
6868
Optional: false,
6969
},
7070
{
7171
Name: "version",
72-
Description: "The name of the version to delete",
72+
Description: "The name of the version to delete.",
7373
Optional: false,
7474
},
7575
},
76-
Flags: commands.GetCommandFlags(commands.DeleteAppVersion),
76+
Flags: commands.GetCommandFlags(commands.VersionDelete),
7777
Action: cmd.prepareAndRunCommand,
7878
}
7979
}

apptrust/commands/version/promote_app_version_cmd.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ func (pv *promoteAppVersionCommand) ServerDetails() (*coreConfig.ServerDetails,
4040
}
4141

4242
func (pv *promoteAppVersionCommand) CommandName() string {
43-
return commands.PromoteAppVersion
43+
return commands.VersionPromote
4444
}
4545

4646
func (pv *promoteAppVersionCommand) prepareAndRunCommand(ctx *components.Context) error {
@@ -105,28 +105,28 @@ func (pv *promoteAppVersionCommand) buildRequestPayload(ctx *components.Context)
105105
func GetPromoteAppVersionCommand(appContext app.Context) components.Command {
106106
cmd := &promoteAppVersionCommand{versionService: appContext.GetVersionService()}
107107
return components.Command{
108-
Name: commands.PromoteAppVersion,
109-
Description: "Promote application version",
108+
Name: commands.VersionPromote,
109+
Description: "Promote application version.",
110110
Category: common.CategoryVersion,
111111
Aliases: []string{"vp"},
112112
Arguments: []components.Argument{
113113
{
114114
Name: "application-key",
115-
Description: "The application key",
115+
Description: "The application key.",
116116
Optional: false,
117117
},
118118
{
119119
Name: "version",
120-
Description: "The version to promote",
120+
Description: "The version to promote.",
121121
Optional: false,
122122
},
123123
{
124124
Name: "target-stage",
125-
Description: "The target stage to which the application version should be promoted",
125+
Description: "The target stage to which the application version should be promoted.",
126126
Optional: false,
127127
},
128128
},
129-
Flags: commands.GetCommandFlags(commands.PromoteAppVersion),
129+
Flags: commands.GetCommandFlags(commands.VersionPromote),
130130
Action: cmd.prepareAndRunCommand,
131131
}
132132
}

0 commit comments

Comments
 (0)