No Description
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

release.js 1.0KB

123456789101112131415161718192021222324252627282930
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", { value: true });
  3. exports.release = void 0;
  4. const clc = require("colorette");
  5. const rtdb = require("../../rtdb");
  6. const utils = require("../../utils");
  7. function release(context) {
  8. if (!context.projectId ||
  9. !context.database ||
  10. !context.database.deploys ||
  11. !context.database.ruleFiles) {
  12. return Promise.resolve();
  13. }
  14. const deploys = context.database.deploys;
  15. const ruleFiles = context.database.ruleFiles;
  16. utils.logBullet(clc.bold(clc.cyan("database: ")) + "releasing rules...");
  17. return Promise.all(deploys.map((deploy) => {
  18. return rtdb
  19. .updateRules(context.projectId, deploy.instance, ruleFiles[deploy.rules], {
  20. dryRun: false,
  21. })
  22. .then(() => {
  23. utils.logSuccess(clc.bold(clc.green("database: ")) +
  24. "rules for database " +
  25. clc.bold(deploy.instance) +
  26. " released successfully");
  27. });
  28. }));
  29. }
  30. exports.release = release;