tioover
V2EX  ›  编程

什么方法生成项目对别的程序的配置文件(比如说Nginx)比较好?

  •  
  •   tioover · Jul 16, 2012 · 2973 views
    This topic created in 5052 days ago, the information mentioned may be changed or developed.
    写了一个类似项目模版的东西(这东西写的很烂,目前在重写中),用到了Nginx Upload module一类的,为了方便,写了个配置文件的示例,又想,既然有了示例,为什么不写个脚本来生成配置文件?

    脚本读取项目的配置文件,然后将别的程序的配置文件里面专门留下来用来替换的字符串 例如 {{{site_name}}}

    具体是这样的

    https://github.com/tioover/hanger/tree/master/example/conf

    https://github.com/tioover/hanger/blob/master/example/project_initer.py

    感觉这种方法丑的不行,有没有更好一点的方法
    4 replies    1970-01-01 08:00:00 +08:00
    bcxx
        1
    bcxx  
       Jul 16, 2012
    meta programming?

    autoconf?
    allenwei
        2
    allenwei  
       Jul 16, 2012
    如果不嫌折腾,用chef吧,包括服务器搭建,配置文件管理都搞定了
    skydiver
        3
    skydiver  
       Jul 16, 2012
    用perl的格式化报表输出就行了。。。
    Kvm
        4
    Kvm  
       Jul 16, 2012
    我一直想搞个小型管理nginx群的方案
    自己本身不是技术控出生 压力很大
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   1210 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 62ms · UTC 17:48 · PVG 01:48 · LAX 10:48 · JFK 13:48
    ♥ Do have faith in what you're doing.