Skip to content

Commit

Permalink
Merge pull request #8559 from Agoric/kriskowal-and-fudco-hackathon
Browse files Browse the repository at this point in the history
feat(deploy-script-support): Write out bundle file names in machine r…
  • Loading branch information
mergify[bot] authored and mhofman committed Jan 15, 2024
2 parents c28ac48 + cb6f54b commit 72ac135
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 3 deletions.
23 changes: 21 additions & 2 deletions packages/deploy-script-support/src/writeCoreProposal.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,14 +62,21 @@ export const makeWriteCoreProposal = (
return ns.default;
};

const bundles = [];

// Install an entrypoint.
const install = async (entrypoint, bundlePath, opts) => {
const bundle = getBundle(entrypoint, bundlePath);

// Serialise the installations.
mutex = E.when(mutex, () => {
mutex = E.when(mutex, async () => {
// console.log('installing', { filePrefix, entrypoint, bundlePath });
return getBundleSpec(bundle, getBundler, opts);
const spec = await getBundleSpec(bundle, getBundler, opts);
bundles.push({
entrypoint,
...spec,
});
return spec;
});
return mutex;
};
Expand Down Expand Up @@ -125,6 +132,18 @@ const overrideManifest = ${stringify(overrideManifest, true)};
log(`creating ${proposalJsFile}`);
await writeFile(proposalJsFile, trimmed);

const plan = {
name: filePrefix,
script: proposalJsFile,
permit: proposalPermitJsonFile,
bundles,
};

await writeFile(
`${filePrefix}-plan.json`,
`${JSON.stringify(plan, null, 2)}\n`,
);

log(`\
You can now run a governance submission command like:
agd tx gov submit-proposal swingset-core-eval ${proposalPermitJsonFile} ${proposalJsFile} \\
Expand Down
2 changes: 1 addition & 1 deletion packages/internal/src/node/createBundles.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export const createBundlesFromAbsolute = async sourceBundles => {
}
const bundle = match[1];

const args = cacheToArgs.get(cache) || ['--to', cache];
const args = cacheToArgs.get(cache) || ['--cache-js', cache];
args.push(srcPath, bundle);
cacheToArgs.set(cache, args);
}
Expand Down

0 comments on commit 72ac135

Please sign in to comment.