<?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 Siddhant Tibrewal on Medium]]></title>
        <description><![CDATA[Stories by Siddhant Tibrewal on Medium]]></description>
        <link>https://medium.com/@siddhantvirus?source=rss-340b3d8dfd6f------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*lgu3ZNVrS3vlI4QxVpYEVw.jpeg</url>
            <title>Stories by Siddhant Tibrewal on Medium</title>
            <link>https://medium.com/@siddhantvirus?source=rss-340b3d8dfd6f------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 29 Nov 2026 14:06:55 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@siddhantvirus/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[How to deploy a repository with private submodules on Heroku]]></title>
            <link>https://siddhantvirus.medium.com/how-to-deploy-a-repository-with-private-submodules-on-heroku-83bb5870a072?source=rss-340b3d8dfd6f------2</link>
            <guid isPermaLink="false">https://medium.com/p/83bb5870a072</guid>
            <category><![CDATA[heroku]]></category>
            <category><![CDATA[docker]]></category>
            <category><![CDATA[gitsubmodule]]></category>
            <category><![CDATA[git]]></category>
            <dc:creator><![CDATA[Siddhant Tibrewal]]></dc:creator>
            <pubDate>Tue, 08 Dec 2020 11:59:39 GMT</pubDate>
            <atom:updated>2020-12-08T11:59:39.431Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*AtPJqRazFwjv-0jk" /><figcaption>Photo by <a href="https://unsplash.com/@ilyapavlov?utm_source=medium&amp;utm_medium=referral">Ilya Pavlov</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>A few days ago, I was trying to deploy a NodeJS application on Heroku. When I was trying to push the same to Heroku using the Heroku CLI, I got an error stating that the deployment failed, since the CLI could not access the private submodule.<br>The <a href="https://devcenter.heroku.com/articles/git-submodules#protected-git-submodules">Heroku documentation</a> provides a workaround for this to allow it to resolve Private Submodules in non-local environments —</p><blockquote>For instance, to add the FooBar submodule using an HTTP basic authentication URL scheme (note the presence of the username:password tokens):</blockquote><pre>git submodule add <a href="https://username:password@github.com/myusername/FooBar%60">https://username:password@github.com/myusername/FooBar</a></pre><p>The problem with the method is that git submodule references are stored in plaintext in the<strong><em> .git/submodules </em></strong>directory, and thus, it can be a security issue.</p><p>Heroku allows us to deploy an application using a container as well.<br>Thus, I created a simple Dockerfile to build my project and then push it to Heroku’s Container Registry.</p><p>This example uses a NodeJS project to show the same.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/63332a95c1b4fe4378e9f9a17e9f1652/href">https://medium.com/media/63332a95c1b4fe4378e9f9a17e9f1652/href</a></iframe><p>This `Dockerfile` needs to be added to the root folder of your NodeJS folder.</p><p>You also need to add a <strong><em>.dockerignore</em></strong> file as follows:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/eba0c7640a427e4033f825b508061262/href">https://medium.com/media/eba0c7640a427e4033f825b508061262/href</a></iframe><p>Heroku will always ignore the PORT you have set for your project, and thus your NodeJS app must use the value</p><pre><strong>const PORT = process.env.PORT || 5000</strong></pre><p>This is to ensure that the project runs both locally and on the Heroku deployment.</p><p>After this follow the given steps using <a href="https://devcenter.heroku.com/articles/heroku-cli#download-and-install">Heroku CLI</a></p><pre><strong>$ heroku login<br>$ heroku container:login <br>$ heroku create &lt;optional app name&gt;<br>$ heroku container:push web<br>$ heroku container:release web<br>$ heroku open</strong> </pre><p>Here we first login to our Heroku Account and then the <strong>Heroku Container Registry</strong>, followed by creating a new Heroku app and then building the Docker image using <strong>push</strong> and then using the <strong>release</strong> command to “release” the image to your app.</p><p>You can then use <strong>heroku open</strong> to access your application!</p><p>Congratulations 🎉, you have now deployed your project on Heroku using Containers and even avoided having to copy the submodules to a new Repository or compromising your security by saving the password in plaintext.</p><p>You can repeat the given steps every time you have a new build!</p><p>I hope this helps someone 😄</p><p><strong>Credits : </strong><br>1. <a href="https://devcenter.heroku.com/">Heroku Dev Center</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=83bb5870a072" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>