I m working with builder…
I’m working with builders in the workspace.json file.
"e2e": {
"builder": "@nrwl/cypress:cypress",
"options": {
"cypressConfig": "apps/web-e2e/cypress.json",
"tsConfig": "apps/web-e2e/tsconfig.e2e.json",
"devServerTarget": "web:serve"
},
"configurations": {
"production": {
"devServerTarget": "web:serve:production"
}
}
},
Is there any way to have a pre-run command? I need e2e to launch some docker services before running e2e.
EG something like
"architect": {
"start-services": {
"builder": "@nrwl/workspace:run-commands",
"options": {
"command": ["docker-compose up -d"],
"parallel": false
}
},
"e2e": {
"builder": "@nrwl/cypress:cypress",
"setup-builder": "start-services",
"cleanup-builder": "stop-services",
"options": {
"cypressConfig": "apps/web-e2e/cypress.json",
"tsConfig": "apps/web-e2e/tsconfig.e2e.json",
"devServerTarget": "web:serve"
},
"configurations": {
"production": {
"devServerTarget": "web:serve:production"
}
}
},
"stop-services": {
"builder": "@nrwl/workspace:run-commands",
"options": {
"command": ["docker-compose down -v"],
"parallel": false
}
},
"lint": {
"builder": "@nrwl/linter:lint",
"options": {
"linter": "eslint",
"tsConfig": ["apps/web-e2e/tsconfig.e2e.json"],
"exclude": ["**/node_modules/**", "!apps/web-e2e/**/*"]
}
}
}