nodeploy.go (1365B)
1 // Copyright 2019 The Hugo Authors. All rights reserved. 2 // 3 // Licensed under the Apache License, Version 2.0 (the "License"); 4 // you may not use this file except in compliance with the License. 5 // You may obtain a copy of the License at 6 // http://www.apache.org/licenses/LICENSE-2.0 7 // 8 // Unless required by applicable law or agreed to in writing, software 9 // distributed under the License is distributed on an "AS IS" BASIS, 10 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 // See the License for the specific language governing permissions and 12 // limitations under the License. 13 14 //go:build nodeploy 15 // +build nodeploy 16 17 package commands 18 19 import ( 20 "errors" 21 22 "github.com/spf13/cobra" 23 ) 24 25 var _ cmder = (*deployCmd)(nil) 26 27 // deployCmd supports deploying sites to Cloud providers. 28 type deployCmd struct { 29 *baseBuilderCmd 30 } 31 32 func (b *commandsBuilder) newDeployCmd() *deployCmd { 33 cc := &deployCmd{} 34 35 cmd := &cobra.Command{ 36 Use: "deploy", 37 Short: "Deploy your site to a Cloud provider.", 38 Long: `Deploy your site to a Cloud provider. 39 40 See https://gohugo.io/hosting-and-deployment/hugo-deploy/ for detailed 41 documentation. 42 `, 43 RunE: func(cmd *cobra.Command, args []string) error { 44 return errors.New("build without HUGO_BUILD_TAGS=nodeploy to use this command") 45 }, 46 } 47 48 cc.baseBuilderCmd = b.newBuilderBasicCmd(cmd) 49 50 return cc 51 }