MCPcopy
hub / github.com/dgraph-io/dgraph / buildDgraphBinary

Function buildDgraphBinary

dgraphtest/image.go:211–229  ·  view source on GitHub ↗
(dir, binaryDir, version string)

Source from the content-addressed store, hash-verified

209}
210
211func buildDgraphBinary(dir, binaryDir, version string) error {
212 log.Printf("[INFO] building dgraph binary for version [%v]", version)
213
214 if err := fixGoModIfNeeded(); err != nil {
215 return err
216 }
217
218 cmd := exec.Command("make", "dgraph")
219 cmd.Dir = filepath.Join(dir, "dgraph")
220 cmd.Env = append(os.Environ(), "GOOS=linux", "GOARCH=amd64")
221 if out, err := cmd.CombinedOutput(); err != nil {
222 return errors.Wrapf(err, "error while building dgraph binary\noutput:%v", string(out))
223 }
224 if err := copyFile(filepath.Join(dir, "dgraph", "dgraph"),
225 filepath.Join(binaryDir, fmt.Sprintf(binaryNameFmt, version))); err != nil {
226 return errors.Wrap(err, "error while copying binary")
227 }
228 return nil
229}
230
231func copyBinary(fromDir, toDir, version string) error {
232 binaryName := buildvars.BinaryName.Get()

Callers 1

setupBinaryMethod · 0.85

Calls 2

fixGoModIfNeededFunction · 0.85
copyFileFunction · 0.85

Tested by

no test coverage detected