有一個團隊用web界面開發企業應用程序:java,tomcat,struts,mysql,REST和LDAP對外部服務的調用等等。環境配置管理?
所有配置存儲在context.xml - 包含通過servlet上下文和通過JNDI資源可用的對象可用變量的tomcat特定文件。
開發人員無法訪問生產和質量保證平臺(因爲它應該是),因此context.xml由support/sysadmin團隊管理。
每個版本都有配置,notes.txt有類似的說明:
please add "userLimit" variable to context.xml with value "123", rename "DB" resource to "fooDB" and add new database connection to our new server (you should know url and credentials) named "barDb"
這是不好的。
這是我的想法如何解決它。
每個版本都有特殊配置文件,必需的變量名稱,描述和默認值(如果有的話):即使的web.xml都可以使用。
這裏是僞例如:
foo=bar
userLimit=123
barDb=SET_MANUAL(connection to our new server)
而且還有一個特殊的工具,它支持團隊有違部署神器。 看它(「>」被支持的人輸入文字後):
Config for version 123 of artifact "mySever".
Enter your config file location> /opt/tomcat/context/myServer.xml
+"foo" value "bar" -- already exists and would not be changed
+"userLimit" value "123" -- adding new
+"barDb"(connection to our new server) please type> jdbc:mysql:host/db
Saving your file as /opt/tomcat/context/myServer.xml
Your environment is not configured to run myServer-123.
這將會給我們,如果需要部署在任何環境和更新配置應用能力。
你喜歡我的想法嗎?你用什麼來進行環境配置管理?是否有爲此準備好使用的工具?
謝謝。由於安全原因,開發人員無法訪問生產系統。我們確實使用CI(teamcity),它爲我們構建了工件。但它對平臺配置沒有任何作用。我會更接近puppet和flickr書籍。 – user996142