Skip to content

Commit

Permalink
create placeholder repositories
Browse files Browse the repository at this point in the history
  • Loading branch information
varshaprasad96 committed Aug 2, 2021
1 parent e959fe4 commit 555b0cb
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
16 changes: 12 additions & 4 deletions pkg/plugins/hybrid/v1alpha/scaffolds/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,9 @@ func (s *initScaffolder) Scaffold() error {
machinery.WithBoilerplate(string(boilerplate)),
)

if err := os.MkdirAll(chartutil.HelmChartsDir, 0755); err != nil {
// create placeholder directories for helm charts and go apis
err = createDirectories([]string{chartutil.HelmChartsDir, "api", "controllers"})
if err != nil {
return err
}

Expand All @@ -131,9 +133,6 @@ func (s *initScaffolder) Scaffold() error {
&templates.DockerIgnore{},
)

// Add note to include any depedencies in dockerfile which are required to build `main.go`.
fmt.Println("Include any dependencies required to build `main.go` in your project to Dockerfile")

if err != nil {
return err
}
Expand All @@ -146,3 +145,12 @@ func (s *initScaffolder) Scaffold() error {

return nil
}

func createDirectories(directories []string) error {
for _, dir := range directories {
if err := os.MkdirAll(dir, 0755); err != nil {
return fmt.Errorf("unable to create directory %q : %v", dir, err)
}
}
return nil
}
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ RUN go mod download
# Copy the go source
COPY main.go main.go
COPY api/ api/
COPY controllers/ controllers/
# Build
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -a -o manager main.go
Expand Down

0 comments on commit 555b0cb

Please sign in to comment.