Welcome Guest, Not a member yet? Register   Sign In
Git deployment strategy
#1

[eluser]ammonkc[/eluser]
I'm trying to come up with a good git to deploy my codeigniter applications to staging and production servers. But the problem is I'm trying to keep the codeigniter system and application directories above the html root directory for security purposes. This is what my folder structure looks like
Code:
/Library/WebServer/
    Codeigniter/
        application/
            mysite1/                /* application with git repo */
            mysite2/
        system/
            ci-1.7.2/
            ci-1.7.3/
            ci-2.0.0/
            ci-2.0.0-r/           /* codeigniter-reactor */
    Documents/
        mysite1/
            public/                   /* html root */
                assets/
                index.php
            secure/                  /* ssl root */
                assets/
                index.php
        mysite2/
using git push to deploy changes from my local machine to a staging server and production server works well except that my index.php and assets folder are separated from the application. How could I include the index.php file along with my javascript and css assets in a git workflow?
#2

[eluser]Lucas Vasconcelos[/eluser]
maybe you should use a layout like:

Code:
/var/www    /* you ftp root dir */
   - .git
   - /application
   - /system

/var/www/yourdomain.com /* your public www dir */
   - index.php

your local git repository must have the following structure:

Code:
/your-development-path/
  - .git
  - /application
  - /system
  - /yourdomain.com
  - /index.php


so, when you pull the changes for remote repository all your files will be updated!

Wink


another way [more sophisticated] is use some build automation tool, like phing
#3

[eluser]ammonkc[/eluser]
That works fine for a setup with a single codeigniter instance. But I have many different websites setup using virtualhosts.
Code:
/var/www                /* you ftp root dir */
   - /application/
       - myWebsite/     /* application */
           .git
           config/
           controllers/
           views/
           etc..
       - anotherSite/   /* application */
           .git
       - intranet/
       - othersite/
       - somewebapp/
   - /system/           /* Codeigniter system */

/var/www/html/
   - myWebsite/         /* virtualhost document root */
       index.php
   - anotherSite/       /* virtualhost document root */
       index.php
   - intranet/          /* virtualhost document root */
       index.php
   - othersite/         /* virtualhost document root */
       index.php
   - somewebapp/        /* virtualhost document root */
       index.php

The only way that I can think of to deploy one of those applications with a git push is if I did something funky with a symlink to the index.php
Code:
var/www                /* you ftp root dir */
   - /application/
       - myWebsite/     /* application and git repo that includes symlink to outside index.php */
           .git
           config/
           controllers/
           views/
           index.php       /* symlink to > var/www/html/myWebsite/index.php */
       - anotherSite/   /* application */
           .git
/var/www/html/
   - myWebsite/         /* virtualhost document root */
       index.php
   - anotherSite/       /* virtualhost document root */
       index.php
#4

[eluser]Lucas Vasconcelos[/eluser]
you'r right! the symlink sounds like a good workaround (y)




Theme © iAndrew 2016 - Forum software by © MyBB