UNPKG

@sap/cds-dk

Version:

Command line client and development toolkit for the SAP Cloud Application Programming Model

32 lines (24 loc) 802 B
const { join } = require('path'); const cds = require('../../../cds') const { exists, copy } = cds.utils const { URLS } = require('../../constants') module.exports = class PipelineTemplate extends require('../../plugin') { static help() { return 'CI/CD pipeline integration' } async canRun() { if (cds.cli.options.force) { return true; } if (exists('Jenkinsfile') || exists(join('.pipeline', 'config.yml'))) { throw `Pipeline support file exists. Use --force to overwrite.` } return true; } async run() { await copy(join(__dirname, 'files')).to(cds.root) } async finalize() { console.log(`for information on project "Piper" and its pipelines see ${URLS.PIPELINE_HELP}`); } }