[yoga-0] add update.service.version.ts

This commit is contained in:
Roland Schneider
2025-05-17 23:08:57 +02:00
parent e5bafff815
commit c2095b6d8b
5 changed files with 405 additions and 0 deletions

View File

@@ -0,0 +1,17 @@
import yaml from 'js-yaml'
import fs from 'fs';
import dotenv from "dotenv"
dotenv.config()
try {
console.log("service updating",process.env.TARGET_FILE,process.env.TARGET_SERVICE,process.env.TARGET_IMAGE);
const composeFile: any = yaml.load(fs.readFileSync(process.env.TARGET_FILE as string, 'utf8'));
composeFile.services[process.env.TARGET_SERVICE as string].image = process.env.TARGET_IMAGE;
const result = yaml.dump(composeFile);
fs.writeFileSync(process.env.TARGET_FILE as string, result)
console.log("service updated",process.env.TARGET_FILE,process.env.TARGET_SERVICE,process.env.TARGET_IMAGE);
} catch (e) {
console.log(e);
}