Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>So, I recently did something similar, and found that the strategy below is the best option. I'm going to assume that you are familiar with git branching at this point, as well as Heroku remotes. If you aren't, you should read this first: <a href="https://devcenter.heroku.com/articles/git#multiple-remotes-and-environments" rel="noreferrer">https://devcenter.heroku.com/articles/git#multiple-remotes-and-environments</a></p> <p>The main strategy I'm taking is to have a single codebase (a single Git repo) with:</p> <ul> <li>A <code>master</code> branch that contains all your shared code: templates, views, URLs.</li> <li>Many <code>site</code> branches, based on <code>master</code>, which contain all site-specific customizations: css, images, settings files (if they are vastly different).</li> </ul> <p>The way this works is like so:</p> <p>First, make sure you're on the <code>master</code> branch.</p> <p>Second, create a new git branch for one of your domains, eg: <code>git checkout -b somedomain.com</code>.</p> <p>Third, customize your <code>somedomain.com</code> branch so that it looks the way you want.</p> <p>Next, deploy <code>somedomain.com</code> live to Heroku, by running <code>heroku create somedomain.com --remote somedomain.com</code>.</p> <p>Now, push your <code>somedomain.com</code> branch code to your new Heroku application: <code>git push somedomain.com somedomain.com:master</code>. This will deploy your code on Heroku.</p> <p>Now that you've got your <code>somedomain.com</code> branch deployed with its own Heroku application, you can do all normal Heroku stuff by adding <code>--remote somedomain.com</code> to your normal Heroku commands, eg:</p> <ul> <li><code>heroku pg:info --remote somedomain.com</code></li> <li><code>heroku addons:add memcache:5mb --remote somedomain.com</code></li> <li>etc.</li> </ul> <p>So, now you've basically got two branches: a <code>master</code> branch, and a <code>somedomain.com</code> branch.</p> <p>Go back to your <code>master</code> branch, and make another new branch for your next domain: <code>git checkout master; git checkout -b anotherdomain.com</code>. Then customize it to your liking (css, site-specific stuff), and deploy the same way we did above.</p> <p>Now I'm sure you can see where this is going by now. We've got one git branch for each of our custom <code>domains</code>, and each domain has it's own Heroku app. The benefit (obviously) is that each of these project customizations are based off the <code>master</code> branch, which means that you can easily make updates to <em>all</em> sites at once.</p> <p>Let's say you update one of your views in your <code>master</code> branch--how can you deploy it to <em>all</em> your custom sites at once? Easily!</p> <p>Just run:</p> <ul> <li><code>git checkout somedomain.com</code></li> <li><code>git merge master</code></li> <li><code>git push somedomain.com somedomain.com:master</code> # deploy the changes</li> </ul> <p>And repeat for each of your domains. In my environment, I wrote a script that does this, but it's easy enough to do manually if you'd like.</p> <p>Anyhow, hopefully that helps.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload