Skip to content

Commit 659d593

Browse files
committed
fix: delete old jira-github docs
Signed-off-by: Meng JiaFeng <[email protected]>
1 parent 3398338 commit 659d593

29 files changed

+325
-344
lines changed
Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,35 +2,35 @@ package main
22

33
import (
44
"github.com/devstream-io/devstream/internal/pkg/configmanager"
5-
"github.com/devstream-io/devstream/internal/pkg/plugin/jiragithub"
5+
"github.com/devstream-io/devstream/internal/pkg/plugin/jira"
66
"github.com/devstream-io/devstream/internal/pkg/statemanager"
77
"github.com/devstream-io/devstream/pkg/util/log"
88
)
99

1010
// NAME is the name of this DevStream plugin.
11-
const NAME = "jira-github-integ"
11+
const NAME = "jira"
1212

1313
// Plugin is the type used by DevStream core. It's a string.
1414
type Plugin string
1515

1616
// Create implements the installation of some jira-github-integ workflows.
1717
func (p Plugin) Create(options configmanager.RawOptions) (statemanager.ResourceStatus, error) {
18-
return jiragithub.Create(options)
18+
return jira.Create(options)
1919
}
2020

2121
// Update implements the installation of some jira-github-integ workflows.
2222
func (p Plugin) Update(options configmanager.RawOptions) (statemanager.ResourceStatus, error) {
23-
return jiragithub.Update(options)
23+
return jira.Update(options)
2424
}
2525

2626
// Read implements the healthy check of jira-github-integ workflows.
2727
func (p Plugin) Read(options configmanager.RawOptions) (statemanager.ResourceStatus, error) {
28-
return jiragithub.Read(options)
28+
return jira.Read(options)
2929
}
3030

3131
// Delete implements the installation of some jira-github-integ workflows.
3232
func (p Plugin) Delete(options configmanager.RawOptions) (bool, error) {
33-
return jiragithub.Delete(options)
33+
return jira.Delete(options)
3434
}
3535

3636
// DevStreamPlugin is the exported variable used by the DevStream core.

docs/core-concepts/tools.md

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -44,16 +44,21 @@ tools:
4444
org: devstream-io
4545
name: dtm-scaffolding-golang
4646
scmType: github
47-
- name: jira-github-integ
47+
token: [[ env GITHUB_TOKEN ]]
48+
- name: jira
4849
instanceID: default
4950
dependsOn: [ "repo-scaffolding.golang-github" ]
5051
options:
51-
owner: [[ githubUsername ]]
52-
repo: [[ repoName ]]
53-
jiraBaseUrl: https://xxx.atlassian.net
54-
jiraUserEmail: [email protected]
55-
jiraProjectKey: zzz
56-
branch: main
52+
scm:
53+
owner: [[ githubUsername ]]
54+
name: [[ repoName ]]
55+
scmType: github
56+
branch: main
57+
jira:
58+
baseUrl: https://xxx.atlassian.net
59+
userEmail: [email protected]
60+
projectKey: zzz
61+
token: [[ env JIRA_TOKEN ]]
5762
```
5863
5964
`[[ githubUsername ]]`, `[[ repoName ]]` (and other variables inside the double brackets) are global variables which are defined in the `vars` section of the config.

docs/core-concepts/tools.zh.md

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -40,16 +40,20 @@ tools:
4040
org: devstream-io
4141
name: dtm-scaffolding-golang
4242
scmType: github
43-
- name: jira-github-integ
43+
- name: jira
4444
instanceID: default
4545
dependsOn: [ "repo-scaffolding.golang-github" ]
4646
options:
47-
owner: [[ githubUsername ]]
48-
repo: [[ repoName ]]
49-
jiraBaseUrl: https://xxx.atlassian.net
50-
jiraUserEmail: [email protected]
51-
jiraProjectKey: zzz
52-
branch: main
47+
scm:
48+
owner: [[ githubUsername ]]
49+
name: [[ repoName ]]
50+
scmType: github
51+
branch: main
52+
jira:
53+
baseUrl: https://xxx.atlassian.net
54+
userEmail: [email protected]
55+
projectKey: zzz
56+
token: [[ env JIRA_TOKEN ]]
5357
```
5458
5559
其中,[[ githubUsername ]]、[[ repoName ]] 等是全局变量,它们的值可以在 `vars` 字段中定义。

docs/plugins/jira-github-integ.zh.md

Lines changed: 0 additions & 3 deletions
This file was deleted.
Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# jira-github-integ Plugin
1+
# jira Plugin
22

33
This plugin integrates Jira with your GitHub repo.
44

@@ -9,10 +9,10 @@ _Please confirm the preconditions:_
99
- Jira language must be English
1010
- There should be an existing Jira project
1111

12-
_This plugin depends on the following two environment variables:_
12+
_This plugin depends on the following two config variables:_
1313

14-
- JIRA_API_TOKEN
15-
- GITHUB_TOKEN
14+
- jira.token
15+
- scm.token
1616

1717
Set the values accordingly before using this plugin.
1818

