Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I agree with @adietisheim's answer: you need to understand better git before deploying with openshift =)</p> <p>Now, even if you understand git, it is not necessarily obvious how to deploy your existing repo if your directory structure does not match the directory structure required by openshift, and if you want to keep your old directory structure.</p> <p>For that, I have the following tips:</p> <ul> <li><p>separate options that are deployment dependent from those that are not into different files. For example, I separate my database settings from other settings into different files as:</p> <ul> <li><p>settings_deploy/openshift</p></li> <li><p>settings_deploy/localhost</p></li> </ul> <p>and then symlink to your localhost test as something like:</p> <pre><code>ln -s settings_deploy/localhost settings_deploy_file </code></pre> <p>Another option is to detect the host by using environment variables:</p> <pre><code>if 'OPENSHIFT_APP_NAME' in os.environ: //openshift configurations else: //localhost </code></pre> <p>This is a bit simpler since it allows you to put all the configs on a single file. It is a bit less general, since if ever another one of your hosts offers an <code>OPENSHIFT_APP_NAME</code> environment variable (unlikely for this one) the method breaks. Anyways, you still have to clearly separate what is deployment dependent and what is not.</p></li> <li><p>create a local deploy directory</p></li> <li><p>clone the initial openshift template into it</p></li> <li><p>create a deploy script that:</p> <ul> <li><p>hardlinks everything from your old existing local to their correct locations at the </p> <p>hardlinks are fast to create and use very little memory</p> <p>you could use something like:</p> <p><code>cp -lrf original_repo_dir deploy_repo_dir</code></p></li> <li><p>keep only the correct <code>settings_deploy</code> file in the deploy repo:</p> <p><code>cd deploy_repo</code></p> <p><code>mv settings_deploy/openshift settings_deploy_file</code></p> <p><code>rm -r settings_deploy</code></p></li> <li><p>force push:</p> <p><code>cd deploy_repo</code></p> <p><code>git push -f origin master</code></p></li> <li><p>clean the deploy repo:</p> <p><code>git reset --hard HEAD</code></p> <p><code>git clean -df</code></p></li> </ul></li> </ul> <p>for those interested in django deployment, I have an example on <a href="https://github.com/cirosantilli/django-cheat/tree/783c803d3334097dc0a59439bee024b8d8490265" rel="nofollow">my github</a>, in particular check out the <code>deploy.sh</code> script and the project <code>projects/elearn</code> which it deploys.</p>
    singulars
    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. 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.
    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