Scaffolding
@criticalmanufacturing/cli
provides a set of commands that allows you to scaffold a CM MES Customization project. This tutorial provides you the guidance on how to create a new customization project file structure.
Tip
To re-scaffold a project, execute the scaffold procedure on a clean directory. Then, merge the previous customization project files into the new project structure.
Prerequisites
Install cli
@criticalmanufacturing/cli
must be installed on your environment for you to use the scaffolding functionality. Check its installation guide here.
Prepare NuGet and NPM repositories
Customization projects generated by @criticalmanufacturing/cli
make use of CM MES NuGet and NPM packages, which are not publicly available. Before starting the scaffolding of a project:
- Get access to CM NuGet, NPM and Docker repositories or their proxy.
- Evaluate the need to set up a proxy for your organization, to avoid network performance issues.
Location and Access
The location and procedures to access CM MES Repositories are available on Critical Manufacturing Developer Portal.
Create the infrastructure.json file
To initialize a new Customization project with @criticalmanufacturing/cli
,
you need to provide an infrastructure file with the settings for NuGet and
NPM repositories. The infrastructure specification page
details this file structure.
Create/export the environment.json file
A valid MES test/integration environment configuration file is required during the scaffolding. You may create it using:
- CM MES ISO Setup Wizard - If your environment is running on Windows VMs or Bare Metal machines infrastructure.
- CM MES DevOps Center Page - If your environment is running in container infrastructure.
For the CM MES ISO Setup Wizard, you may obtain this file, on the last prompt step of the setup wizard, by selecting the "Export" functionality. It will allow you to save the environment settings prompted in the previous steps.
For DevOps Center, you just need to access your environment page and use the "Export Parameters" option to retrieve it.
Warning
The environment.json file contains sensitive information, for example, user accounts and authentication tokens. Store it in a safe location.
Retrieve LBOs
Generate the LBO Libraries for your MES installation, as described in the LBO Generator Documentation.
Scaffold Step-by-Step
1. Initialize the project
After ensuring that you have all scaffold prerequisites, your first operation is to initialize your project repository.
The instructions are available in the Project Init Tutorial.
2. Generate Layers Packages
The next step is to select your project scaffold structure and create the customization packages for your project.
The instructions are available in the Project Scaffold Tutorial.
3. Execute Post-Scaffold Operations
It is common for projects to require tailoring of their package configuration.
Check and apply the applicable post-scaffold operations defined in the Project Post-Scaffold Tutorial.