Make generated run lifecycle autonomous
This commit is contained in:
@@ -8,6 +8,7 @@ import (
|
||||
"context"
|
||||
"encoding/base64"
|
||||
"encoding/hex"
|
||||
"encoding/json"
|
||||
"errors"
|
||||
"fmt"
|
||||
"os"
|
||||
@@ -170,6 +171,17 @@ func (builder *DockerDistributionBuilder) Build(input domain.DistributionBuildIn
|
||||
if err := os.WriteFile(filepath.Join(inputDir, "workspace-seed.json"), seedPayload, 0o600); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
lifecyclePlanPayload := []byte("{}")
|
||||
if input.AutonomousLifecycle != nil {
|
||||
encoded, err := json.Marshal(input.AutonomousLifecycle)
|
||||
if err != nil {
|
||||
return nil, validationError("distribution build input has an invalid autonomous lifecycle plan")
|
||||
}
|
||||
lifecyclePlanPayload = encoded
|
||||
}
|
||||
if err := os.WriteFile(filepath.Join(inputDir, "autonomous-lifecycle-plan.json"), lifecyclePlanPayload, 0o600); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if err := os.WriteFile(filepath.Join(inputDir, "build.sh"), []byte(distributionBuildScript), 0o500); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user