0.0.1 • Published 5 years ago
@gilsdav/nx-cloud-onprem-runner v0.0.1
OnPrem NX Cloud
Decentralized NX cache.
🔎 Nx is a set of Extensible Dev Tools for Monorepos.
Inspired by nx-remotecache-gcs
How to use
Start Server
- Image name:
gilsdav/nx-cloud-onprem. - Container port:
3333 - Cache directory:
/nx-cache
docker run -d -p 8080:3333 -v my-cache-directory:/nx-cache gilsdav/nx-cloud-onpremConfigure NX runner
Install @gilsdav/nx-cloud-onprem-runner into your NX project.
npm install --save-dev @gilsdav/nx-cloud-onprem-runnerChange the tasksRunnerOptions section into nx.json by:
"tasksRunnerOptions": {
"default": {
"runner": "@gilsdav/nx-cloud-onprem-runner",
"options": {
"cacheableOperations": ["build", "lint", "test", "e2e"],
"bucket": {
"url": "http://localhost:8080/api"
}
}
}
},If you deployed this into a server, change http://localhost:8080 by your own server address.
From source code
Start Server
- Clone this git repository
- Install deps with the command
npm install - Start server with the command
npm start
Configure NX runner
To use remote build you need to use an other runner than the default one.
Change the tasksRunnerOptions section into nx.json by:
"tasksRunnerOptions": {
"default": {
"runner": "./extension",
"options": {
"cacheableOperations": ["build", "lint", "test", "e2e"],
"bucket": {
"url": "http://localhost:3333/api"
}
}
}
},If you deployed this into a server, change http://localhost:3333 by your own server address.
Test remote cache
- Build the application:
npm run nx -- build todos - Go to
node_modules/.cachefolder and deletenx - Run again the build command:
npm run nx -- build todos - You got message that inform you the build comes form cache
0.0.1
5 years ago