Include infrastructure for static files to be included in binary

This commit is contained in:
Gregory Kurtzer
2020-12-04 22:11:14 -08:00
parent 4e93745bc6
commit 30a86ea8ac
6 changed files with 130 additions and 0 deletions

View File

@@ -0,0 +1,11 @@
#!/bin/sh
if ! test -x $GOPATH/bin/implant; then
IMPLANT_GIT="https://github.com/skx/implant"
(mkdir -p $HOME/git; cd $HOME/git; git clone $IMPLANT_GIT; cd implant; go install)
fi
$GOPATH/bin/implant -verbose -package staticfiles -input files

Binary file not shown.

Binary file not shown.

Binary file not shown.

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,16 @@
package staticfiles
import (
"github.com/hpcng/warewulf/internal/pkg/wwlog"
"io/ioutil"
)
func WriteData(source string, dest string) error {
bytes, err := getResource(source)
err = ioutil.WriteFile(dest, bytes, 0644)
if err != nil {
wwlog.Printf(wwlog.ERROR, "Failed writing %s to: %s\n", dest, err)
return err
}
return nil
}