Copy partial configs during deploy script (#447)

buddies-main-deployment
Anna Carroll 3 years ago committed by GitHub
parent 1cdce10eb3
commit cf5917fe39
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 22
      typescript/src/index.ts

@ -422,6 +422,27 @@ export async function deployNChains(chains: Deploy[]) {
writeDeployOutput(chains);
}
/**
* Copies the partial configs from the default directory to the specified directory.
*
* @param dir - relative path to folder where partial configs will be written
*/
export function writePartials(dir: string) {
// make folder if it doesn't exist already
fs.mkdirSync(dir, { recursive: true });
const defaultDir = "../rust/config/default";
const partialNames = ["kathy", "processor", "relayer", "updater", "watcher"];
// copy partial config from default directory to given directory
for (let partialName of partialNames) {
const filename = `${partialName}-partial.json`;
fs.copyFile( `${defaultDir}/${filename}`, `${dir}/${filename}`, (err) => {
if(err) {
console.error(err);
}
});
}
}
/**
* Outputs the values for chains that have been deployed.
*
@ -446,4 +467,5 @@ export function writeDeployOutput(deploys: Deploy[]) {
);
fs.writeFileSync(`${dir}/${name}_contracts.json`, toJson(local.contracts));
}
writePartials(dir);
}

Loading…
Cancel
Save