Decentralized NX cache.
🔎 Nx is a set of Extensible Dev Tools for Monorepos.
Inspired by nx-remotecache-gcs
- 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-onprem
Install @gilsdav/nx-cloud-onprem-runner
into your NX project.
npm install --save-dev @gilsdav/nx-cloud-onprem-runner
Change 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.
- Clone this git repository
- Install deps with the command
npm install
- Start server with the command
npm start
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.
- Build the application:
npm run nx -- build todos
- Go to
node_modules/.cache
folder and deletenx
- Run again the build command:
npm run nx -- build todos
- You got message that inform you the build comes form cache