Persist_to_workspace gradle orb job

hey all,
is there a way to persist to workspace a gradle orb job?
since its not my written job i can’t or at least don’t know how to add the step persist_to_workspace.

my usage of the job at the moment:
workflows:
ci:
jobs:
- gradle/run

Hi @NirKirshbloom ,

Thank you for posting your question!

I believe this can be done by utilizing pre/post steps. Here is a quick example I came up with:

workflows:
  ci:
    jobs:
      - gradle/run:
          post-steps: # steps to run after steps defined in gradle/run
            - persist_to_workspace:
                root: /tmp/dir
                paths:
                  - foo/bar
                  - baz

With this, the persist_to_workspace will run as the final step in the grade/run job. You could do something similar in another job using pre-steps to run attach_workspace before other steps.

More information on pre/post steps can be found on the following page in our documentation:

Configuring CircleCI - CircleCI

Please let me know if this works for your use case.

Best Regards

Hi @aaronclark,
thanks for the quick reply, sounds great ill use it that way tvm!! :slight_smile:

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.