Merge pull request #2684 from mitchellh/docs-atlas-names

Added a note to the push docs about dot being disallowed in atlas names
This commit is contained in:
Mark Peek 2015-10-23 17:46:24 -07:00
commit 62fd4df0a7
2 changed files with 13 additions and 1 deletions

View File

@ -6,6 +6,7 @@ import (
"os"
"os/signal"
"path/filepath"
"regexp"
"strings"
"github.com/hashicorp/atlas-go/archive"
@ -16,6 +17,11 @@ import (
// archiveTemplateEntry is the name the template always takes within the slug.
const archiveTemplateEntry = ".packer-template"
var (
reName = regexp.MustCompile("^[a-zA-Z0-9-_/]+$")
errInvalidName = fmt.Errorf("Your build name can only contain these characters: [a-zA-Z0-9-_]+")
)
type PushCommand struct {
Meta
@ -88,6 +94,11 @@ func (c *PushCommand) Run(args []string) int {
return 1
}
if !reName.MatchString(name) {
c.Ui.Error(errInvalidName.Error())
return 1
}
// Determine our token
if token == "" {
token = push.Token

View File

@ -38,7 +38,8 @@ each category, the available configuration keys are alphabetized.
### Required
- `name` (string) - Name of the build configuration in the build service. If
this doesn't exist, it will be created (by default).
this doesn't exist, it will be created (by default). Note that the name can
cannot contain dots. `[a-zA-Z0-9-_/]+` are safe.
### Optional