Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Different workspace behaviour on agents and with drone exec #2075

Closed
patrickjahns opened this issue Jun 16, 2017 · 1 comment
Closed

Different workspace behaviour on agents and with drone exec #2075

patrickjahns opened this issue Jun 16, 2017 · 1 comment

Comments

@patrickjahns
Copy link

Not sure if this issue should be here, or rather be discussed in the cli repository - please let me know if I should move it.

I've noticed, that when running drone exec there will be no temporary volume created for workspace.

This leads to different behaviour on the agent and with drone exec:
On the agent:

  • the folder /workspace will stay persistent between builds

Locally:

  • /workspace is not persistent between steps

Scenario where this is relevant:
I have a pipeline, where I test modules for an application. That application expects these modules to be place in a specific directory (/application/modules/<mymodule>) otherwise they can't be tested within the application framework.

With the following definition for workspace+path I am able to accomplish this when running my builds on an agent:

workspace:
  base: /workspace
  path: application/modules/mymodule

pipeline:
  prepare:
    image: ...
    commands: 
      - cp -r /application /workspace/application
 test:
   image: ...
   commands:
     - run_tests
...

The contents created at /workspace/application will persist between further drone steps (when run on an agent). However locally, this is not the case.

When comparing both execution flows, I realized that drone exec only mounts the current folder to workspace+path, but does not create a volume for /workspace

When using drone exec --volumes "workspace:/workspace" the behaviour would be the same as when run on an agent.

Simple yaml to reproduce the effect:

workspace:
  base: /workspace
  path: application/modules/mymodule

pipeline:
  step1:
    image: alpine
    commands:
      - touch /workspace/hello
      - ls /workspace
  step2:
    image: alpine
    commands:
       - ls /workspace

Proposal:
Also create a workspace volume when running locally

@bradrydzewski
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants