This angular schematic is designed to be a build pipeline action that updates product version. It looks for version property in environment.ts file.
import { IEnvironment } from "./environments";
export const environment: IEnvironment = {
production: false,
// will update this property
version: "0.0.local"
};
How to use:
schematics @dvabuzyarov/product-version:product-version --productVersion="$(Build.BuildNumber)"
The schematic support other input parameters according to this schema:
{
"$schema": "http://json-schema.org/schema",
"id": "@dvabuzyarov/product-version",
"type": "object",
"properties": {
"productVersion": {
"type": "string",
"description": "The product version",
"$default": {
"$source": "argv",
"index": 0
}
},
"propertyName": {
"type": "string",
"description": "The property name of the environment class",
"$default": {
"$source": "propertyName"
}
},
"project": {
"type": "string",
"description": "The name of the project.",
"$default": {
"$source": "projectName"
}
},
"path": {
"type": "string",
"format": "path",
"description": "The path to the environment folder.",
"visible": false
}
},
"required": [
"productVersion"
]
}