Skip to content

Commit

Permalink
(feat) build
Browse files Browse the repository at this point in the history
  • Loading branch information
David Castaneda committed Jan 2, 2021
1 parent 3236b7f commit 7f6dfed
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 21 deletions.
21 changes: 11 additions & 10 deletions dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

9 changes: 8 additions & 1 deletion lib/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,13 @@ const fs_1 = require("fs");
const readFile = fs_1.promises.readFile;
const resolveConfig = (path) => __awaiter(void 0, void 0, void 0, function* () {
const rawConfig = yield readFile(path, "utf8");
return JSON.parse(rawConfig);
const config = JSON.parse(rawConfig);
if (config.tag == null) {
config.tag = "latest";
}
if (config.scale == null) {
config.scale = 1;
}
return config;
});
exports.resolveConfig = resolveConfig;
12 changes: 3 additions & 9 deletions lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,20 +36,14 @@ const run = () => __awaiter(void 0, void 0, void 0, function* () {
const token = core.getInput("token");
const file = core.getInput("file");
const config = yield config_1.resolveConfig(file);
if (config.scale == null) {
config.scale = 1;
}
core.startGroup("Deployment setup");
core.info(`Deploying to Krane instance ${url}`);
core.info(` Deployment configuration \n${JSON.stringify(config, null, 2)}`);
core.endGroup();
core.info(` Deployment configuration:\n${JSON.stringify(config, null, 2)}`);
const client = new common_1.KraneClient(url, token);
core.startGroup("Save deployment configuration");
core.startGroup(`Save ${config.name} configuration`);
core.info(`Saving ${config.name} configuration`);
yield client.saveDeployment(config);
core.info(`Configuration for ${config.name} saved succesfully`);
core.endGroup();
core.startGroup("Run deployment");
core.startGroup(`Trigger deployment ${config.name}`);
core.info(`Triggering new run for ${config.name}`);
yield client.runDeployment(config.name);
core.info(`Deployment ${config.name} triggered succesfully`);
Expand Down

0 comments on commit 7f6dfed

Please sign in to comment.