1.0.14 • Published 3 years ago
@maroche/hydra v1.0.14
CLI that builds multiple projects from a single configuration file.
Install
npm install -g @maroche/hydra
Usage
Given a mono repo
mono-repo
|- libs
|- common
|- package.json
|- messaging
|- package.json
|- apps
|- price-service
|- package.json
Create a configuraton file named hydra.json in the rootof your mono repo
{
"version": "0.0.1",
"properties": {
"DOCKER_REPO": "https://10.0.0.0:5000"
},
"actions": {
"build-node": {
"steps": [
"npm update",
"npm install",
"npm run build",
"npm run test",
"npm publish"
]
},
"build-docker": {
"steps": [
"docker build -t ${DOCKER_REPO}/${ARTIFACT}:${VERSION} .",
"docker push ${DOCKER_REPO}/${ARTIFACT}:${VERSION}"
]
}
},
"artifacts": {
"common" : {
"name": "Libs :: common",
"path": "libs/common",
"actions": [
"build-node"
]
},
"messaging" : {
"name": "Libs :: messaging",
"path": "libs/messaging",
"actions": [
"build-node"
]
},
"price-service" : {
"name": "Apps :: price-service",
"path": "apps/price-service",
"actions": [
"build-node",
"build-docker"
]
}
}
}
Execute the hydra build tool from the root of your mono repo
hydra build
[INFO] ---------------------------------------------------------------------------
[INFO] Hydra Summary
[INFO]
[INFO] Libs :: common ................................ SUCCESS (00:00:39)
[INFO] Libs :: messaging ............................. SUCCESS (00:00:33)
[INFO] Apps :: price-service ......................... SUCCESS (00:00:45)
[INFO]
[INFO] ---------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ---------------------------------------------------------------------------
[INFO] Total time : 00:02:07
[INFO] Finished at 2021-02-18T17:34:42+00:00
[INFO] ---------------------------------------------------------------------------
Author
👤 Rob Hutton rob@maroche.co.uk (http://maroche.co.uk)
Show your support
Give a ⭐️ if this project helped you!