<p>I've read some stuff about deploying binaries. I'm working on a single EC2 instance and I don't want my production and deployment binary mix. I'm updating my development binaries via ssh'in and getting from git and production much similiar. Is there a reasonable way to separate both binaries and run it? <code>go install</code> command overwrites the current binary and can be risky.</p>
<hr/>**评论:**<br/><br/>quiI: <pre><p>You have to ask yourself <em>why</em> your development binary has to be different from a production one. </p>
<ul>
<li>If it's configuration, then it should be external to your app anyway</li>
<li>If your development one behaves differently to the production one, how are you testing it? Is the extra complexity worth it? </li>
</ul></pre>RandNho: <pre><p><code>go build -o binaryname</code> ?</p>
<p><code>go build -installsuffix devbinary</code>?</p>
<p>And same flags for <code>go install</code>?</p>
<p>Abuse git push to have two directories with same code, but different names?</p>
<p>There are a number of ways to do this.</p></pre>QThellimist: <pre><blockquote>
<p>Abuse git push to have two directories with same code, but different names?</p>
</blockquote>
<p>Could you explain this?</p></pre>RandNho: <pre><p>Haven't done that myself, but post-commit hooks from one directory to "production" branch in another. So each time you merge into said branch, production updates?</p>
<p>Do not do this.</p></pre>FIuffyRabbit: <pre><p>This is an easy way to do auto deploys with post-receive hooks.</p></pre>RandNho: <pre><p>Also, <a href="http://gitolite.com/deploy.html" rel="nofollow">see this</a></p></pre>
这是一个分享于 的资源,其中的信息可能已经有所发展或是发生改变。
入群交流(和以上内容无关):加入Go大咖交流群,或添加微信:liuxiaoyan-s 备注:入群;或加QQ群:692541889
- 请尽量让自己的回复能够对别人有帮助
- 支持 Markdown 格式, **粗体**、~~删除线~~、
`单行代码`
- 支持 @ 本站用户;支持表情(输入 : 提示),见 Emoji cheat sheet
- 图片支持拖拽、截图粘贴等方式上传