-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add init command and a data schema file
- Loading branch information
Showing
3 changed files
with
105 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
package cmd | ||
|
||
import ( | ||
"github.com/rs/zerolog/log" | ||
"github.com/spf13/cobra" | ||
|
||
"github.com/mykso/myks/internal/myks" | ||
) | ||
|
||
func init() { | ||
cmd := &cobra.Command{ | ||
Use: "init", | ||
Short: "Initialize new myks project", | ||
Long: "Initialize new myks project", | ||
Run: func(cmd *cobra.Command, args []string) { | ||
g := myks.New(".") | ||
|
||
if err := g.Bootstrap(); err != nil { | ||
log.Fatal().Err(err).Msg("Failed to initialize project") | ||
} | ||
}, | ||
} | ||
|
||
rootCmd.AddCommand(cmd) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
#! This file define a schema for all ytt data files. It can also contain default values. | ||
#! Top-level keys are scopes, e.g. application, argocd, environment, helm. | ||
#! Content of the `application` scope can be freely modified. More scopes can be added. | ||
#! The `environment`, `helm` and `argocd` scopes are used by myks and should not be modified. | ||
#! However, more keys can be added to these scopes. | ||
|
||
#@data/values-schema | ||
--- | ||
#! Add here any application-specific data. | ||
application: {} | ||
environment: | ||
#! Unique identifier of the environment, required by myks. | ||
#@schema/validation min_len=1 | ||
id: "" | ||
#! Configuration of the step that renders Helm charts. | ||
helm: | ||
#! Used by myks. | ||
#! If true, adds `--include-crds` flag to `helm template`. | ||
includeCRDs: true | ||
#! Used by myks. | ||
#! If defined, passed as a value of `--kube-version` for `helm template`. | ||
kubeVersion: "" | ||
#! Used by myks. | ||
#! If defined, passed as a value of `--namespace` for `helm template`. | ||
namespace: "" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters