There is no automagic way for drone to reset your workspace in-between pipeline steps. This is something you will need to handle manually in your yaml, similar to how you would handle this locally form the command line.
Not sure I like it. Anyway, thanks for the solution.
Since the projects are different, python, node, golang, java, or others, rm -f doesn’t always work, because I don’t know where are these temp files generated.
I’d like to find a generic way to deal with it. I prefer if Drone team can develop a new feature that we can active/nominate some pipeline steps in a new/seperate workspace, or totally different agent
an extra option as below:
pipeline:
test:
image: node
commands:
- npm install
- npm run test
rebuild:
image: node
commands:
- npm install
+ workspace: new
Do you think that’s a good idea? Should we include this feature in GA release (1.0)?
I am thinking to run the unit test in virutual environment (a docker container) as well, such as kitchen test if Drone doesn’t support this feature currently.
The yaml configuration format is largely frozen at this time. I recommend using the approach defined above, where you manually purge the workspace with shell commands.