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

Commit

Permalink
Merge pull request #883 from laverya/no-web-flag
Browse files Browse the repository at this point in the history
add a flag to disable web assets
  • Loading branch information
laverya committed Mar 25, 2019
2 parents 7a042f2 + 9541650 commit 356e430
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
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

0 comments on commit 356e430

Please sign in to comment.