Skip to content
This repository has been archived by the owner on Mar 24, 2023. It is now read-only.

add a flag to disable web assets #883

Merged
merged 1 commit into from
Mar 25, 2019
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: 2 additions & 0 deletions pkg/cli/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,8 @@ func RootCmd() *cobra.Command {
cmd.PersistentFlags().String("terraform-exec-path", "terraform", "Path to a terraform executable on the system.")
cmd.PersistentFlags().Bool("terraform-apply-yes", false, "Automatically apply terraform steps in headless mode. By default, terraform will be skipped when ship is running in automation.")

cmd.PersistentFlags().Bool("no-web", false, "Disable web assets")

cmd.PersistentFlags().String("resource-type", "", "upstream application resource type")
cmd.PersistentFlags().BoolP("prefer-git", "", false, "prefer the git protocol instead of using http apis")

Expand Down
4 changes: 4 additions & 0 deletions pkg/lifecycle/render/web/step.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,10 @@ func (p *DefaultStep) Execute(
return func(ctx context.Context) error {
debug.Log("event", "execute")

if p.Viper.GetBool("no-web") {
return errors.New("web assets are disabled when no-web is set")
}

built, err := p.buildAsset(asset, meta, configGroups, templateContext)
if err != nil {
debug.Log("event", "build.fail", "err", err)
Expand Down