简体   繁体   English

从持续集成部署构建文件

[英]Deploy build files from continuous integration

I am working on a project with multiple people, a website application which requires webpack to be built, uglified, concatenated into a few files eg app.min.js, style.min.css etc. - As a result of this, in an effort to prevent merge conflicts we recently added the build folder to .gitignore, under the assumption that we would be able to build during deployment. 我正在开发一个有多个人的项目,一个网站应用程序,需要构建webpack,uglified,连接成几个文件,例如app.min.js,style.min.css等。 - 结果,在一个为了防止合并冲突我们最近将build文件夹添加到.gitignore,假设我们能够在部署期间构建。

When pushing to the Master branch, we automatically "deploy" through Semaphore CI (similar to Travis) which runs composer install, npm install, and finally "npm run build" which triggers the webpack build. 当推送到Master分支时,我们通过Semaphore CI(类似于Travis)自动“部署”,运行composer install,npm install,最后是“npm run build”,它会触发webpack构建。 This is all built and then tested on the CI side of things, and then Semaphore automatically deploys to Amazon's Elastic Beanstalk where our application is hosted. 这些都是构建的,然后在CI方面进行测试,然后Semaphore自动部署到托管我们的应用程序的Amazon的Elastic Beanstalk。

The problem with this is, it seems Semaphore doesn't upload the build it's just tested, but rather the Master branch itself which has no built JS or CSS. 这个问题是,似乎Semaphore没有上传刚刚测试过的构建版本,而是上传了没有内置JS或CSS的Master分支。 I'm wondering if there's a way to push these built files to deployment as well, or if running the entire build process AGAIN on Elastic Beanstalk is the only route. 我想知道是否有办法将这些构建的文件推送到部署,或者如果在Elastic Beanstalk上运行整个构建过程AGAIN是唯一的路径。 It seems unnecessary to have to do that process essentially 3 times, locally, CI, and then deployment. 似乎没有必要基本上执行该过程3次,本地,CI,然后部署。 Every time a step like this is needed on EB the actual re-instantiation time gets longer, which I'd like to keep as short as possible. 每次在EB上需要这样的步骤时,实际的重新实例化时间会变长,我希望保持尽可能短的时间。

Obviously if building it a 3rd time on EB is the only way to go about this then I'll have to, just wondering if there are better solutions for this whole workflow. 显然,如果在EB上第三次构建它是唯一的方法,那么我将不得不,只是想知道这整个工作流程是否有更好的解决方案。

I haven't worked with Semaphore CI, but you might be able to use an .ebignore file . 我没有使用过Semaphore CI,但您可以使用.ebignore文件

If you create one, the cli will use that instead of your .gitignore file. 如果您创建一个,cli将使用它而不是.gitignore文件。

I find in some deployment situations you want the inverse of your .gitignore (all compiled, no src). 我发现在某些部署情况下你需要你的.gitignore的反转(所有编译,没有src)。 It essentially lets you pick the files from your project directory that you want to deploy, in the same way as the .gitignore file. 它本质上允许您从项目目录中选择要部署的文件,方法与.gitignore文件相同。

Edit : I just noticed the documentation on aws is lacking. 编辑 :我刚刚注意到aws上的文档缺乏。 It only mentions file exclusion, but you can include files too. 它只提到文件排除,但您也可以包含文件。

Edit 2 : I don't think Semaphore supports the use of .ebignore, so right now this solution isn't of any use. 编辑2 :我不认为Semaphore支持使用.ebignore,所以现在这个解决方案没有任何用处。 :( :(

I just had a great first experience with https://deploybot.com/ . 我刚刚通过https://deploybot.com/获得了很好的第一次体验。 The can deploy directly to elastic beanstalk. 可以直接部署到弹性豆茎上。 It might be interesting or you. 它可能很有趣或者你。

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

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