Skip to content

Commit

Permalink
feat(cmd/rofl): Add bundle-post script
Browse files Browse the repository at this point in the history
  • Loading branch information
kostko committed Jan 16, 2025
1 parent 1983c80 commit f51bc5f
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
5 changes: 3 additions & 2 deletions build/rofl/manifest.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,9 @@ const (

// Well-known scripts.
const (
ScriptBuildPre = "build-pre"
ScriptBuildPost = "build-post"
ScriptBuildPre = "build-pre"
ScriptBuildPost = "build-post"
ScriptBundlePost = "bundle-post"
)

// Manifest is the ROFL app manifest that configures various aspects of the app in a single place.
Expand Down
11 changes: 10 additions & 1 deletion cmd/rofl/build/build.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ var (

// Setup some build environment variables.
os.Setenv("ROFL_MANIFEST", manifest.SourceFileName())
os.Setenv("ROFL_DEPLOYMENT", deploymentName)
os.Setenv("ROFL_DEPLOYMENT_NAME", deploymentName)
os.Setenv("ROFL_DEPLOYMENT_NETWORK", deployment.Network)
os.Setenv("ROFL_DEPLOYMENT_PARATIME", deployment.ParaTime)
os.Setenv("ROFL_TMPDIR", tmpDir)
Expand Down Expand Up @@ -132,6 +132,15 @@ var (
return
}

// Setup some post-bundle environment variables.
os.Setenv("ROFL_BUNDLE", outFn)
for idx, enclaveID := range eids {
data, _ := enclaveID.MarshalText()
os.Setenv(fmt.Sprintf("ROFL_ENCLAVE_ID_%d", idx), string(data))
}

runScript(manifest, buildRofl.ScriptBundlePost)

// Override the update manifest flag in case the policy does not exist.
if deployment.Policy == nil {
doUpdate = false
Expand Down

0 comments on commit f51bc5f

Please sign in to comment.