You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by Totte Karlsson <to...@monkisoft.com> on 2009/02/23 02:23:04 UTC
How to handle configuration/ini files in a sandbox
Hi,
I'm using subversion to handle some websites. In a site I may have
some configuration files say, web.ini.
I want to keep web.ini in the repository, but I don't want it to be
updated when doing a svn update. Also, I only want the file to be
committed when specifically saying so.
The reason is that my webcode looks in web.ini, but depending on the
website, the web.ini have different values. I
I only want it to be updated when I specifically wants it to.
Is the above possible with subversion?
thanks
-totte
------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=1065&dsMessageId=1212162
To unsubscribe from this discussion, e-mail: [users-unsubscribe@subversion.tigris.org].
Re: How to handle configuration/ini files in a sandbox
Posted by Totte Karlsson <to...@gmail.com>.
Seems this got posted twice?
See answer above!
Thanks
Totte Karlsson wrote:
> Hi,
> I'm using subversion to handle some websites. In a site I may have
> some configuration files say, web.ini.
> I want to keep web.ini in the repository, but I don't want it to be
> updated when doing a svn update. Also, I only want the file to be
> committed when specifically saying so.
>
> The reason is that my webcode looks in web.ini, but depending on the
> website, the web.ini have different values. I
>
> I only want it to be updated when I specifically wants it to.
>
> Is the above possible with subversion?
>
> thanks
> -totte
>
> ------------------------------------------------------
> http://subversion.tigris.org/ds/viewMessage.do?dsForumId=1065&dsMessageId=1212162
>
> To unsubscribe from this discussion, e-mail: [users-unsubscribe@subversion.tigris.org].
>
------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=1065&dsMessageId=1212561
To unsubscribe from this discussion, e-mail: [users-unsubscribe@subversion.tigris.org].
Re: Re: How to handle configuration/ini files in a sandbox
Posted by David Weintraub <qa...@gmail.com>.
I have a Perl script that wrote just for situations like this. It's an
auto-configuration utility. Basically, any file that needs
configuration will be a template file. The script goes through the
directory structure looking for these template files, fills in any
macros with their correct values, and writes out the configuration
files.
The nice thing is that there is a very basic "programming language"
that is embedded as comments into your configuration templates. These
prompt the person installing the software for information such as IP
addresses, domain names, email addresses, or almost anything that may
need to be set. Once the setup is complete and the configuration files
are generated, an "answer file" stores the user's answers. That way,
when you do an upgrade, and the system already knows the answer, it
skips over the question.
I created this because of this type of situation: Hundreds of
customers and each customer had their own configuration. Plus, our
developers and testers also had their own configuration for their
machines. This program greatly simplified upgrades and installation
for us.
Even better, if a new parameter was needed during an upgrade, the
system would realize it doesn't know the answer to that question and
prompt the user.
Give it a try and see if it helps you in your situation. It's
available from http://dl.getdropbox.com/u/433257/autoconfig.pl. Feel
free to ping me if you need any help with it.
On Thu, Feb 26, 2009 at 1:35 PM, <bl...@collab.net> wrote:
> Thanks David,
> A deploy script is not a good solution in this scenario.
> Say I have 50 websites using web.ini. I create the websites and modify each web.ini to suit each individual site. Now, a new parameter is added to web.ini. At the moment I would have to edit each web.ini file in all 50 sites.
> It would be practical if I could do a svn update in each site and bring in the parameter (with a standard value) in each site. That make sense.
>
> The above would require the web.ini to be part of the repsotiory, however, in the sandbox, the web.ini in each site cannot be commited! Since that would overwrite all default values in the repository.
>
> In short, it would be nice if there was a feature where one could exclude files from commits, but allow them to be updated. That way, if a parameter is added to a ini file, all ini files (at production) could be updated with this new addition. Running a deploy script only works for something that never will get additions. If there are anticipated additions to a file, having them outside the repository is not a good solution since it will require someone to manually bring in the additions.. if we are talking about50 sites it could be done, but what about if we have 500?
>
> Maybe the above solution is already there?
> Is it?
>
> I'm not an advanced svn user (yet) :)
>
> Thanks,
> totte
>
> ------------------------------------------------------
> http://subversion.tigris.org/ds/viewMessage.do?dsForumId=1065&dsMessageId=1234212
>
> To unsubscribe from this discussion, e-mail: [users-unsubscribe@subversion.tigris.org].
>
--
--
David Weintraub
qazwart@gmail.com
------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=1065&dsMessageId=1235459
To unsubscribe from this discussion, e-mail: [users-unsubscribe@subversion.tigris.org].
Re: How to handle configuration/ini files in a sandbox
Posted by Kris Deugau <kd...@vianet.ca>.
blackhole@collab.net wrote:
> Thanks David,
> A deploy script is not a good solution in this scenario.
> Say I have 50 websites using web.ini. I create the websites and modify each web.ini to suit each individual site. Now, a new parameter is added to web.ini. At the moment I would have to edit each web.ini file in all 50 sites.
> It would be practical if I could do a svn update in each site and bring in the parameter (with a standard value) in each site. That make sense.
>
> The above would require the web.ini to be part of the repsotiory, however, in the sandbox, the web.ini in each site cannot be commited! Since that would overwrite all default values in the repository.
>
> In short, it would be nice if there was a feature where one could exclude files from commits, but allow them to be updated. That way, if a parameter is added to a ini file, all ini files (at production) could be updated with this new addition. Running a deploy script only works for something that never will get additions. If there are anticipated additions to a file, having them outside the repository is not a good solution since it will require someone to manually bring in the additions.. if we are talking about50 sites it could be done, but what about if we have 500?
>
> Maybe the above solution is already there?
> Is it?
I don't know of anything native to SVN, but in terms of workflow you
could declare web.ini as the systemwide defaults, and have your code
look for a second file - but run happily without it - with *just* the
site-specific changes to those defaults.
I've done this on a number of bits of code I've written, although
nothing particularly time- or CPU-intensive.
-kgd
------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=1065&dsMessageId=1235050
To unsubscribe from this discussion, e-mail: [users-unsubscribe@subversion.tigris.org].
RE: Re: How to handle configuration/ini files in a sandbox
Posted by Bob Archer <bo...@amsi.com>.
> In short, it would be nice if there was a feature where one could
exclude
> files from commits, but allow them to be updated. That way, if a
parameter
> is added to a ini file, all ini files (at production) could be updated
> Maybe the above solution is already there?
> Is it?
What you could possibly do is use a .template file as suggested in the
FAQ and on those machines where you want to use exactly what is checked
in then create a post update script that renames the .template file to
the correct name.
Then your devs would not have the commit script and they would know they
need to manually update there .ini files when there are changes in the
.template.
BOb
------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=1065&dsMessageId=1234252
To unsubscribe from this discussion, e-mail: [users-unsubscribe@subversion.tigris.org].
RE: Re: How to handle configuration/ini files in a sandbox
Posted by bl...@collab.net.
Thanks David,
A deploy script is not a good solution in this scenario.
Say I have 50 websites using web.ini. I create the websites and modify each web.ini to suit each individual site. Now, a new parameter is added to web.ini. At the moment I would have to edit each web.ini file in all 50 sites.
It would be practical if I could do a svn update in each site and bring in the parameter (with a standard value) in each site. That make sense.
The above would require the web.ini to be part of the repsotiory, however, in the sandbox, the web.ini in each site cannot be commited! Since that would overwrite all default values in the repository.
In short, it would be nice if there was a feature where one could exclude files from commits, but allow them to be updated. That way, if a parameter is added to a ini file, all ini files (at production) could be updated with this new addition. Running a deploy script only works for something that never will get additions. If there are anticipated additions to a file, having them outside the repository is not a good solution since it will require someone to manually bring in the additions.. if we are talking about50 sites it could be done, but what about if we have 500?
Maybe the above solution is already there?
Is it?
I'm not an advanced svn user (yet) :)
Thanks,
totte
------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=1065&dsMessageId=1234212
To unsubscribe from this discussion, e-mail: [users-unsubscribe@subversion.tigris.org].
Re: Update of the svn:executable property
Posted by Ryan Schmidt <su...@ryandesign.com>.
On Feb 24, 2009, at 06:00, A. L. wrote:
> I'm facing the problem of the change of the executable bit of files
> under version control.
> I red the manual and looked around the web and all I got is
> "svn:executable is automatically managed only during adds and
> imports".
>
> How to cope with subsequent "chmods"?
> At the moment, except remapping the chmod command itself and
> bringing it to perform the proper propset or propdel according to
> the chmod parameters that sounds a general bad solution, I cannot
> figure an automatic way to propagate changes of the executable bit.
I am not aware of an existing automated way to detect this. My advice
to you: When you want to make a versioned file executable, do not run
"chmod +x file"; instead run "svn propset svn:executable '*' file".
When you want to remove the executable bit from a versioned file, do
not run "chmod -x file"; instead run "svn propdel svn:executable file".
> I can also imagine a pre-commit script that checks all the
> executable bit of all versioned files and propsets svn:executable
> for all the executable files and propdels for all the others... but
> it's unapplicable for large file bases like the one I'm working with.
Not possible, because the pre-commit hook runs on the server but the
file with the executable bit is on the client. By the time the file
has been encapsulated into a transaction and sent to the server, it
no longer has an executable bit for the pre-commit hook to test.
------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=1065&dsMessageId=1220419
To unsubscribe from this discussion, e-mail: [users-unsubscribe@subversion.tigris.org].
Re: Update of the svn:executable property
Posted by David Weintraub <qa...@gmail.com>.
On Tue, Feb 24, 2009 at 7:00 AM, A. L. <tr...@yahoo.it> wrote:
> Hi all!
> I'm facing the problem of the change of the executable bit of files under
> version control.
> I red the manual and looked around the web and all I got is "svn:executable
> is automatically managed only during adds and imports".
You can add the svn:executeable property any time to any file that
should be executable. When you do a checkout the next time, the
executable bit will automatically be set. No need for chmod.
> I can also imagine a pre-commit script that checks all the executable bit of
> all versioned files and propsets svn:executable for all the executable files
> and propdels for all the others... but it's unapplicable for large file
> bases like the one I'm working with.
You can't have a pre-commit hook make any changes, even add a property
to a file. However, your pre-commit hook script can reject a commit if
it contains files that should be executable, but don't have
svn:executable on them.
In fact, that's exactly what my pre-commit hook script does. After one
or two rejections, people will set the autoprops to put svn:executable
on files that should be executable.
--
David Weintraub
qazwart@gmail.com
------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=1065&dsMessageId=1222042
To unsubscribe from this discussion, e-mail: [users-unsubscribe@subversion.tigris.org].
Update of the svn:executable property
Posted by "A. L." <tr...@yahoo.it>.
Hi all!
I'm facing the problem of the change of the executable bit of files under version control.
I red the manual and looked around the web and all I got is "svn:executable is automatically managed only during adds and imports".
How to cope with subsequent "chmods"?
At the moment, except remapping the chmod command itself and bringing it to perform the proper propset or propdel according to the chmod parameters that sounds a general bad solution, I cannot figure an automatic way to propagate changes of the executable bit.
I can also imagine a pre-commit script that checks all the executable bit of all versioned files and propsets svn:executable for all the executable files and propdels for all the others... but it's unapplicable for large file bases like the one I'm working with.
Do you have better clues?
Thanks,
n3u.
Passa a Yahoo! Mail.
La webmail che ti offre GRATIS spazio illimitato,
antispam e messenger integrato.
http://it.mail.yahoo.com/
------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=1065&dsMessageId=1220399
To unsubscribe from this discussion, e-mail: [users-unsubscribe@subversion.tigris.org].
Re: How to handle configuration/ini files in a sandbox
Posted by David Weintraub <qa...@gmail.com>.
I'm a bit confused what you're asking for:
* Do you mean that you have a bunch of production websites installed
that use the same general set of files, but things like web.ini differ
between those sites?
Or do you mean:
* You have a production website that uses files like web.ini for
configuration. Developers may check out code in Subversion, and they
may modify the web.ini file to match their system, but you don't want
these changes checked in because they cause problems in production.
One thing to do is have a deploy script that configures your
production. One of the things it would do is copy files like
web.ini.template to web.ini. Then, you'd use the svn:ignore attribute
and pre-commit triggers to prevent someone from accidentally
committing a file called web.ini.
That way, developers can create their own web.ini file without
affecting the one used by your production website (since that file's
name is web.ini.template).
On Sun, Feb 22, 2009 at 9:23 PM, Totte Karlsson <to...@monkisoft.com> wrote:
> Hi,
> I'm using subversion to handle some websites. In a site I may have
> some configuration files say, web.ini.
> I want to keep web.ini in the repository, but I don't want it to be
> updated when doing a svn update. Also, I only want the file to be
> committed when specifically saying so.
>
> The reason is that my webcode looks in web.ini, but depending on the
> website, the web.ini have different values. I
>
> I only want it to be updated when I specifically wants it to.
>
> Is the above possible with subversion?
>
> thanks
> -totte
>
> ------------------------------------------------------
> http://subversion.tigris.org/ds/viewMessage.do?dsForumId=1065&dsMessageId=1212162
>
> To unsubscribe from this discussion, e-mail: [users-unsubscribe@subversion.tigris.org].
>
--
--
David Weintraub
qazwart@gmail.com
------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=1065&dsMessageId=1215401
To unsubscribe from this discussion, e-mail: [users-unsubscribe@subversion.tigris.org].