@@ -25,7 +25,7 @@ The following content is an example of the "tool file".
2525
For more information on the main config, the tool file and the var file of DevStream, see [Core Concepts Overview](../core-concepts/overview.md) and [DevStream Configuration](../core-concepts/config.md).
2626

2727
```yaml
28-
--8<-- "jira-github-integ.yaml"
28+
--8<-- "jira.yaml"
2929
```
3030

3131
Currently, all the parameters in the example above are mandatory.

docs/plugins/jira.zh.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# jira 插件
2+
3+
todo

docs/plugins/plugins-list.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
| Type | Plugin | Note | Usage/Doc |
44
|--------------------------------|-----------------------------|--------------------------------|---------------------------------------|
55
| Issue Tracking | trello | Trello Configuration | [doc](trello.md) |
6-
| Issue Tracking | jira-github-integ | Jira/GitHub integration | [doc](jira-github-integ.md) |
6+
| Issue Tracking | jira | Jira Configuration | [doc](jira.md) |
77
| Issue Tracking | zentao | Zentao installation | [doc](zentao.md) |
88
| Source Code Management | repo-scaffolding | App scaffolding | [doc](repo-scaffolding.md) |
99
| Source Code Management | gitlab-ce-docker | GitLab CE version installation | [doc](gitlab-ce-docker.md) |
@@ -28,7 +28,7 @@ gitlab-ci
2828
harbor-docker
2929
helm-installer
3030
jenkins-pipeline
31-
jira-github-integ
31+
jira
3232
repo-scaffolding
3333
trello
3434
zentao

docs/plugins/plugins-list.zh.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
| Type | Plugin | Note | Usage/Doc |
55
| ---------------------- | ------------------- | ------------------------------- | --------------------------------------- |
66
| Issue Tracking | trello | Trello 配置 | [doc](trello.md) |
7-
| Issue Tracking | jira-github-integ | Jira/GitHub 整合 | [doc](jira-github-integ.md) |
7+
| Issue Tracking | jira | Jira 配置 | [doc](jira.md) |
88
| Issue Tracking | zentao | Zentao 安装 | [doc](zentao.md) |
99
| Source Code Management | repo-scaffolding | 应用仓库脚手架 | [doc](repo-scaffolding.md) |
1010
| Source Code Management | gitlab-ce-docker | 使用 docker 安装 GitLab CE 版本 | [doc](gitlab-ce-docker.md) |
@@ -29,7 +29,7 @@ gitlab-ci
2929
harbor-docker
3030
helm-installer
3131
jenkins-pipeline
32-
jira-github-integ
32+
jira
3333
repo-scaffolding
3434
trello
3535
zentao

internal/pkg/plugin/jira/create.go

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
package jira
2+
3+
import (
4+
"github.com/devstream-io/devstream/internal/pkg/configmanager"
5+
"github.com/devstream-io/devstream/internal/pkg/plugin/installer"
6+
"github.com/devstream-io/devstream/internal/pkg/plugin/installer/ci/cifile"
7+
"github.com/devstream-io/devstream/internal/pkg/statemanager"
8+
"github.com/devstream-io/devstream/pkg/util/log"
9+
)
10+
11+
// Create sets up jira workflows.
12+
func Create(options configmanager.RawOptions) (statemanager.ResourceStatus, error) {
13+
// Initialize Operator with Operations
14+
operator := &installer.Operator{
15+
PreExecuteOperations: installer.PreExecuteOperations{
16+
setDefault,
17+
validate,
18+
},
19+
ExecuteOperations: installer.ExecuteOperations{
20+
addJiraSecret,
21+
cifile.PushCIFiles,
22+
},
23+
GetStatusOperation: cifile.GetCIFileStatus,
24+
}
25+
26+
// Execute all Operations in Operator
27+
status, err := operator.Execute(configmanager.RawOptions(options))
28+
if err != nil {
29+
return nil, err
30+
}
31+
log.Debugf("Return map: %v", status)
32+
return status, nil
33+
}

internal/pkg/plugin/jira/delete.go

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
package jira
2+
3+
import (
4+
"github.com/devstream-io/devstream/internal/pkg/configmanager"
5+
"github.com/devstream-io/devstream/internal/pkg/plugin/installer"
6+
"github.com/devstream-io/devstream/internal/pkg/plugin/installer/ci/cifile"
7+
)
8+
9+
// Delete remove jira workflows.
10+
func Delete(options configmanager.RawOptions) (bool, error) {
11+
// Initialize Operator with Operations
12+
operator := &installer.Operator{
13+
PreExecuteOperations: installer.PreExecuteOperations{
14+
setDefault,
15+
validate,
16+
},
17+
ExecuteOperations: installer.ExecuteOperations{
18+
cifile.DeleteCIFiles,
19+
},
20+
}
21+
22+
// Execute all Operations in Operator
23+
_, err := operator.Execute(configmanager.RawOptions(options))
24+
if err != nil {
25+
return false, err
26+
}
27+
return true, nil
28+
}

0 commit comments

Comments
 (0)