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 @criticalmanufacturing/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
The Customization projects generated by @criticalmanufacturing/cli
make use
of NuGet and NPM repositories. CM MES NuGet and NPM packages are not publicly
available. Before starting the scaffolding of a project, get access or set up
new repositories for NuGet and NPM packages for the CM MES version you intend
to use.
Note
The below table presents examples of commonly used repository systems:
Repository Name | NuGet | NPM | Home page |
---|---|---|---|
Azure DevOps | X | X | https://azure.microsoft.com/en-us/products/devops |
Nexus | X | X | https://www.sonatype.com/products/sonatype-nexus-repository |
Verdaccio | - | X | https://verdaccio.org/ |
SMB File Share | X | - | https://learn.microsoft.com/en-us/windows-server/storage |
Open a ticket on CM Customer Portal requesting access to the NuGet and NPM MES packages that you intend to use.
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 Libraries
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.