nienbo / cache-buildkite-plugin

Tarball, Rsync & S3 Cache Kit for Buildkite. Supports Linux, macOS and Windows
https://buildkite.com/plugins
MIT License
67 stars 39 forks source link

osX - sha1sum: command not found #1

Closed rborn closed 4 years ago

rborn commented 4 years ago

Hi, thanks for continuing the work on this plugin. It seems that on mac this command doesn't exist.

Any idea? Thnx

gencer commented 4 years ago

Hey @rborn! Do you get any error or do you have log output?

Now seen it: sha1sum

On mac sha1sum may not be installed. Do you use homebrew?

gencer commented 4 years ago

Ok. I checked my mac now. mac has shasum not sha1sum. Let me tweak the code a bit

gencer commented 4 years ago

Go ahead and use master branch. Let me know if it works.

rborn commented 4 years ago

Thanks a lot and sorry for the late reply - It was night here :)

I have a new error, related to rsync now (that's on my CI)

Screenshot 2020-04-28 at 08 19 35
gencer commented 4 years ago

Hmm.. Looks like rsync also is different on mac too. Let me try rsync on my mac. I believe removing that flag will solve your problem.

gencer commented 4 years ago

Okay. I've pushed few changes. I will try few things then we will have something.

gencer commented 4 years ago

On my mac it seems it works. However, as this mac is actually a server (Buildkite dedicated server) all necessary tools already installed or modified. So, for me just saying "it works" is not right.

Please go ahead and try master branch and let me know.

BTW, You may need to delete buildkite cache plugin from buildkite plugin directory. Because you already used master few days ago Buildkite Agent won't checkout it again.

rborn commented 4 years ago

I'll do it later today, I'm in a middle of a release now 😅 😻

gencer commented 4 years ago

Take your time. Let me know when you test it. No rush.

rborn commented 4 years ago

@gencer ok, this works very nice now and thanks a lot 😻

I have to admit that I misunderstood what it does 😅 I was looking for something to run or skip a step based on the checksum of a file/folder ( like skip npm install if package.json doesn't change) however I think I'll use it to cache the modules, so thank you very much for your effort 🤗

gencer commented 4 years ago

@rborn Glad it did worked.

Ah, yes! This caches folder like node_modules. So, instead of skip, cache node_modules and npm install will instantly finishes if package.lock or yarn.lock didn't changed. Do not rely on .json. Rely on *.lock files.

In this situation, you don't need to skip npm install because that step will be done in a second.

Closing this issue. Released v2.0.6