|
|
@@ -5,6 +5,7 @@ import (
|
|
|
"fmt"
|
|
|
"io/ioutil"
|
|
|
"net/url"
|
|
|
+ "os"
|
|
|
"path/filepath"
|
|
|
"regexp"
|
|
|
"strings"
|
|
|
@@ -41,6 +42,16 @@ func (a *Agent) Build(ctx context.Context, opts *docker.BuildOpts, buildConfig *
|
|
|
return err
|
|
|
}
|
|
|
|
|
|
+ mode := os.FileMode(0o600)
|
|
|
+ procfilePath := filepath.Clean(filepath.Join(absPath, "Procfile"))
|
|
|
+ file, err := os.OpenFile(procfilePath, os.O_RDONLY|os.O_CREATE, mode)
|
|
|
+ if err != nil {
|
|
|
+ return err
|
|
|
+ }
|
|
|
+ if err := file.Close(); err != nil {
|
|
|
+ return err
|
|
|
+ }
|
|
|
+
|
|
|
buildOpts := packclient.BuildOptions{
|
|
|
RelativeBaseDir: filepath.Dir(absPath),
|
|
|
Image: fmt.Sprintf("%s:%s", opts.ImageRepo, opts.Tag),
|