The build process is orchestrated by the vdev scripts and guided by the vdev.yaml files.
vdev.yaml has two main sections:
blocks: Represents what is getting built.realms: Represents the deployment destitation (i.e., kuberenetes cluster target)
Each block match to a base block folder, which is typically under /services/_block_name_/ for backend services block, or /frontends/_block_name_ for webBundle type of blocks (.js, .css set of files). Frontends blocks (i.e., webBundle) can be built separately, but are usually dependencies of backend server (e.g., services/web-server will depends on frontends/web webBundle).
- Backend Blocks (i.e.,
/services/_block_name_/) are built with the following rules by the vdev scripts.- If
package.jsonthennpm installis called. - If
tsconfig.jsonthen typescript compilation is called (with the typescript from root package.json) - If
Dockerfilethendocker build ...is called. - Docker images are tagged with
http://localhost:5000/_system_-_service_name_:_image_tag_where_system_is thevdev.yaml - systemproperty (the system prefix in a way)_service_name_is usually the name of the folder underservices_image_tag_isuaully the__version__(see the Version section below)
- For example, given the [] the vdev.yaml and package.json tag will be
http://localhost:5000/cba-web-server-DROP-001-SNAPSHOT
- If
To have a consistent versioning system across all blocks (backend and frontend), the package.json __version__ property is taken in account and added to the minimum set of files so that each part of the system can have the hardcoded version.
- docker label - the
__version__number can be used in the vdev.yaml for the image tag, which is a property ofrealms, usually used in therealms._commonwhich will be properties shared for all realms. - Typicaly
package.json__version__is used for versioning,versionwill be set to0.0.0to make clear it is not used as a versioning scheme.FAQ 1: why not package.json version field? - The problem with package.json version is that it forces to follow the semver which might be too limiting for "application versioning" scheme.
- vdev.yaml can have a
version.fileswhich list the list of files where__version__variables and?v=...(for .html) variable / parameter value will be updated. Typeical files are npm run vdev versioncan be ran to update the versioned files with the new version.versioningis also ran before eadhdbuild
Once the version is included in the various code, it can be siplay