Drone automatically creates a temporary volume, known as your workspace, where it clones your repository. The workspace is the current working directory for each step in your pipeline. The default workspace path is /drone/src
.
Because the workspace is a volume, filesystem changes are persisted between pipeline steps. In other words, individual steps can communicate and share state using the filesystem.
Workspace volumes are ephemeral. They are created when the pipeline starts and destroyed after the pipeline completes.
Customizing the Workspace
You can customize the workspace directory by defining the workspace
section in your yaml. Here is a basic example:
|
|
This would be equivalent to the following docker commands:
$ docker volume create my-named-volume
$ docker run --volume=my-named-volume:/drone/src golang
$ docker run --volume=my-named-volume:/drone/src node