Remove ts-ignore
parent
2c892a612e
commit
110b8ed402
|
|
@ -37,32 +37,34 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|||
};
|
||||
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
||||
const core = __importStar(__webpack_require__(42186));
|
||||
// @ts-ignore
|
||||
const model_1 = __webpack_require__(41359);
|
||||
function run() {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
model_1.Action.checkCompatibility();
|
||||
model_1.Cache.verify();
|
||||
const { dockerfile, workspace, actionFolder } = model_1.Action;
|
||||
const buildParameters = yield model_1.BuildParameters.create();
|
||||
const baseImage = new model_1.ImageTag(buildParameters);
|
||||
if (buildParameters.kubeConfig) {
|
||||
core.info('Building with Kubernetes');
|
||||
yield model_1.Kubernetes.runBuildJob(buildParameters, baseImage);
|
||||
try {
|
||||
model_1.Action.checkCompatibility();
|
||||
model_1.Cache.verify();
|
||||
const { dockerfile, workspace, actionFolder } = model_1.Action;
|
||||
const buildParameters = yield model_1.BuildParameters.create();
|
||||
const baseImage = new model_1.ImageTag(buildParameters);
|
||||
if (buildParameters.kubeConfig) {
|
||||
core.info('Building with Kubernetes');
|
||||
yield model_1.Kubernetes.runBuildJob(buildParameters, baseImage);
|
||||
}
|
||||
else {
|
||||
// Build docker image
|
||||
// TODO: No image required (instead use a version published to dockerhub for the action, supply credentials for github cloning)
|
||||
const builtImage = yield model_1.Docker.build({ path: actionFolder, dockerfile, baseImage });
|
||||
yield model_1.Docker.run(builtImage, Object.assign({ workspace }, buildParameters));
|
||||
}
|
||||
// Set output
|
||||
yield model_1.Output.setBuildVersion(buildParameters.buildVersion);
|
||||
}
|
||||
else {
|
||||
// Build docker image
|
||||
// TODO: No image required (instead use a version published to dockerhub for the action, supply credentials for github cloning)
|
||||
const builtImage = yield model_1.Docker.build({ path: actionFolder, dockerfile, baseImage });
|
||||
yield model_1.Docker.run(builtImage, Object.assign({ workspace }, buildParameters));
|
||||
catch (error) {
|
||||
core.setFailed(error.message);
|
||||
}
|
||||
// Set output
|
||||
yield model_1.Output.setBuildVersion(buildParameters.buildVersion);
|
||||
});
|
||||
}
|
||||
run().catch((error) => {
|
||||
core.setFailed(error.message);
|
||||
});
|
||||
run();
|
||||
|
||||
|
||||
/***/ }),
|
||||
|
|
@ -1507,7 +1509,6 @@ class Versioning {
|
|||
return __awaiter(this, void 0, void 0, function* () {
|
||||
const description = yield this.getVersionDescription();
|
||||
try {
|
||||
// @ts-ignore
|
||||
const [match, tag, commits, hash] = this.descriptionRegex1.exec(description);
|
||||
return {
|
||||
match,
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
42
src/index.ts
42
src/index.ts
|
|
@ -1,30 +1,30 @@
|
|||
import * as core from '@actions/core';
|
||||
|
||||
// @ts-ignore
|
||||
import { Action, BuildParameters, Cache, Docker, ImageTag, Kubernetes, Output } from './model';
|
||||
|
||||
async function run() {
|
||||
Action.checkCompatibility();
|
||||
Cache.verify();
|
||||
try {
|
||||
Action.checkCompatibility();
|
||||
Cache.verify();
|
||||
|
||||
const { dockerfile, workspace, actionFolder } = Action;
|
||||
const { dockerfile, workspace, actionFolder } = Action;
|
||||
|
||||
const buildParameters = await BuildParameters.create();
|
||||
const baseImage = new ImageTag(buildParameters);
|
||||
if (buildParameters.kubeConfig) {
|
||||
core.info('Building with Kubernetes');
|
||||
await Kubernetes.runBuildJob(buildParameters, baseImage);
|
||||
} else {
|
||||
// Build docker image
|
||||
// TODO: No image required (instead use a version published to dockerhub for the action, supply credentials for github cloning)
|
||||
const builtImage = await Docker.build({ path: actionFolder, dockerfile, baseImage });
|
||||
await Docker.run(builtImage, { workspace, ...buildParameters });
|
||||
const buildParameters = await BuildParameters.create();
|
||||
const baseImage = new ImageTag(buildParameters);
|
||||
if (buildParameters.kubeConfig) {
|
||||
core.info('Building with Kubernetes');
|
||||
await Kubernetes.runBuildJob(buildParameters, baseImage);
|
||||
} else {
|
||||
// Build docker image
|
||||
// TODO: No image required (instead use a version published to dockerhub for the action, supply credentials for github cloning)
|
||||
const builtImage = await Docker.build({ path: actionFolder, dockerfile, baseImage });
|
||||
await Docker.run(builtImage, { workspace, ...buildParameters });
|
||||
}
|
||||
|
||||
// Set output
|
||||
await Output.setBuildVersion(buildParameters.buildVersion);
|
||||
} catch (error) {
|
||||
core.setFailed(error.message);
|
||||
}
|
||||
|
||||
// Set output
|
||||
await Output.setBuildVersion(buildParameters.buildVersion);
|
||||
}
|
||||
|
||||
run().catch((error) => {
|
||||
core.setFailed(error.message);
|
||||
});
|
||||
run();
|
||||
|
|
|
|||
|
|
@ -171,8 +171,7 @@ export default class Versioning {
|
|||
const description = await this.getVersionDescription();
|
||||
|
||||
try {
|
||||
// @ts-ignore
|
||||
const [match, tag, commits, hash] = this.descriptionRegex1.exec(description);
|
||||
const [match, tag, commits, hash] = this.descriptionRegex1.exec(description) as RegExpExecArray;
|
||||
|
||||
return {
|
||||
match,
|
||||
|
|
@ -182,7 +181,7 @@ export default class Versioning {
|
|||
};
|
||||
} catch {
|
||||
try {
|
||||
const [match, tag, commits, hash] = this.descriptionRegex2.exec(description);
|
||||
const [match, tag, commits, hash] = this.descriptionRegex2.exec(description) as RegExpExecArray;
|
||||
|
||||
return {
|
||||
match,
|
||||
|
|
@ -192,7 +191,7 @@ export default class Versioning {
|
|||
};
|
||||
} catch {
|
||||
try {
|
||||
const [match, tag, commits, hash] = this.descriptionRegex3.exec(description);
|
||||
const [match, tag, commits, hash] = this.descriptionRegex3.exec(description) as RegExpExecArray;
|
||||
|
||||
return {
|
||||
match,
|
||||
|
|
|
|||
Loading…
Reference in New Issue