generator-pdxc-pipeline v0.1.5
Yeoman Generators for Platform DXC
Table Of Context:
- Purpose
- Dependencies
- Generator Functionality
- Generator File Structure
- Generator Packaging and Execution
- Generator Updates
- Reference
Purpose
Provide a scaffolding system that can be used to streamline/onboard future products in to the pipeline and reduce the time to deploy infrastructure.
Dependencies
The following needs to be installed on your local desktop:
Install Node and NPM
Download and install Node and NPM. FYI, Node and NPM are packaged together.
Verify installation:
node -v
npm -v
Install Yeoman
To install Yeoman and verify installation execute the commands.
npm install -g yo
npm install -g yosay
yo --version
Link core-templates on your local desktop to yo to use generators.
cd core-template/generator-pdxc
npm link
The command 'npm link' will install a directory at ../core-template/generator-PDXC/node_modules, but these files will not be checked into the core-templates github repository because they are part of the '.gitignore' file.
Generator Functionality
The generator asks questions and from those responses copies files to a directory and replaces content in those files, the /generator-PDXC/app/index.js file controls the questions asked, the files copied and the content replaced.
Generator File Structure
Below is the file structure for the PDXC core-template repository.
generator-PDXC
app
index.js
package.json
- the Yeoman generator directory must start with 'generator' (ie. generator-PDXC)
- the app directory is the default directory that Yeoman uses to get the necessary information to create your generator
- index.js contains the questions that are asked to the user and the commands to copy and replace content in the files
- package.json contains Yeoman configuration information (ie. generator name, version number, dependencies, keywords, etc)
Generator Execution
This sections contains the directions for executing the Yeoman generator.
cd core-template/generator-pdxc
yo pdxc-pipeline
yo pdxc-pipeline - executes the Yeoman pdxc-pipeline that contains prompts (ie. repo name, 3 letter prefix). The answers from the prompts are used to copy content from core-template directory on your local desktop to your github repository directory (ie. prompt 'Name of your GitHub repo'). The content of the files are changed using the answers from the prompts (i.e. prompts ''Name of your GitHub repo', 'Your application 3 letter prefix', 'Owner name', Owner Email').
Sample results from running 'yo pdxc-pipeline'.