[Beginner] Production / Development Binaries

polaris · · 535 次点击    
这是一个分享于 的资源,其中的信息可能已经有所发展或是发生改变。
<p>I&#39;ve read some stuff about deploying binaries. I&#39;m working on a single EC2 instance and I don&#39;t want my production and deployment binary mix. I&#39;m updating my development binaries via ssh&#39;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&#39;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&#39;t done that myself, but post-commit hooks from one directory to &#34;production&#34; 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

535 次点击  
加入收藏 微博
0 回复
暂无回复
添加一条新回复 (您需要 登录 后才能回复 没有账号 ?)
  • 请尽量让自己的回复能够对别人有帮助
  • 支持 Markdown 格式, **粗体**、~~删除线~~、`单行代码`
  • 支持 @ 本站用户;支持表情(输入 : 提示),见 Emoji cheat sheet
  • 图片支持拖拽、截图粘贴等方式上传