Interview Prep/Jenkins/Declarative pipeline syntax

What are the `dir`, `ws` and `deleteDir` steps?

BeginnerConceptDeclarative pipeline syntax
Answer

dir('frontend') { sh 'npm ci' } changes directory for the block (creating it if needed). ws('/data/custom') { } allocates a different workspace. deleteDir() deletes the current directory recursively, often used as dir('tmp') { deleteDir() }. For full cleanup use cleanWs() from the Workspace Cleanup plugin in post { cleanup { } }.

All Jenkins questions Roadmap: Jenkins

More on Declarative pipeline syntax