diff options
Diffstat (limited to 'magefiles/step.go')
| -rw-r--r-- | magefiles/step.go | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/magefiles/step.go b/magefiles/step.go index 0270802..25cf23b 100644 --- a/magefiles/step.go +++ b/magefiles/step.go @@ -46,7 +46,8 @@ func (s Step) Setup() { } func (s Step) Install() error { - return sh.Run( + return sh.RunWithV( + s.env(), "step", "certificate", "install", @@ -57,11 +58,8 @@ func (s Step) Install() error { func (s Step) Server(ctx context.Context) error { mg.SerialDeps(s.Setup) - env := map[string]string{ - "STEPPATH": s.path(), - } return sh.RunWithV( - env, + s.env(), "step-ca", s.pathPlus("config/ca.json"), "--password-file="+s.pathPlus("password.txt"), @@ -94,7 +92,8 @@ func (s Step) createCA() error { return nil } - return sh.Run( + return sh.RunWithV( + s.env(), "step", "ca", "init", @@ -122,7 +121,7 @@ func (s Step) enableACMEProvisioner() error { provisioners := items["authority"].(map[string]interface{})["provisioners"].([]interface{}) if len(provisioners) < 2 { - return sh.Run("step", "ca", "provisioner", "add", "acme", "--type", "ACME") + return sh.RunWithV(s.env(), "step", "ca", "provisioner", "add", "acme", "--type", "ACME") } return nil } @@ -135,6 +134,14 @@ func (s Step) path() string { return env.Fetch("STEPPATH", filepath.Join(x.Must(os.Getwd()), "/tmp/step")) } +func (s Step) env() map[string]string { + return map[string]string{ + "STEPPATH": s.path(), + "HOST": "localhost", + "PORT": "8081", + } +} + func (s Step) pathPlus(path string) string { return filepath.Join(s.path(), path) } |
