From f51bc5f06c16f0307a49cf407334a30cf2237158 Mon Sep 17 00:00:00 2001 From: Jernej Kos Date: Thu, 16 Jan 2025 14:25:52 +0100 Subject: [PATCH] feat(cmd/rofl): Add bundle-post script --- build/rofl/manifest.go | 5 +++-- cmd/rofl/build/build.go | 11 ++++++++++- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/build/rofl/manifest.go b/build/rofl/manifest.go index 6df5706..04099f1 100644 --- a/build/rofl/manifest.go +++ b/build/rofl/manifest.go @@ -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. diff --git a/cmd/rofl/build/build.go b/cmd/rofl/build/build.go index 5d575b6..5cc6fd4 100644 --- a/cmd/rofl/build/build.go +++ b/cmd/rofl/build/build.go @@ -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) @@ -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