Skip to content

Commit 0b65100

Browse files
authored
Merge pull request #509 from salesforcecli/ashreya/commands-3
@W-23154741 - Devops pipeline commands
2 parents a9bd61e + ea07b40 commit 0b65100

23 files changed

Lines changed: 1786 additions & 16 deletions

command-snapshot.json

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,12 @@
11
[
2+
{
3+
"alias": [],
4+
"command": "devops:pipeline:activate",
5+
"flagAliases": [],
6+
"flagChars": ["o"],
7+
"flags": ["api-version", "flags-dir", "json", "pipeline-id", "target-org"],
8+
"plugin": "@salesforce/plugin-devops-center"
9+
},
210
{
311
"alias": [],
412
"command": "devops:pipeline:attach-project",
@@ -7,6 +15,34 @@
715
"flags": ["api-version", "flags-dir", "json", "pipeline-id", "project-id", "target-org"],
816
"plugin": "@salesforce/plugin-devops-center"
917
},
18+
{
19+
"alias": [],
20+
"command": "devops:pipeline:create",
21+
"flagAliases": [],
22+
"flagChars": ["d", "n", "o", "r"],
23+
"flags": [
24+
"api-version",
25+
"bitbucket-project",
26+
"create-repo",
27+
"description",
28+
"flags-dir",
29+
"json",
30+
"name",
31+
"repo",
32+
"repo-owner",
33+
"repo-type",
34+
"target-org"
35+
],
36+
"plugin": "@salesforce/plugin-devops-center"
37+
},
38+
{
39+
"alias": [],
40+
"command": "devops:pipeline:stage:add",
41+
"flagAliases": [],
42+
"flagChars": ["n", "o"],
43+
"flags": ["api-version", "flags-dir", "json", "name", "next-stage-id", "pipeline-id", "target-org"],
44+
"plugin": "@salesforce/plugin-devops-center"
45+
},
1046
{
1147
"alias": [],
1248
"command": "devops:project:create",
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# summary
2+
3+
Activate a DevOps Center pipeline for deployments.
4+
5+
# description
6+
7+
A pipeline must have at least one stage before you activate it. You can't modify the pipeline stages after you activate and promote changes through it.
8+
9+
# flags.target-org.summary
10+
11+
Username or alias of the DevOps Center org.
12+
13+
# flags.pipeline-id.summary
14+
15+
ID of the pipeline.
16+
17+
# examples
18+
19+
- Activate a pipeline using the pipeline ID.
20+
21+
<%= config.bin %> <%= command.id %> --target-org my-devops-org --pipeline-id 0XB000000000001
22+
23+
# error.NoStages
24+
25+
Can't activate pipeline %s. Add at least one stage, then try again.
26+
27+
# error.AlreadyActive
28+
29+
Pipeline %s is already active.

messages/devops.pipeline.create.md

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
# summary
2+
3+
Create a DevOps Center pipeline.
4+
5+
# description
6+
7+
Provide the URL of an existing repository, or use `--create-repo` with a repository name to create one. After you create the pipeline, add stages, and activate the pipeline.
8+
9+
# flags.target-org.summary
10+
11+
Username or alias of the DevOps Center org.
12+
13+
# flags.name.summary
14+
15+
Name of the pipeline.
16+
17+
# flags.repo.summary
18+
19+
URL of an existing repository or the name of a repository to create.
20+
21+
# flags.repo-type.summary
22+
23+
Type of the source code repository. Required when creating a repository using '--create-repo'.
24+
25+
# flags.create-repo.summary
26+
27+
Create a repository if it doesn't exist.
28+
29+
# flags.repo-owner.summary
30+
31+
Owner (organization or user) of the repository. Required when creating a repository using '--create-repo'.
32+
33+
# flags.bitbucket-project.summary
34+
35+
Bitbucket project key for the repository. Used when creating a Bitbucket repository with '--create-repo'.
36+
37+
# flags.description.summary
38+
39+
Description of the pipeline.
40+
41+
# examples
42+
43+
- Create a pipeline and associate it with an existing GitHub repository.
44+
45+
<%= config.bin %> <%= command.id %> --target-org my-devops-org --name "Release Pipeline" --repo https://github.com/myorg/myrepo
46+
47+
- Create a pipeline and associate it with a new GitHub repository.
48+
49+
<%= config.bin %> <%= command.id %> --target-org my-devops-org --name "Release Pipeline" --repo my-new-repo --repo-type github --repo-owner myorg --create-repo
50+
51+
- Create a pipeline with a description and associate it with a Bitbucket repository.
52+
53+
<%= config.bin %> <%= command.id %> --target-org my-devops-org --name "Release Pipeline" --repo https://bitbucket.org/myorg/myrepo --description "Main CI/CD pipeline for production releases"
54+
55+
# error.RepoTypeRequired
56+
57+
The --repo-type flag is required when using --create-repo. Specify --repo-type github or --repo-type bitbucket.
58+
59+
# error.RepoCreationFailed
60+
61+
Failed to create repository "%s". Verify the --repo-owner has permission to create repositories and the repository name is available. Details: %s
62+
63+
# error.RepoNotFound
64+
65+
Repository "%s" was not found or you don't have access. Verify the repository URL is correct and your DevOps Center org has the required VCS credentials.
66+
67+
# error.RepoValidationFailed
68+
69+
Failed to validate repository "%s". When using an existing repository, provide the full URL (e.g. https://github.com/owner/repo). To create a new repository, use --create-repo with --repo-type and --repo-owner.
70+
71+
# error.RepoOwnerRequired
72+
73+
The --repo-owner flag is required when using --create-repo. Specify the GitHub or Bitbucket organization or user that will own the repository.
74+
75+
# error.VcsCredentialsMissing
76+
77+
No VCS credentials found for repository "%s". Connect to Bitbucket in your DevOps Center org before creating a pipeline.
78+
79+
# error.RepoTypeDetectionFailed
80+
81+
Unable to detect the repository type from the URL "%s". Use --repo-type to specify the repository type.
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# summary
2+
3+
Add a stage to a DevOps Center pipeline.
4+
5+
# description
6+
7+
Inserts an empty stage before the stage specified by `--next-stage-id`. The new stage doesn't include a branch or environment. Configure them separately after you create the stage.
8+
9+
# flags.target-org.summary
10+
11+
Username or alias of the DevOps Center org.
12+
13+
# flags.pipeline-id.summary
14+
15+
ID of the pipeline where the stage is added.
16+
17+
# flags.name.summary
18+
19+
Name of the pipeline stage, such as Integration, UAT, or Staging.
20+
21+
# flags.next-stage-id.summary
22+
23+
ID of the stage that follows the new stage in the pipeline.
24+
25+
# examples
26+
27+
- Add a Development stage before Integration in a specific pipeline.
28+
29+
<%= config.bin %> <%= command.id %> --target-org my-devops-org --pipeline-id 0XB000000000001 --name "Development" --next-stage-id 0Xc000000000002
30+
31+
- Add a QA stage before UAT in a specific pipeline.
32+
33+
<%= config.bin %> <%= command.id %> --target-org my-devops-org --pipeline-id 0XB000000000001 --name "QA" --next-stage-id 0Xc000000000003
34+
35+
# error.StageNotFound
36+
37+
Stage %s not found in pipeline %s. Check the stage ID and try again.

package.json

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,12 @@
9494
"description": "Commands for managing DevOps Center pull requests."
9595
},
9696
"pipeline": {
97-
"description": "Commands for managing DevOps Center pipelines."
97+
"description": "Commands for managing DevOps Center pipelines.",
98+
"subtopics": {
99+
"stage": {
100+
"description": "Commands for managing pipeline stages."
101+
}
102+
}
98103
}
99104
}
100105
}
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
{
2+
"$schema": "http://json-schema.org/draft-07/schema#",
3+
"$ref": "#/definitions/ActivatePipelineResult",
4+
"definitions": {
5+
"ActivatePipelineResult": {
6+
"type": "object",
7+
"properties": {
8+
"success": {
9+
"type": "boolean"
10+
},
11+
"pipelineId": {
12+
"type": "string"
13+
},
14+
"status": {
15+
"type": "string"
16+
},
17+
"stageCount": {
18+
"type": "number"
19+
},
20+
"error": {
21+
"type": "string"
22+
}
23+
},
24+
"required": ["success", "pipelineId"],
25+
"additionalProperties": false
26+
}
27+
}
28+
}
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
{
2+
"$schema": "http://json-schema.org/draft-07/schema#",
3+
"$ref": "#/definitions/CreatePipelineResult",
4+
"definitions": {
5+
"CreatePipelineResult": {
6+
"type": "object",
7+
"properties": {
8+
"success": {
9+
"type": "boolean"
10+
},
11+
"pipelineId": {
12+
"type": "string"
13+
},
14+
"name": {
15+
"type": "string"
16+
},
17+
"description": {
18+
"type": "string"
19+
},
20+
"status": {
21+
"type": "string"
22+
},
23+
"repository": {
24+
"$ref": "#/definitions/RepoInfo"
25+
},
26+
"error": {
27+
"type": "string"
28+
}
29+
},
30+
"required": ["success"],
31+
"additionalProperties": false
32+
},
33+
"RepoInfo": {
34+
"type": "object",
35+
"properties": {
36+
"repoUrl": {
37+
"type": "string"
38+
},
39+
"repoType": {
40+
"type": "string"
41+
},
42+
"created": {
43+
"type": "boolean"
44+
}
45+
},
46+
"required": ["repoUrl", "repoType", "created"],
47+
"additionalProperties": false
48+
}
49+
}
50+
}
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
{
2+
"$schema": "http://json-schema.org/draft-07/schema#",
3+
"$ref": "#/definitions/AddPipelineStageResult",
4+
"definitions": {
5+
"AddPipelineStageResult": {
6+
"type": "object",
7+
"properties": {
8+
"success": {
9+
"type": "boolean"
10+
},
11+
"stageId": {
12+
"type": "string"
13+
},
14+
"name": {
15+
"type": "string"
16+
},
17+
"nextStageId": {
18+
"type": "string"
19+
},
20+
"pipelineId": {
21+
"type": "string"
22+
},
23+
"error": {
24+
"type": "string"
25+
}
26+
},
27+
"required": ["success"],
28+
"additionalProperties": false
29+
}
30+
}
31+
}

0 commit comments

Comments
 (0)