Skip to content
This repository has been archived by the owner on Jun 24, 2024. It is now read-only.

Versioned layer name #10

Merged
merged 2 commits into from
Apr 26, 2020
Merged

Conversation

tomharvey
Copy link
Contributor

@tomharvey tomharvey commented Apr 25, 2020

I think I understand your suggestion in your comment on issue #9 - is that to ensure that if the scripts are run without an explicit VIPS_VERSION being set, or if the Dockerfile is run without the build.sh script, then the deploy.sh script will still have access to the version info? And, the version used in the Dockerfile is canonical?

The Dockerfile in this PR creates a file named .env which is copied (with the zip file) to the host and is then sourced by the deploy.sh script. I guess, in future, additional build variables can also be stored in there if the user needs access to those after the library is built.

Layers cannot contain a . so I'm just droppping these with ${VIPS_VERSION//./}

I've tested deployments with:
1. bin/deploy - which builds v8.7.4 (the default in bin/build) and publishes as rubyvips874
2. VIPS_VERSION=8.9.2 bin/deploy which builds v8.9.2 and publishes as rubyvips892
3. VIPS_VERSION=8.9.0-rc4 bin/deploy (just to check the edge case version name) which builds v8.9.0-rc4 and publishes as rubyvips890-rc4

@metaskills
Copy link
Contributor

Oh nice! This is rather clever and done in such a way that any env we needed from the container can be used. Not the approach I would have taken which is JUST FINE. I would have likely done an explicit file called .VIPS_VERSION and read that in via a cat call. Then gone with the .env file if more variables were needed. Either works fine and I really appreciate seeing your method. Gonna merge this in. Again, thanks a ton for the work!

@metaskills metaskills merged commit 349f41e into customink:master Apr 26, 2020
@tomharvey
Copy link
Contributor Author

Thanks!

I was worried it was in breach of YAGNI, but I always feel like backtick cats are a little hacker than just sourcing a file.

Loved hearing a rubyist on the Jeremy Daly podcast a few months ago - just realised that was you. 👍

@metaskills
Copy link
Contributor

Whoa! Thanks. BTW, I did change this to VIPS_VERSION=$(cat share/.VIPS_VERSION) because I use aws from a container and aliased shell script and the source was not working for some reason. https://technology.customink.com/blog/2020/04/05/aws-cli-multi-factor-auth-with-docker/

@tomharvey
Copy link
Contributor Author

Ah nice. I’ll look into that; I do die a little inside when I need to wrestle with pyenv and nvm (serverless framework) when I’m writing ruby.

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

Successfully merging this pull request may close these issues.

2 participants