Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: uds dev deploy beta note, packages flag, skip sbom #557

Merged
merged 2 commits into from
Apr 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion adr/0004-tui.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# 3. Terminal User Interface (TUI)
# 4. Terminal User Interface (TUI)

Date: 22 March 2024

Expand Down
3 changes: 3 additions & 0 deletions src/cmd/dev.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ var devDeployCmd = &cobra.Command{
Use: "deploy",
Args: cobra.MaximumNArgs(1),
Short: lang.CmdDevDeployShort,
Long: lang.CmdDevDeployLong,
PreRun: func(_ *cobra.Command, args []string) {
setBundleFile(args)
},
Expand All @@ -44,6 +45,7 @@ var devDeployCmd = &cobra.Command{

config.CommonOptions.Confirm = true
bundleCfg.CreateOpts.SourceDirectory = srcDir

configureZarf()

// load uds-config if it exists
Expand Down Expand Up @@ -78,4 +80,5 @@ func init() {
initViper()
rootCmd.AddCommand(devCmd)
devCmd.AddCommand(devDeployCmd)
devDeployCmd.Flags().StringArrayVarP(&bundleCfg.DeployOpts.Packages, "packages", "p", []string{}, lang.CmdBundleDeployFlagPackages)
}
3 changes: 2 additions & 1 deletion src/config/lang/lang.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,5 +83,6 @@ const (

// uds dev
CmdDevShort = "Commands useful for developing bundles"
CmdDevDeployShort = "Creates and deploys a dev UDS bundle from a given directory"
CmdDevDeployShort = "[beta] Creates and deploys a UDS bundle from a given directory in dev mode"
CmdDevDeployLong = "[beta] Creates and deploys a UDS bundle from a given directory in dev mode, setting package options like YOLO mode for faster iteration."
)
2 changes: 1 addition & 1 deletion src/pkg/bundle/dev.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ func (b *Bundle) CreateZarfPkgs() {
}
// create local zarf package if it doesn't exist
if !packageFound {
os.Args = []string{"zarf", "package", "create", path, "--confirm", "-o", path}
os.Args = []string{"zarf", "package", "create", path, "--confirm", "-o", path, "--skip-sbom"}
zarfCLI.Execute()
if err != nil {
message.Fatalf(err, "Failed to create package %s: %s", pkg.Name, err.Error())
Expand Down
9 changes: 8 additions & 1 deletion src/test/e2e/commands_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,14 @@ func deployWithTUI(t *testing.T, source string) (stdout string, stderr string) {
}

func devDeploy(t *testing.T, tarballPath string) (stdout string, stderr string) {
cmd := strings.Split(fmt.Sprintf("dev deploy %s --no-tea", tarballPath), " ")
cmd := strings.Split(fmt.Sprintf("dev deploy %s", tarballPath), " ")
stdout, stderr, err := e2e.UDS(cmd...)
require.NoError(t, err)
return stdout, stderr
}

func devDeployPackages(t *testing.T, tarballPath string, packages string) (stdout string, stderr string) {
cmd := strings.Split(fmt.Sprintf("dev deploy %s --packages %s", tarballPath, packages), " ")
stdout, stderr, err := e2e.UDS(cmd...)
require.NoError(t, err)
return stdout, stderr
Expand Down
4 changes: 2 additions & 2 deletions src/test/e2e/dev_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,11 @@ func TestDevDeploy(t *testing.T) {
bundleDir := "src/test/bundles/03-local-and-remote"
bundlePath := filepath.Join(bundleDir, fmt.Sprintf("uds-bundle-test-local-and-remote-%s-0.0.1.tar.zst", e2e.Arch))

devDeploy(t, bundleDir)
devDeployPackages(t, bundleDir, "podinfo")

deployments, _, _ := e2e.UDS(cmd...)
require.Contains(t, deployments, "podinfo")
require.Contains(t, deployments, "nginx")
require.NotContains(t, deployments, "nginx")

remove(t, bundlePath)
})
Expand Down
Loading