Skip to content

Commit

Permalink
Merge pull request #601 from devstream-io/main
Browse files Browse the repository at this point in the history
Merge latest main to release-0.6 for docs update
  • Loading branch information
Tiexin Guo authored May 25, 2022
2 parents 33b7939 + 99bf60b commit 878a8d9
Show file tree
Hide file tree
Showing 38 changed files with 329 additions and 41 deletions.
7 changes: 3 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@

SELF_DIR=$(dir $(lastword $(MAKEFILE_LIST)))

GOOS=$(shell go env GOOS)
GOPATH=$(shell go env GOPATH)
GOARCH=$(shell go env GOARCH)
GO_PLUGIN_BUILD=go build -buildmode=plugin -trimpath -gcflags="all=-N -l"
PLUGINS=$(notdir $(wildcard $(ROOT_DIR)/cmd/plugin/*))
Expand Down Expand Up @@ -76,9 +75,9 @@ md5-plugin.%:
.PHONY: fmt
fmt: ## Run 'go fmt' & goimports against code.
@echo ">>>>>>>>>>>> Formating codes"
@go install golang.org/x/tools/cmd/goimports@latest
@[[ -e ${GOPATH}/bin/goimports ]] || (echo "installing goimports ..." && go install golang.org/x/tools/cmd/goimports@latest)
@$(FIND) -type f | xargs gofmt -s -w
@$(FIND) -type f | xargs goimports -w -local $(DTM_ROOT)
@$(FIND) -type f | xargs ${GOPATH}/bin/goimports -w -local $(DTM_ROOT)

.PHONY: vet
vet: ## Run "go vet ./...".
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@

TL;DR: DevStream (CLI tool named `dtm`) is an open-source DevOps toolchain manager.

[v0.6.0 Demo](https://www.youtube.com/watch?v=q7TK3vFr1kg)

Imagine you are starting a new project or ramping up a new team. Before writing the first line of code, you have to figure out the tools to run an effective SDLC process and from development to deployment.

Typically, you'd need the following pieces in place to work effectively:
Expand Down
5 changes: 5 additions & 0 deletions cmd/devstream/apply.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,8 @@ func applyCMDFunc(cmd *cobra.Command, args []string) {
}
log.Success("Apply finished.")
}
func init() {
applyCMD.Flags().StringVarP(&configFile, "config-file", "f", "config.yaml", "config file")
applyCMD.Flags().StringVarP(&pluginDir, "plugin-dir", "d", pluginengine.DefaultPluginDir, "plugins directory")
applyCMD.Flags().BoolVarP(&continueDirectly, "yes", "y", false, "apply directly without confirmation")
}
7 changes: 7 additions & 0 deletions cmd/devstream/common.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package main

var (
configFile string
pluginDir string
continueDirectly bool
)
7 changes: 6 additions & 1 deletion cmd/devstream/delete.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ import (
"github.com/devstream-io/devstream/pkg/util/log"
)

var isForceDelete bool

var deleteCMD = &cobra.Command{
Use: "delete",
Short: "Delete DevOps tools according to DevStream configuration file",
Expand All @@ -28,5 +30,8 @@ func deleteCMDFunc(cmd *cobra.Command, args []string) {
}

func init() {
deleteCMD.PersistentFlags().BoolVarP(&isForceDelete, "force", "", false, "force delete by config")
deleteCMD.Flags().BoolVarP(&isForceDelete, "force", "", false, "force delete by config")
deleteCMD.Flags().StringVarP(&configFile, "config-file", "f", "config.yaml", "config file")
deleteCMD.Flags().StringVarP(&pluginDir, "plugin-dir", "d", pluginengine.DefaultPluginDir, "plugins directory")
deleteCMD.Flags().BoolVarP(&continueDirectly, "yes", "y", false, "delete directly without confirmation")
}
5 changes: 5 additions & 0 deletions cmd/devstream/destroy.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,8 @@ func destroyCMDFunc(cmd *cobra.Command, args []string) {
}
log.Success("Destroy finished.")
}

func init() {
destroyCMD.Flags().StringVarP(&configFile, "config-file", "f", "config.yaml", "config file")
destroyCMD.Flags().BoolVarP(&continueDirectly, "yes", "y", false, "destroy directly without confirmation")
}
6 changes: 6 additions & 0 deletions cmd/devstream/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"github.com/spf13/cobra"

"github.com/devstream-io/devstream/internal/pkg/configloader"
"github.com/devstream-io/devstream/internal/pkg/pluginengine"
"github.com/devstream-io/devstream/internal/pkg/pluginmanager"
"github.com/devstream-io/devstream/pkg/util/log"
)
Expand All @@ -30,3 +31,8 @@ func initCMDFunc(cmd *cobra.Command, args []string) {

log.Success("Initialize finished.")
}

func init() {
initCMD.Flags().StringVarP(&configFile, "config-file", "f", "config.yaml", "config file")
initCMD.Flags().StringVarP(&pluginDir, "plugin-dir", "d", pluginengine.DefaultPluginDir, "plugins directory")
}
15 changes: 4 additions & 11 deletions cmd/devstream/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,11 @@ import (
"github.com/spf13/cobra"
"github.com/spf13/viper"

"github.com/devstream-io/devstream/internal/pkg/pluginengine"
"github.com/devstream-io/devstream/pkg/util/log"
)

var (
configFile string
pluginDir string
continueDirectly bool
isDebug bool
isForceDelete bool

isDebug bool
rootCMD = &cobra.Command{
Use: "dtm",
Short: `DevStream is an open-source DevOps toolchain manager`,
Expand All @@ -39,10 +33,6 @@ var (

func init() {
cobra.OnInitialize(initConfig)

rootCMD.PersistentFlags().StringVarP(&configFile, "config-file", "f", "config.yaml", "config file")
rootCMD.PersistentFlags().StringVarP(&pluginDir, "plugin-dir", "d", pluginengine.DefaultPluginDir, "plugins directory")
rootCMD.PersistentFlags().BoolVarP(&continueDirectly, "yes", "y", false, "apply/delete directly without confirmation")
rootCMD.PersistentFlags().BoolVarP(&isDebug, "debug", "", false, "debug level log")
rootCMD.AddCommand(versionCMD)
rootCMD.AddCommand(initCMD)
Expand Down Expand Up @@ -90,6 +80,9 @@ func initConfig() {
if err := viper.BindPFlags(showStatusCMD.Flags()); err != nil {
log.Fatal(err)
}
if err := viper.BindPFlags(initCMD.Flags()); err != nil {
log.Fatal(err)
}
}

func initLog() {
Expand Down
12 changes: 8 additions & 4 deletions cmd/devstream/show.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package main
import (
"github.com/spf13/cobra"

"github.com/devstream-io/devstream/internal/pkg/pluginengine"
"github.com/devstream-io/devstream/internal/pkg/show/config"
"github.com/devstream-io/devstream/internal/pkg/show/status"
"github.com/devstream-io/devstream/pkg/util/log"
Expand Down Expand Up @@ -56,8 +57,11 @@ func init() {
showCMD.AddCommand(showConfigCMD)
showCMD.AddCommand(showStatusCMD)

showConfigCMD.PersistentFlags().StringVarP(&plugin, "plugin", "p", "", "specify name with the plugin")
showStatusCMD.PersistentFlags().StringVarP(&plugin, "plugin", "p", "", "specify name with the plugin")
showStatusCMD.PersistentFlags().StringVarP(&instanceID, "id", "i", "", "specify id with the plugin instance")
showStatusCMD.PersistentFlags().BoolVarP(&statusAllFlag, "all", "a", false, "show all instances of all plugins status")
showConfigCMD.Flags().StringVarP(&plugin, "plugin", "p", "", "specify name with the plugin")

showStatusCMD.Flags().StringVarP(&plugin, "plugin", "p", "", "specify name with the plugin")
showStatusCMD.Flags().StringVarP(&instanceID, "id", "i", "", "specify id with the plugin instance")
showStatusCMD.Flags().BoolVarP(&statusAllFlag, "all", "a", false, "show all instances of all plugins status")
showStatusCMD.Flags().StringVarP(&pluginDir, "plugin-dir", "d", pluginengine.DefaultPluginDir, "plugins directory")
showStatusCMD.Flags().StringVarP(&configFile, "config-file", "f", "config.yaml", "config file")
}
5 changes: 5 additions & 0 deletions cmd/devstream/verify.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,8 @@ func verifyCMDFunc(cmd *cobra.Command, args []string) {
log.Info("Verify finished.")
}
}

func init() {
verifyCMD.Flags().StringVarP(&configFile, "config-file", "f", "config.yaml", "config file")
verifyCMD.Flags().StringVarP(&pluginDir, "plugin-dir", "d", pluginengine.DefaultPluginDir, "plugins directory")
}
2 changes: 2 additions & 0 deletions docs/README_zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
## DevStream 是什么?
TL;DR: DevStream(CLI工具名为`dtm`)是一个开源的DevOps工具链管理器。

[v0.6.0 Demo](https://www.bilibili.com/video/BV1W3411P7oW/)

想象你正在开始一个新的项目或组建一个新的团队。在写第一行代码之前,你需要一个能够高效运转SDLC(软件开发生命周期)和承载开发至部署全过程的工具。

通常情况下,你需要以下几个部分来高效地工作。
Expand Down
180 changes: 180 additions & 0 deletions docs/assets/versions.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,180 @@
.md-header__title {
display: flex;
}

.dropdown-caret {
display: inline-block !important;
position: absolute;
right: 4px;
}

.fa .fa-caret-down {
display: none !important;
}

.rst-other-versions {
text-align: left;
}

.rst-other-versions > dl, .rst-other-versions dt, .rst-other-versions small {
display: none;
}

.rst-other-versions > dl:first-child {
display: flex !important;
flex-direction: column;
line-height: 0px !important;
}

.rst-versions.shift-up .rst-other-versions {
display: flex !important;
}

.rst-versions .rst-other-versions {
display: none;
}

/* Version Warning */
div[data-md-component=announce] {
background-color: rgb(248, 243, 236);
position: sticky;
top: 0;
z-index: 2;
}
div[data-md-component=announce]>div#announce-msg{
color:green;
font-size: .8rem;
text-align: center;
margin: 15px;
}
div[data-md-component=announce]>div#announce-msg>a{
color: var(--md-typeset-a-color);
text-decoration: underline;
}

/* from https://assets.readthedocs.org/static/css/badge_only.css,
most styles have to be overriden here */
.rst-versions{
position: relative !important;
bottom: 0;
left: 0;
width: 100px !important;
/* background: hsla(173, 100%, 24%, 1) !important; */
background: #4051b5 !important;
font-family: inherit !important;
z-index: 0 !important;
}
.rst-versions a{
color:#2980B9;
text-decoration:none
}
.rst-versions .rst-badge-small{
display:none
}
.rst-versions .rst-current-version{
padding:12px;
/* background: hsla(173, 100%, 24%, 1) !important; */
background: #4051b5 !important;
display:block;
text-align:right;
font-size:90%;
cursor:pointer;
color: white !important;
*zoom:1
}
.rst-versions .rst-current-version:before,.rst-versions .rst-current-version:after{
display:table;content:""
}
.rst-versions .rst-current-version:after{
clear:both
}
.rst-versions .rst-current-version .fa{
color:#fcfcfc
}
.rst-versions .rst-current-version .fa-caret-down{
display: none;
}
.rst-versions.shift-up .rst-other-versions{
display:block
}
.rst-versions .rst-other-versions{
font-size:90%;
padding-left:12px;
padding-right:12px;
padding-top:0px;
padding-bottom:0px;
color:gray;
display:none
}
.rst-versions .rst-other-versions hr{
display: none !important;
height: 0px !important;
border: 0px;
margin: 0px !important;
padding: 0px;
border-top: none !important;
}
.rst-versions .rst-other-versions dd{
display:inline-block;
margin:0
}
.rst-versions .rst-other-versions dd a{
display:inline-block;
padding: 1em 0em !important;
color:#fcfcfc;
font-size: .6rem !important;
white-space: nowrap;
text-overflow: ellipsis;
overflow: hidden;
width: 80px;
}
.rst-versions .rst-other-versions dd a:hover{
font-size: .7rem !important;
font-weight: bold;
}
.rst-versions.rst-badge{
display: block !important;
width: 100px !important;
bottom: 0px !important;
right: 0px !important;
left:auto;
border:none;
text-align: center !important;
line-height: 0;
}
.rst-versions.rst-badge .icon-book{
display: none;
}
.rst-versions.rst-badge .fa-book{
display: none !important;
}
.rst-versions.rst-badge.shift-up .rst-current-version{
text-align: left !important;
}
.rst-versions.rst-badge.shift-up .rst-current-version .fa-book{
display: none !important;
}
.rst-versions.rst-badge.shift-up .rst-current-version .icon-book{
display: none !important;
}
.rst-versions.rst-badge .rst-current-version{
width: 70px !important;
height: 2.4rem !important;
line-height:2.4rem !important;
padding: 0px 5px !important;
display: inline-block !important;
font-size: .6rem !important;
overflow: hidden !important;
text-overflow: ellipsis !important;
white-space: nowrap !important;
text-align: left !important;
}
@media screen and (max-width: 768px){
.rst-versions{
width:85%;
display:none
}
.rst-versions.shift{
display:block
}
}
Loading

0 comments on commit 878a8d9

Please sign in to comment.