mirror of
https://github.com/kairos-io/kairos-agent.git
synced 2025-06-03 01:44:53 +00:00
sparkles: Add manual-install
This commit is contained in:
parent
b7fec41fe3
commit
d7e6e9efa4
@ -37,6 +37,16 @@ func optsToArgs(options map[string]string) (res []string) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func ManualInstall(config string, options map[string]string) error {
|
||||||
|
dat, err := ioutil.ReadFile(config)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
options["cc"] = string(dat)
|
||||||
|
|
||||||
|
return RunInstall(options)
|
||||||
|
}
|
||||||
|
|
||||||
func Install(dir ...string) error {
|
func Install(dir ...string) error {
|
||||||
utils.OnSignal(func() {
|
utils.OnSignal(func() {
|
||||||
svc, err := machine.Getty(1)
|
svc, err := machine.Getty(1)
|
||||||
@ -156,8 +166,6 @@ func Install(dir ...string) error {
|
|||||||
r["cc"] = config.AddHeader(header, string(out))
|
r["cc"] = config.AddHeader(header, string(out))
|
||||||
|
|
||||||
pterm.Info.Println("Starting installation")
|
pterm.Info.Println("Starting installation")
|
||||||
utils.SH("elemental run-stage c3os-install.pre") //nolint:errcheck
|
|
||||||
events.RunHookScript("/usr/bin/c3os-agent.install.pre.hook") //nolint:errcheck
|
|
||||||
|
|
||||||
if err := RunInstall(r); err != nil {
|
if err := RunInstall(r); err != nil {
|
||||||
return err
|
return err
|
||||||
@ -177,6 +185,9 @@ func Install(dir ...string) error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func RunInstall(options map[string]string) error {
|
func RunInstall(options map[string]string) error {
|
||||||
|
utils.SH("elemental run-stage c3os-install.pre") //nolint:errcheck
|
||||||
|
events.RunHookScript("/usr/bin/c3os-agent.install.pre.hook") //nolint:errcheck
|
||||||
|
|
||||||
f, _ := ioutil.TempFile("", "xxxx")
|
f, _ := ioutil.TempFile("", "xxxx")
|
||||||
defer os.RemoveAll(f.Name())
|
defer os.RemoveAll(f.Name())
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user