@veecode-platform/safira-cli
Version:
Generate a microservice project from your spec.
26 lines (25 loc) • 1.39 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.ArgoApplicationConfig = void 0;
const generate_file_1 = require("../generate-file");
const file_system_utils_1 = require("../../../utils/file-system-utils");
const safira_utils_1 = require("../../../safira-project/safira-utils");
class ArgoApplicationConfig extends generate_file_1.GenerateFileTemplate {
create(appName, repoUrl, namespace, servers, path, branch) {
const dockerFileFolder = file_system_utils_1.FileSystemUtils.buildPath(generate_file_1.GenerateFileTemplate.templatesFolder, "argocd");
file_system_utils_1.FileSystemUtils.createFolder(dockerFileFolder);
const template = file_system_utils_1.FileSystemUtils.buildPath(dockerFileFolder, "application.yaml.mustache");
const argoFolder = file_system_utils_1.FileSystemUtils.buildPath(safira_utils_1.SafiraUtils.getSafiraProjectFolder(), "argocd");
const params = {
"application-name": appName,
"repo-url": repoUrl,
namespace: namespace,
server: servers[0],
path: path,
hasPath: path.length > 0,
branch: branch,
};
super.writeFile(file_system_utils_1.FileSystemUtils.buildPath(argoFolder, `application-${branch}.yaml`), template, params);
}
}
exports.ArgoApplicationConfig = ArgoApplicationConfig;