write files in system
This commit is contained in:
parent
30c7462a62
commit
eaa208fb6d
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
@ -0,0 +1 @@
|
|||||||
|
.*.sw[po]
|
@ -1,8 +1,8 @@
|
|||||||
# ------------------------------------------------------------------------
|
# ------------------------------------------------------------------------
|
||||||
from mcluseau/golang-builder:1.13.1 as build
|
from mcluseau/golang-builder:1.13.4 as build
|
||||||
|
|
||||||
# ------------------------------------------------------------------------
|
# ------------------------------------------------------------------------
|
||||||
from alpine:3.10
|
from alpine:3.10.3
|
||||||
|
|
||||||
env busybox_v=1.28.1-defconfig-multiarch \
|
env busybox_v=1.28.1-defconfig-multiarch \
|
||||||
arch=x86_64
|
arch=x86_64
|
||||||
|
@ -1,5 +1,10 @@
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
|
import (
|
||||||
|
nconfig "novit.nc/direktil/pkg/config"
|
||||||
|
)
|
||||||
|
|
||||||
type config struct {
|
type config struct {
|
||||||
Layers []string `yaml:"layers"`
|
Layers []string `yaml:"layers"`
|
||||||
|
Files []nconfig.FileDef `yaml:"files"`
|
||||||
}
|
}
|
||||||
|
9
main.go
9
main.go
@ -127,6 +127,15 @@ func main() {
|
|||||||
fatal("failed: ", err)
|
fatal("failed: ", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// - write files
|
||||||
|
for _, fileDef := range cfg.Files {
|
||||||
|
log.Print("writing ", fileDef.Path)
|
||||||
|
|
||||||
|
filePath := filepath.Join("/system", fileDef.Path)
|
||||||
|
|
||||||
|
ioutil.WriteFile(filePath, []byte(fileDef.Content), fileDef.Mode)
|
||||||
|
}
|
||||||
|
|
||||||
// clean zombies
|
// clean zombies
|
||||||
cleanZombies()
|
cleanZombies()
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user