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

Can't cache job checksum error on package.json #149

Closed
DaveSanders opened this issue Jul 18, 2019 · 1 comment
Closed

Can't cache job checksum error on package.json #149

DaveSanders opened this issue Jul 18, 2019 · 1 comment

Comments

@DaveSanders
Copy link

DaveSanders commented Jul 18, 2019

I'm making use of the new working_directory param for my circleci job (thanks to #144 ) and its working with my front-end folder in a subdirectory of my repo.

But - I am getting this error at Circle when it tries to lookup the cache or create the cache:

error computing cache key: template: cacheKey:1:34: executing "cacheKey" at <checksum "package.js...>: error calling checksum: open /root/project/package.json: no such file or directory

So, I'm guessing maybe the caching isn't looking for the package.json in the same place when using the orb? My job is pretty straightforward, and like I said, it runs - it just doesn't get the benefit of the container caching:

      - cypress/run:
          requires:
            - build_web
          record: true
          group: 'circle_test_only'
          start: 'npm run serve'
          working_directory: web
@DaveSanders
Copy link
Author

I solved this by changing my cache-key and specifying my working_directory, like this:

      - cypress/run:
          requires:
            - build_web
          record: true
          group: 'circle_test_only'
          start: 'npm run serve'
          working_directory: web
          cache-key: 'cache-{{ arch }}-{{ .Branch }}-{{ checksum "web/package.json" }}'

So this is probably solved. Maybe a parameter could be used in the orb.yml, but this solution is good enough for me.

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

1 participant