Fork me on GitHub
#off-topic
<
2019-05-16
>
martinklepsch08:05:48

Does anyone know this? Can CircleCI Orbs access the disk like steps in a regular CircleCI workflow can? Specifically if a jar is installed into ~/.m2, could an Orb access that?

art13:05:17

I do roughly the following

jobs:
  build-uberjar:
    docker:
      - image: clojure:alpine
    working_directory: /workspace
    steps:
      - attach_workspace:
          at: /workspace
      - restore_cache:
          key: << project_name >>-{{ checksum "project.clj" }}
      - run: lein deps
      - run: lein uberjar
      - persist_to_workspace:
          root: /workspace
          paths:
            - .
      - run: rm -rf ~/.m2/repository/<< namespace >> # force snapshots re-download
      - save_cache:
          paths:
            - ~/.m2
          key: << project_name >>-{{ checksum "project.clj" }}

art13:05:17

I do roughly the following

jobs:
  build-uberjar:
    docker:
      - image: clojure:alpine
    working_directory: /workspace
    steps:
      - attach_workspace:
          at: /workspace
      - restore_cache:
          key: << project_name >>-{{ checksum "project.clj" }}
      - run: lein deps
      - run: lein uberjar
      - persist_to_workspace:
          root: /workspace
          paths:
            - .
      - run: rm -rf ~/.m2/repository/<< namespace >> # force snapshots re-download
      - save_cache:
          paths:
            - ~/.m2
          key: << project_name >>-{{ checksum "project.clj" }}

art13:05:46

Orbs work well since in fact when you call an orb (for instance, company/build-uberjar) it just gets expanded to your .circleci/config.yaml

art13:05:08

So in that case you can attach workspaces with .m2 across different steps

borkdude13:05:29

maybe we should have a #circleci channel? questions about CircleCI regularly come up and it would be nice if these would be saved (via Zulip and logbot) into an archive. @marc-omorain

👍 8
Marc O'Morain13:05:10

#circleci 😄