-
-
Notifications
You must be signed in to change notification settings - Fork 387
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
do not add .git folder to a build layer #269
Conversation
`.git` folder isn't present in tarballs pulled from releases, e.g. `wget https://github.com/umputun/remark/archive/v.1.2.1.tar.gz`, and not used during the build anyways
not sure why it has anything to do with tarballs. They supposed to use $DRONE_TAG to form the version, but not .git. This part never worked properly because I'll need some sort of artifact storage on drone side and upload those artifacts to release. I have tried to implement it, but obviously, something is not right here and it doesn't keep/publish them to github properly. regarding the conclusion - I agree, .git seems to be an artifact of some legacy method to get version number for local builds, but we don't use it anymore (defaulted to "local"). |
It's still here on master, as of now: Line 11 in 20ca089
If it's just for a revision number, could it be done using the git command? |
git command won't work without .git folder. |
How about running the scripts locally then copying the results over? |
it means more complicated build process. I don't really see a reason to overcomplicate things. Build layer doesn't affect the final size of the container anyway |
my two cents: having
since
|
ah, I see. Have not thought anyone actually using tarballs instead of git checkout, but it is a valid concern for sure. I don't want to create some special make's target for the primary docker build and would rather prefer some special target to build container from the non-git source. |
For reference, I see two ways of solving this (assuming it actually needs "solving"):
I fixed this for myself with |
Yeah, @nagimov made the point. I was trying to deploy it to Railway, and saw the same error, but the case wasn't as persuasive as tarballs. Anyway, if all you need is |
+1 for @bnoctis cleaner solution. Version ENV can be set via git in the Makefile and passed to |
* removes .git from build layer, emulates GH build #269 * rundev target with git version passed in
.git
folder isn't present in tarballs pulled from releases, e.g.wget https://github.com/umputun/remark/archive/v.1.2.1.tar.gz
, and not used during the build anyways