tioover
V2EX  ›  编程

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

  •  
  •   tioover · Jul 16, 2012 · 3353 views
    This topic created in 5226 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
    bcxx
    Jul 16, 2012
    1
    meta programming?

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