<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by elbuo on Medium]]></title>
        <description><![CDATA[Stories by elbuo on Medium]]></description>
        <link>https://medium.com/@elbuo8?source=rss-b82bd488edd6------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*79LSeu6ICC0mGyCY.jpeg</url>
            <title>Stories by elbuo on Medium</title>
            <link>https://medium.com/@elbuo8?source=rss-b82bd488edd6------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 30 Nov 2026 09:44:30 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@elbuo8/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Cheesy ops via now.sh]]></title>
            <link>https://medium.com/@elbuo8/cheesy-ops-via-now-sh-4a9f16d352bf?source=rss-b82bd488edd6------2</link>
            <guid isPermaLink="false">https://medium.com/p/4a9f16d352bf</guid>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[tech]]></category>
            <category><![CDATA[docker]]></category>
            <category><![CDATA[programming]]></category>
            <dc:creator><![CDATA[elbuo]]></dc:creator>
            <pubDate>Fri, 28 Oct 2016 03:07:27 GMT</pubDate>
            <atom:updated>2016-10-28T03:13:30.146Z</atom:updated>
            <content:encoded><![CDATA[<p>There is a wide spectrum of complexity for application deployments. Could be as simple as using a PaaS or rolling out your own solution which provides greater power (remember what uncle Ben used to say?). Such power allows you to design different deployment pipelines such as <a href="http://martinfowler.com/bliki/BlueGreenDeployment.html">blue/green deployments</a>.</p><p>Recently, I had the pleasure to use <a href="https://now.sh/">now</a> to deploy a simple application. It got me thinking about the deployment pipelines I could build with it. I’ll try to detail how to emulate blue/green deployments by using my personal website as an example.</p><p>To start, install the <strong>now </strong>CLI and a JSON CLI utility by running:</p><pre>$ npm i -g now json</pre><p>Then, proceed to provision a new token for the <strong>now</strong> CLI by visiting <a href="https://zeit.co/account#api-tokens">this page</a>. Once you obtain it, export it to your environment by running:</p><pre>$ ZEIT_TOKEN=youareawesome</pre><p>There is support for Node.js applications as well as Docker containers. For the purposes of this demo, I’ll will go with Docker. You can find the source and the Dockerfile that I’m going to be referring to <a href="https://github.com/elbuo8/yamilasusta.com">here</a>.</p><p>Now, lets get your domain set up. In your domain’s DNS settings, add a record similar to this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VaDERhSnPkCaN6NMip7SZA.png" /><figcaption>CNAME that resolves to zeit.co</figcaption></figure><p>If you have your token, the CLIs, your domain properly configured and a Dockerfile, we can get down to the fun part.</p><p>Whenever you deploy with <strong>now</strong>, a whole new deployment is provisioned and a new URL for it is generated. After N deployments, you will have N live versions of your app unless you start removing them. The URLs will be different for each one so if you were targeting a previous deployment, you have to change URLs to obtain the latest one. How can we automate this?</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/2909226f746d85354bf7a1831cb952c1/href">https://medium.com/media/2909226f746d85354bf7a1831cb952c1/href</a></iframe><p>What is going on here?</p><ol><li>New Docker deployment (this will create the application in Zeit as well as deploy it).</li><li>Call the Zeit API to obtain the last deployment of the application (be sure to edit the script to use your application name).</li><li>Ensure the application replies to the URL (adjust it to your app’s health endpoint).</li><li>Make your domain (which we previously configured to resolve to zeit.co) point to the new deployment (make sure to update the domain in the script).</li></ol><p>You can run this N times, and if N times your app boots up successfully, your traffic will be redirected each time. You can <a href="https://github.com/elbuo8/yamilasusta.com/blob/master/circle.yml">configure your favorite CI</a> to the script or simply execute it manually each time you need to update your app. Reverting would be as simple as:</p><pre>$ now alias PREVIOUS_DEPLOYMENT_ID YOURDOMAIN -t $ZEIT_TOKEN</pre><p>There you have it. Cheap and easy (cheesy) blue/green deployments.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4a9f16d352bf" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Deploy Ember to S3 and CloudFront]]></title>
            <link>https://medium.com/@elbuo8/deploy-ember-to-s3-and-cloudfront-f950bc934a94?source=rss-b82bd488edd6------2</link>
            <guid isPermaLink="false">https://medium.com/p/f950bc934a94</guid>
            <category><![CDATA[tech]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[devops]]></category>
            <dc:creator><![CDATA[elbuo]]></dc:creator>
            <pubDate>Wed, 20 May 2015 23:46:02 GMT</pubDate>
            <atom:updated>2015-05-21T00:31:40.762Z</atom:updated>
            <content:encoded><![CDATA[<p>I’ve yet to write a single line of Ember for production code but I still had to figure out deployment for it. Luckily, there are some awesome tools out there. I’ll try to explain how we setup S3 to serve our Ember application, setting up CloudFront, and how we automated that in our deployment process.</p><p>The first thing that we wanted to accomplish was the elimination of server(s) maintenance/scaling. Regardless if it was a framework or just nginx serving the assets. We just wanted the feeling we had back when we just uploaded assets through FTP and everything worked (those days are long gone).</p><p>Secondly, we wanted to keep using our same tools and development workflow. Deployment using our favorite command:</p><pre>$ git push</pre><p>To tackle our asset hosting, we decided to stick with S3. This part was pretty simple. First, create a bucket and enable “Static Website Hosting”. For the index document, make sure you point it to your Ember app’s index file. Now, your “redirection rules” should look similar to this. Remember to replace with your own domain name.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/cc669a2b25baafc0e5116b73744fcf4d/href">https://medium.com/media/cc669a2b25baafc0e5116b73744fcf4d/href</a></iframe><p>Now, how do we deploy with just 1 command? That’s where <a href="https://github.com/ember-cli/ember-cli-deploy">ember-deploy</a> comes in to save the day. It hooks in into our ember-cli workflow and makes deployments a breeze. The “lighting approach” uses redis to map the index file. We opted to do a simpler approach. First:</p><pre>$ npm i ember-cli-deploy ember-deploy-s3 --save-dev</pre><p>Create a <strong>deploy.js</strong> file inside a <strong>config</strong> folder. Similar to this one:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/eb785a9f0ea237b3dcfcbbbfdb09026d/href">https://medium.com/media/eb785a9f0ea237b3dcfcbbbfdb09026d/href</a></iframe><p>Now simply run</p><pre>$ ember deploy -environment production</pre><p>And all of your assets will be uploaded to your bucket and accesible through the “Static Website Hosting” URL provided.</p><p>Now, lets take it a step further. Lets throw this behind CloudFront. Create a distribution, where the origin is <strong>the url provided in the “Static Website Hosting”.</strong> I emphasize this given that the CF UI will start autocompleting for you and you will end up setting the origin as the bucket name. That is not what we want. We want the <strong>URL.</strong></p><p>Point your domain to your CF distribution and behold your Ember app.</p><p>Lets tackle our continuos deployment using git. In our CI we have the following commands after our test suite finishes successfully.</p><pre>$ ember deploy -e production<br>$ pip install awscli<br>$ aws configure set preview.cloudfront true<br>$ aws cloudfront create-invalidation --distribution-id DISTRIBUTIONID --invalidation-batch &quot;{\&quot;CallerReference\&quot;: \&quot;$(cat /proc/sys/kernel/random/uuid)\&quot;, \&quot;Paths\&quot;:{\&quot;Quantity\&quot;:1,\&quot;Items\&quot;:[\&quot;/index.html\&quot;]}}&quot;</pre><p>Breaking it down, the commands do the following:</p><ol><li>Deploy the latest version of the app (we use fingerprinting for our assets).</li><li>Invalidate the <strong>index.html</strong> in our CF distribution.</li></ol><p>This will cause that the next time we visit our app (after the invalidation) we will be served the updated <strong>index.html </strong>that will point to the latest assets.</p><p>This is, by no means, our last iteration of deployments. There is a lot of room to improve, specifically when it comes to the invalidation part. But, I figured that someone could use this as a starter (I know I could have used it myself). Always glad to discuss optimizations. Enjoy.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f950bc934a94" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[AWS λ (Lambda) Deployments]]></title>
            <link>https://medium.com/@elbuo8/aws-%CE%BB-lambda-deployments-67e0216de3a6?source=rss-b82bd488edd6------2</link>
            <guid isPermaLink="false">https://medium.com/p/67e0216de3a6</guid>
            <dc:creator><![CDATA[elbuo]]></dc:creator>
            <pubDate>Fri, 27 Feb 2015 19:40:01 GMT</pubDate>
            <atom:updated>2015-02-27T19:40:01.881Z</atom:updated>
            <content:encoded><![CDATA[<p>If you have read about AWS Lambdas, you must have noticed that deployments are executed by uploading a zip file. Weird, I know. This comes with a few side effects as well.</p><h4>Handling npm install</h4><p>First one I noticed was when doing a quick deploy. I cloned a repository and immediately tried to upload the zip file. I attempted to run my λ and it failed. Can you tell why?</p><blockquote>I forgot to run npm install.</blockquote><p>Normally, when deploying an application, I take this for granted given that the build systems do this for me. When dealing with λ, you need to take care of this yourself.</p><p>Second thing I came across was how big the footprint of the λ was. My uploads were taking forever (I do have crappy internet to be fair). <em>How can I optimize this?</em><strong><em> </em></strong>Simple.</p><blockquote>npm install —production</blockquote><p>If you are developing, you should be running tests that depend on devDependencies, right? How can you have a sane flow?</p><p>Enter <a href="https://github.com/RebelMail/node-lambda"><strong>node-lambda</strong></a>. This was built over at RebelMail by <a href="https://twitter.com/motdotla">Mot</a> before I joined. Afterwards I added some extra features and safety steps to deployments. Between those are:</p><ol><li>Multi-AZ deployments</li><li>Always<em> npm install —production </em>on a separate folder</li></ol><p>With these, I resolve the first issues I came across on my deployments. Also, given Multi-AZs deployments, node-lambda plays hand to hand with <a href="https://github.com/RebelMail/lambda-runtime"><strong>Lambda-Runtime</strong></a>.</p><h4>Handling compiled dependencies</h4><p>Third thing I noticed was meanwhile deploying a dependency that was compiled. I use OSX on a regular day for my development. Hence, when I uploaded the zip file, it had my dependencies for OSX. Lambda’s run on Linux. How can I solve this? First though was to use Vagrant. But I came across a simpler solution. Using my <strong>CI</strong>.</p><h4>Achieving Continuous Deployments</h4><p>Using a CI is extremely convenient with Lambdas. And node-lambda simplifies it. By including it as a devDependency, I can instruct my CI to run a command similar to this one:</p><blockquote>./node_modules/node-lambda/bin/node-lambda deploy -e staging</blockquote><p>Test, deploy, enjoy. Also my CI’s has a way better internet connection than I do ☺.</p><p>If you come across tidbits about Lambdas, <a href="https://twitter.com/elbuo8">you know where to find me.</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=67e0216de3a6" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Super-powered AWS Lambdas]]></title>
            <link>https://medium.com/@elbuo8/super-powered-aws-lambdas-78cba45487f2?source=rss-b82bd488edd6------2</link>
            <guid isPermaLink="false">https://medium.com/p/78cba45487f2</guid>
            <dc:creator><![CDATA[elbuo]]></dc:creator>
            <pubDate>Tue, 24 Feb 2015 04:45:28 GMT</pubDate>
            <atom:updated>2015-02-24T04:45:28.000Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/350/1*9niUoIAGoq-fUHYYBnYyPA.gif" /></figure><p><em>tl;dr: Go checkout </em><a href="https://github.com/RebelMail/lambda-runtime"><em>LambdaRuntime</em></a><em>.</em></p><p>On my first week at <a href="http://rebelmail.com/">RebelMail</a> I noticed how tight the system was with <a href="http://aws.amazon.com/lambda/">AWS Lambdas</a>. This got me very excited given that Lambdas are a brand new toy which in my opinion is pretty damn awesome. At the same time, I also got the chills given that its still in Beta and many things are yet to be defined.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/500/1*vZR7t8mFDYPRwlIPJ2LZSQ.gif" /><figcaption>“It completely threw me off since you might override your Lambda if it has the same name and cause a complete chaos.”</figcaption></figure><p>First thing I noticed was the lack of tagging or versioning. It completely threw me off since you might override your Lambda if it has the same name and cause a complete chaos. Since there is no versioning, the user must figure out a logic on how to upgrade their Lambdas as well as supporting the old ones if necessary.</p><p>Having multiple AZs is the preferred practice for AWS (or any cloud infrastructure setup). Lambdas shouldn’t be an exception. Currently, there are 3 regions that support Lambdas. When attempting to execute Lambdas, one should take into consideration downtimes etc and make full use of the multi regions that AWS offers.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/245/1*M0Senoz1C3EIhwa8BKGvNg.gif" /></figure><p>For this and some other reasons I took some time to build <a href="https://github.com/RebelMail/lambda-runtime">LambdaRuntime</a>. It enforces conventions on how you name your Lambdas in exchange for a few benefits.</p><p>The convention is the following:</p><p><strong>name-of-the-package-ENVIRONMENT-MAJOR-MINOR-PATCH</strong></p><p>*AWS only allows — as a delimiter in Lambda names*</p><p>Benefits include:</p><ul><li>Having semantic versioning</li><li>Multi-AZ Fallback</li><li>Multi-ENV</li></ul><p>Be sure to check it out if you are using AWS Lambdas. I will keep posting tidbits like how we included Lambdas in our CI as well as other practices we have come up with.</p><p>If you have any feedback or suggestions feel free to shoot me a <a href="https://twitter.com/elbuo8">tweet</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=78cba45487f2" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>