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

Commit

Permalink
check if ship yml
Browse files Browse the repository at this point in the history
  • Loading branch information
Rob0h committed Nov 6, 2018
1 parent 5dcc2ff commit 41f1d95
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
8 changes: 4 additions & 4 deletions pkg/specs/apptype/determine_type.go
Expand Up @@ -79,6 +79,7 @@ func (r *inspector) DetermineApplicationType(
}

upstream, subdir, isSingleFile := gogetter.UntreeGithub(upstream)
isSingleFile = gogetter.IsShipYaml(upstream)
if gogetter.IsGoGettable(upstream) {
// get with go-getter
fetcher := gogetter.GoGetter{Logger: r.logger, FS: r.fs, Subdir: subdir, IsSingleFile: isSingleFile}
Expand Down Expand Up @@ -137,10 +138,9 @@ func (r *inspector) determineTypeFromContents(
if err != nil {
return "", "", errors.Wrapf(err, "check for %s", filename)
}
}

if isReplicatedApp {
return "inline.replicated.app", finalPath, nil
if isReplicatedApp {
return "inline.replicated.app", finalPath, nil
}
}

// if there's a Chart.yaml, assume its a chart
Expand Down
5 changes: 5 additions & 0 deletions pkg/specs/gogetter/go_getter.go
Expand Up @@ -96,3 +96,8 @@ func UntreeGithub(path string) (string, string, bool) {
}
return fmt.Sprintf("github.com/%s/%s?ref=%s//", githubURL.Owner, githubURL.Repo, githubURL.Ref), githubURL.Subdir, githubURL.IsBlob
}

func IsShipYaml(path string) bool {
base := filepath.Base(path)
return base == "ship.yaml" || base == "ship.yml"
}

0 comments on commit 41f1d95

Please sign in to comment.