@jin7942/ray
Version:
Lightweight CI/CD deployment tool powered by Docker and Git
23 lines (22 loc) • 755 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.createContext = createContext;
/**
* Transforms a Config object into a StepContext object.
* Adds internal runtime data such as the workspace path.
*
* @param config - The raw configuration loaded from JSON
* @returns StepContext ready to be passed into pipeline functions
*/
function createContext(config) {
return {
repo: config.repo,
branch: config.branch,
// buildCommand: config.buildCommand,
docker: config.docker,
env: config.env,
envFilePath: config.internal?.envFilePath,
logDir: config.internal?.logdir,
workspace: `/tmp/ray-${config.name.replace(/\s+/g, '-').toLowerCase()}`,
};
}