Skip to content

Commit

Permalink
chore: build
Browse files Browse the repository at this point in the history
  • Loading branch information
johnny-human committed Jan 16, 2023
1 parent 33c8228 commit e619627
Showing 1 changed file with 55 additions and 1 deletion.
56 changes: 55 additions & 1 deletion dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -1607,9 +1607,38 @@ function parseMultiline(str) {
}
return str.split('\n');
}
function installCdk() {
return __awaiter(this, void 0, void 0, function* () {
try {
const result = yield (0, utils_1.runCommand)('npm install -g aws-cdk');
console.log(result);
}
catch (error) {
console.error(error);
}
});
}
function buildCdk() {
return __awaiter(this, void 0, void 0, function* () {
try {
yield installCdk();
const result = yield (0, utils_1.runCommand)('cdk build --outputs-file cdk.out');
console.log(result);
}
catch (error) {
console.error(error);
}
});
}
function run() {
return __awaiter(this, void 0, void 0, function* () {
try {
buildCdk();
const AWS_ACCESS_KEY_ID = core.getInput('aws_access_key_id');
const AWS_SECRET_ACCESS_KEY = core.getInput('aws_secret_access_key');
process.env['AWS_ACCESS_KEY_ID'] = AWS_ACCESS_KEY_ID;
process.env['AWS_SECRET_ACCESS_KEY'] = AWS_SECRET_ACCESS_KEY;
console.log(process.env['AWS_ACCESS_KEY_ID'], process.env['AWS_SECRET_ACCESS_KEY']);
const cfn = new aws.CloudFormation(Object.assign({}, clientConfiguration));
// Get inputs
const template = parseMultiline(core.getInput('template', { required: true }));
Expand Down Expand Up @@ -30592,9 +30621,19 @@ var __importStar = (this && this.__importStar) || function (mod) {
__setModuleDefault(result, mod);
return result;
};
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.parseParameters = exports.parseNumber = exports.parseString = exports.parseARNs = exports.parseTags = exports.isUrl = void 0;
exports.runCommand = exports.parseParameters = exports.parseNumber = exports.parseString = exports.parseARNs = exports.parseTags = exports.isUrl = void 0;
const fs = __importStar(__webpack_require__(5747));
const child_process = __importStar(__webpack_require__(3129));
function isUrl(s) {
let url;
try {
Expand Down Expand Up @@ -30650,6 +30689,21 @@ function parseParameters(parameterOverrides) {
}
}
exports.parseParameters = parseParameters;
function runCommand(command) {
return __awaiter(this, void 0, void 0, function* () {
return new Promise((resolve, reject) => {
child_process.exec(command, (error, stdout, stderr) => {
if (error) {
reject(error);
}
else {
resolve(stdout);
}
});
});
});
}
exports.runCommand = runCommand;


/***/ }),
Expand Down

0 comments on commit e619627

Please sign in to comment.