Skip to content

Commit 5020618

Browse files
author
Matthew Fisher
committed
Merge pull request #77 from deis/76-remove-extract-domain
ref(pkg): remove extract-domain
2 parents b88e6ed + fb75fcf commit 5020618

6 files changed

Lines changed: 2 additions & 67 deletions

File tree

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ BINARY_DEST_DIR := rootfs/usr/bin
1717
# Common flags passed into Go's linker.
1818
LDFLAGS := "-s -X main.version=${VERSION}"
1919
IMAGE_PREFIX ?= deis
20-
BINARIES := extract-domain extract-types extract-version generate-buildhook get-app-config get-app-values publish-release-controller yaml2json-procfile
20+
BINARIES := extract-types extract-version generate-buildhook get-app-config get-app-values publish-release-controller yaml2json-procfile
2121
STANDALONE := extract-types generate-buildhook yaml2json-procfile
2222
# Docker Root FS
2323
BINDIR := ./rootfs

pkg/src/extract-domain.go

Lines changed: 0 additions & 31 deletions
This file was deleted.

pkg/types.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ type BuildHook struct {
2929
// BuildHookResponse represents a controller's build-hook response object.
3030
type BuildHookResponse struct {
3131
Release map[string]int `json:"release"`
32-
Domains []string `json:"domains"`
3332
}
3433

3534
// Config represents a Deis application's configuration.

pkg/utils.go

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -36,24 +36,6 @@ func ParseConfig(body []byte) (*Config, error) {
3636
return &config, err
3737
}
3838

39-
// ParseDomain returns the domain field from the bytes of a build hook response.
40-
func ParseDomain(bytes []byte) (string, error) {
41-
var hook BuildHookResponse
42-
if err := json.Unmarshal(bytes, &hook); err != nil {
43-
return "", err
44-
}
45-
46-
if hook.Domains == nil {
47-
return "", fmt.Errorf("invalid application domain")
48-
}
49-
50-
if len(hook.Domains) < 1 {
51-
return "", fmt.Errorf("invalid application domain")
52-
}
53-
54-
return hook.Domains[0], nil
55-
}
56-
5739
// ParseReleaseVersion returns the version field from the bytes of a build hook response.
5840
func ParseReleaseVersion(bytes []byte) (int, error) {
5941
var hook BuildHookResponse

pkg/utils_test.go

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -86,20 +86,6 @@ func TestParseConfigGood(t *testing.T) {
8686
}
8787
}
8888

89-
func TestParseDomainGood(t *testing.T) {
90-
// mock controller build-hook response
91-
resp := []byte(`{"release": {"version": 1},
92-
"domains": ["test.example.com", "test2.example.com"]}`)
93-
94-
domain, err := ParseDomain(resp)
95-
if err != nil {
96-
t.Errorf("expected to parse domain, got '%v'", err)
97-
}
98-
if domain != "test.example.com" {
99-
t.Errorf("expected 'test.example.com', got '%s'", domain)
100-
}
101-
}
102-
10389
func TestParseReleaseVersionGood(t *testing.T) {
10490
// mock controller build-hook response
10591
resp := []byte(`{"release": {"version": 1},

rootfs/etc/confd/templates/builder

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -196,10 +196,9 @@ if [ $CODE -ne 0 ]; then
196196
fi
197197

198198
RELEASE=$(echo $PUBLISH_RELEASE | extract-version)
199-
DOMAIN=$(echo $PUBLISH_RELEASE | extract-domain)
200199
indent "done, $APP_NAME:v$RELEASE deployed to Deis"
201200
echo
202-
indent "http://$DOMAIN"
201+
indent "Use \`deis open\` to view this application in your browser."
203202
echo
204203
indent "To learn more, use \`deis help\` or visit http://deis.io"
205204
echo

0 commit comments

Comments
 (0)