Skip to content

Commit 029d19f

Browse files
authored
Merge pull request #1359 from devstream-io/main
Prepare to release v0.10.3
2 parents 379f262 + 6bcd6f4 commit 029d19f

File tree

314 files changed

+4775
-5211
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

314 files changed

+4775
-5211
lines changed

.github/sync-staging-repo.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
devstream-io/dtm-gitlab-share-library:
2+
- source: staging/dtm-gitlab-share-library/
3+
dest: .
4+
deleteOrphaned: true
5+
devstream-io/dtm-pipeline-templates:
6+
- source: staging/dtm-pipeline-templates/
7+
dest: .
8+
deleteOrphaned: true
9+
devstream-io/dtm-repo-scaffolding-golang-cli:
10+
- source: staging/dtm-repo-scaffolding-golang-cli/
11+
dest: .
12+
deleteOrphaned: true
13+
devstream-io/dtm-repo-scaffolding-golang-gin:
14+
- source: staging/dtm-repo-scaffolding-golang-gin/
15+
dest: .
16+
deleteOrphaned: true
17+
devstream-io/dtm-repo-scaffolding-java-springboot:
18+
- source: staging/dtm-repo-scaffolding-java-springboot/
19+
dest: .
20+
deleteOrphaned: true
21+
devstream-io/dtm-repo-scaffolding-python-flask:
22+
- source: staging/dtm-repo-scaffolding-python-flask/
23+
dest: .
24+
deleteOrphaned: true
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: Sync Staging Files to Other Repos
2+
on:
3+
push:
4+
branches: [ main ]
5+
paths:
6+
- staging/**
7+
- .github/workflows/sync-staging-repo.yml
8+
- .github/sync-staging-repo.yml
9+
workflow_dispatch:
10+
11+
jobs:
12+
sync:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- name: Checkout
16+
uses: actions/checkout@v3
17+
- name: Run GitHub File Sync
18+
uses: BetaHuhn/[email protected]
19+
with:
20+
GH_PAT: ${{ secrets.GH_PAT }}
21+
CONFIG_PATH: .github/sync-staging-repo.yml
22+
ORIGINAL_MESSAGE: true
23+
SKIP_PR: true
24+
COMMIT_EACH_FILE: false

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ docs/build
2727

2828
# YAML for testings
2929
config*.yaml*
30-
app*.yaml
3130
variables*.yaml
3231
variables*.yaml.bak
3332
tools*.yaml
@@ -53,5 +52,8 @@ testbin/
5352
# terraform
5453
.terraform
5554

55+
# test
56+
cov
57+
5658
# md
5759
README_when_create_plugin.md

.lycheeignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ https://fonts.gstatic.com/
88
.*xxx.*
99
.*changeme.*
1010
.*example.*
11+
.*test.*
1112
.*YOUR_.*
1213
https://id.atlassian.net
1314
https://JIRA_ID.atlassian.net

.yamllint.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,3 +32,4 @@ ignore: |
3232
**/.github/**
3333
**/githubactions/**
3434
**/workflows/**
35+
**/staging/**

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ I am happy to tell you that we have, and we are constantly adding more possible
9191
so you are more than welcome to tell us what combinations you expect.
9292

9393
- [GitOps Toolchain](https://docs.devstream.io/en/latest/best-practices/gitops/)
94-
- [GitLab, Jenkins and Harbor On Premise Toolchain (Chinese only for now)](https://docs.devstream.io/en/latest/best-practices/gitlab-jenkins-harbor.zh/)
94+
- [GitLab, Jenkins and Harbor On Premise Toolchain (Chinese only for now)](https://docs.devstream.io/en/latest/best-practices/gitlab-jenkins-harbor-java-springboot.zh/)
9595

9696
## Supported DevOps Tools
9797

README_zh.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ DevStream支持许多工具的管理。你可以灵活地结合一些工具来
9292
我们非常欢迎你告诉我们你期望的组合。
9393

9494
- [GitOps工具链](https://docs.devstream.io/en/latest/best-practices/gitops.zh/)
95-
- [用 DevStream 搭建 GitLab + Jenkins + Harbor 工具链,管理 Java Spring Boot 项目开发生命周期全流程](https://docs.devstream.io/en/latest/best-practices/gitlab-jenkins-harbor.zh/)
95+
- [用 DevStream 搭建 GitLab + Jenkins + Harbor 工具链,管理 Java Spring Boot 项目开发生命周期全流程](https://docs.devstream.io/en/latest/best-practices/gitlab-jenkins-harbor-java-springboot.zh/)
9696

9797
## 支持的DevOps工具
9898

cmd/devstream/apply.go

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@ package main
22

33
import (
44
"os"
5+
"strings"
56

67
"github.com/spf13/cobra"
78

8-
"github.com/devstream-io/devstream/internal/pkg/completion"
99
"github.com/devstream-io/devstream/internal/pkg/pluginengine"
1010
"github.com/devstream-io/devstream/pkg/util/log"
1111
)
@@ -20,19 +20,20 @@ DevStream will generate and execute a new plan based on the config file and the
2020
}
2121

2222
func applyCMDFunc(cmd *cobra.Command, args []string) {
23+
checkConfigFile()
2324
log.Info("Apply started.")
2425
if err := pluginengine.Apply(configFilePath, continueDirectly); err != nil {
2526
log.Errorf("Apply failed => %s.", err)
27+
if strings.Contains(err.Error(), "config not valid") {
28+
log.Info("It seems your config file is not valid. Please check the official documentation https://docs.devstream.io, or use the \"dtm show config\" command to get an example.")
29+
}
2630
os.Exit(1)
2731
}
2832
log.Success("Apply finished.")
2933
}
3034

3135
func init() {
32-
applyCMD.Flags().StringVarP(&configFilePath, configFlagName, "f", "config.yaml", "config file")
33-
applyCMD.Flags().StringVarP(&pluginDir, pluginDirFlagName, "d", defaultPluginDir, "plugins directory")
34-
applyCMD.Flags().BoolVarP(&continueDirectly, "yes", "y", false, "apply directly without confirmation")
35-
36-
completion.FlagFilenameCompletion(applyCMD, configFlagName)
37-
completion.FlagDirnameCompletion(applyCMD, pluginDirFlagName)
36+
addFlagConfigFile(applyCMD)
37+
addFlagPluginDir(applyCMD)
38+
addFlagContinueDirectly(applyCMD)
3839
}

cmd/devstream/common.go

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,15 @@
11
package main
22

3+
import (
4+
"os"
5+
"strings"
6+
7+
"github.com/spf13/cobra"
8+
9+
"github.com/devstream-io/devstream/internal/pkg/completion"
10+
"github.com/devstream-io/devstream/pkg/util/log"
11+
)
12+
313
var (
414
configFilePath string
515
pluginDir string
@@ -11,3 +21,24 @@ const (
1121
pluginDirFlagName = "plugin-dir"
1222
defaultPluginDir = "~/.devstream/plugins"
1323
)
24+
25+
func checkConfigFile() {
26+
if strings.TrimSpace(configFilePath) == "" {
27+
log.Errorf(`Config file is required. You could use "-f filename" or "-f directory" to specify it.`)
28+
os.Exit(1)
29+
}
30+
}
31+
32+
func addFlagConfigFile(cmd *cobra.Command) {
33+
cmd.Flags().StringVarP(&configFilePath, configFlagName, "f", "", "config file or directory")
34+
completion.FlagFilenameCompletion(cmd, configFlagName)
35+
}
36+
37+
func addFlagPluginDir(cmd *cobra.Command) {
38+
cmd.Flags().StringVarP(&pluginDir, pluginDirFlagName, "d", defaultPluginDir, "plugins directory")
39+
completion.FlagDirnameCompletion(cmd, pluginDirFlagName)
40+
}
41+
42+
func addFlagContinueDirectly(cmd *cobra.Command) {
43+
cmd.Flags().BoolVarP(&continueDirectly, "yes", "y", false, "continue directly without confirmation")
44+
}

cmd/devstream/delete.go

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import (
55

66
"github.com/spf13/cobra"
77

8-
"github.com/devstream-io/devstream/internal/pkg/completion"
98
"github.com/devstream-io/devstream/internal/pkg/pluginengine"
109
"github.com/devstream-io/devstream/pkg/util/log"
1110
)
@@ -21,6 +20,7 @@ DevStream will delete everything defined in the config file, regardless of the s
2120
}
2221

2322
func deleteCMDFunc(cmd *cobra.Command, args []string) {
23+
checkConfigFile()
2424
log.Info("Delete started.")
2525
if err := pluginengine.Remove(configFilePath, continueDirectly, isForceDelete); err != nil {
2626
log.Errorf("Delete error: %s.", err)
@@ -31,11 +31,9 @@ func deleteCMDFunc(cmd *cobra.Command, args []string) {
3131
}
3232

3333
func init() {
34-
deleteCMD.Flags().BoolVarP(&isForceDelete, "force", "", false, "force delete by config")
35-
deleteCMD.Flags().StringVarP(&configFilePath, configFlagName, "f", "config.yaml", "config file")
36-
deleteCMD.Flags().StringVarP(&pluginDir, pluginDirFlagName, "d", defaultPluginDir, "plugins directory")
37-
deleteCMD.Flags().BoolVarP(&continueDirectly, "yes", "y", false, "delete directly without confirmation")
34+
addFlagConfigFile(deleteCMD)
35+
addFlagPluginDir(deleteCMD)
36+
addFlagContinueDirectly(deleteCMD)
3837

39-
completion.FlagFilenameCompletion(deleteCMD, configFlagName)
40-
completion.FlagDirnameCompletion(deleteCMD, pluginDirFlagName)
38+
deleteCMD.Flags().BoolVarP(&isForceDelete, "force", "", false, "force delete by config")
4139
}

0 commit comments

Comments
 (0)