简体   繁体   English

AWS Elastic Beanstalk上的Git文件夹

[英]Git folder on AWS Elastic Beanstalk

Where do I find the .git folder on my AWS Elastic Beanstalk environment? 在AWS Elastic Beanstalk环境中的哪里找到.git文件夹? I ssh'd into my EC2 instance, ran find / -name ".git" but it returned no results. 我将其放入EC2实例,运行find / -name ".git"但未返回任何结果。

Why do I ask? 我为什么要问? I normally use the .git/refs/heads/master file to get a commit version hash which I put into the end of static files. 我通常使用.git/refs/heads/master文件来获取提交版本哈希值,并将其放入静态文件的末尾。 Example: 例:

<link type="text/css" href="http://example.com/theme/global.css?60c9afa3e9" />

Can't do that with AWS EB if I can't find the .git folder. 如果找不到.git文件夹,则无法使用AWS EB做到这一点。

elastic beanstalk uses git to fetch the sources, then zips it, uploads it to S3 and unzips it to the EC2 instance. elastic beanstalk使用git来获取源代码,然后将其压缩,上载到S3并将其解压缩到EC2实例。 the zip file does not include the git directories, so you won't find them on the instance. zip文件不包含git目录,因此您将在实例上找不到它们。
Here're a couple of possible solutions: 以下是一些可能的解决方案:
1. Create an .ebextension file that fetches the latest git version on ec2 (hoping no one has pushed a commit since) 1.创建一个.ebextension文件,以在ec2上获取最新的git版本(希望此后没有人推送过提交)
2. Create a different file with an ID and manually populate it in your build process or a pre-commit git hook 2.创建一个具有ID的其他文件,并在构建过程或预提交git hook中手动填充它

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM