balena-cli
Version:
The official balena Command Line Interface
42 lines (40 loc) • 1.57 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
const core_1 = require("@oclif/core");
const _1 = require(".");
const lazy_1 = require("../../utils/lazy");
class ReleaseInvalidateCmd extends core_1.Command {
async run() {
const { args: params } = await this.parse(ReleaseInvalidateCmd);
const balena = (0, lazy_1.getBalenaSdk)();
const release = await balena.models.release.get(params.commitOrId, {
$select: ['id', 'is_invalidated'],
});
if (release.is_invalidated) {
console.log(`Release ${params.commitOrId} is already invalidated!`);
return;
}
await balena.models.release.setIsInvalidated(release.id, true);
console.log(`Release ${params.commitOrId} invalidated`);
}
}
ReleaseInvalidateCmd.description = (0, lazy_1.stripIndent) `
Invalidate a release.
Invalidate a release.
Invalid releases are not automatically deployed to devices tracking the latest
release. For an invalid release to be deployed to a device, the device should be
explicity pinned to that release.
`;
ReleaseInvalidateCmd.examples = [
'$ balena release invalidate a777f7345fe3d655c1c981aa642e5555',
'$ balena release invalidate 1234567',
];
ReleaseInvalidateCmd.args = {
commitOrId: (0, _1.commitOrIdArg)({
description: 'the commit or ID of the release to invalidate',
required: true,
}),
};
ReleaseInvalidateCmd.authenticated = true;
exports.default = ReleaseInvalidateCmd;
//# sourceMappingURL=invalidate.js.map