AbstractBuildspec
Helps you create buildspec.yml files that inherit from each other.
Usage
Create a buildspec.js file like this:
const AbstractBuildspec = ; static { return '0.2'; } static { return variables: AAA: 'a' 'parameter-store': BBB: '/a/b' CCC: '/c/d' ; } static { return install: commands: 'echo Installing dependencies...' 'runtime-versions': nodejs: '10' pre_build: commands: 'echo Setting something up...' build: commands: 'echo Building files...' post_build: commands: 'echo Cleaning up...' ; } static { return paths: 'folder' ; } static { return files: "'item1'" "'item2'" 'base-directory': "'.'" 'discard-paths': 'no' ; }
Then you can reuse it to generate a slightly different buildspec like this:
static { const base = super; const extraCommands = 'echo Migrating the database...'; basepost_buildcommands = extraCommands; return base; }
Finally, you can emit the buildspecs to the filesystem by doing:
Buildspec;CustomBuildspec;
License
MIT License