What is the right way to maintain a “version for the server” - with only config files changed, in Git?

前端 未结 3 902
北恋
北恋 2020-11-22 04:35

I sometimes work with Codeigniter, and after I\'m done developing on the local site, I need to migrate the files to the server. All the files in the /config/ fo

3条回答
  •  野趣味
    野趣味 (楼主)
    2020-11-22 04:50

    It depends on Your needs. In my company we use other approach. We've created several environments (where the asterix is internal project name):

    • devel - site runs on domain **.local.com*
    • test - site run on domain test.*.company.com
    • beta - beta.*.company.com
    • production - every other domain.

    Based on the domain name we switch automatically configurations. Basicly config file looks like:

     array(
        'devel' => array(
          // config for devel
        ),
        'production' => array(
          // config for production
        )
      )
    );
    ?>
    

    Some frameworks (AFAIR Zend) set the environment name in Virtual Host config (or .htaccess). You should look at: zend framework auto switch production staging test .. etc

    Have You looked at CI documentation? There's a section about it.

提交回复
热议问题