Pushing from subversion to web server

前端 未结 7 628
既然无缘
既然无缘 2021-01-31 10:23

Long ago I tried to sort out my system between local, web server and subversion. I got some good explanation on this question.

Unfortunately I hit a road block on the w

相关标签:
7条回答
  • 2021-01-31 11:01

    simply - login to your server machine and checkout the repository contents. This should be done just once.

    $ svn checkout [http|svn|whatever_you_got_there]://{your_svn_repo} {checkout_directory}
    

    Everytime you need to update your working copy with the newest one, perform update:

    $ cd {checkout_directory}
    $ svn update
    
    0 讨论(0)
  • 2021-01-31 11:08

    Unless your hosting company has given you access to either cron(1) or a shell, it will be difficult as svn, a centralised VCS, does not have a way to push things to a working directory, you are supposed to svn update.

    Several ways to do what you want, depending on the above mentioned resources available:

    1. define a crontab(5) entry that does cd $WEBSITE && svn update
    2. use ssh to connect to your website and do the same command. The ssh can be automated by a crontab entry on your side.
    3. have a special cgi on your website, hopefully protected by password, that could be run periodically (from cron on your side) that does the same command.

    Best way to me will still be moving to a decentralized VCS (like Mercurial or git) but that is a much bigger project.

    0 讨论(0)
  • 2021-01-31 11:13

    If you have SSH access you could do:

    svn export [url to repo] [web directory]

    Export will mean you don't get the .svn baggage that comes with a working copy.

    0 讨论(0)
  • 2021-01-31 11:16

    You say 'automatically push'. This can be accomplished with a post-commit hook. I've been a one-man dev crew and use a set up like so for PHP dev:

    VPS LAMP stack with Apache's mod_dav_svn handling SVN duties hosting a 'staging' version of the site. The 'staging' version of the site was actually a working copy, just checked out locally, to a directory that Apache could serve from

    local VMware machine running NetBeans and LAMP stack, with xdebug installed for debugging PHP

    My workflow went like this:

    Check out a working copy from my VPS to my VMware virtual machine Get a database dump via PhpMyAdmin from VPS and import into MySQL on virtual machine dev my ass off, all locally at the end or day, export my database and upload it to MySQL on the VPS commit my changes to the VPS

    The crux was the post commit hook - all it is, is a text file in SVN that is parsed after every commit event. You have it call a shell script, and that shell script does a 'svn update' to update the working copy that is your staging site that Apache is serving.

    I suppose you could as easily have the shell script do an SVN export to your staging directory, but that might take awhile to run, whereas an update to a working copy just puts changes.

    These notes are pretty jacked up, but they're my personal cheat sheet I use when setting something like this up:

    http://random.siliconrockstar.com/dev_ShellScriptingAndNixAdmin/SVN.txt

    If you want, I also have a copy of the VM with NetBeans all configured that I use for development, I used to hand them out to junior devs. If you want a copy just PM me.

    0 讨论(0)
  • 2021-01-31 11:18

    Release Management

    you can create an job/batch which exports the svn to a local folder. after the export you can upload it with rsync.

    the job can automatically execute by the svn hooks.

    you can also use mtod ways but keep in mind: using a checkout on the server is a security risk, if someone can access the .svn folders! they can access the php code and see passwords or bugs.

    0 讨论(0)
  • 2021-01-31 11:21

    have you tried using our FTP deploy on Beanstalk? We also have web-hooks available, which means you can ping a URL on each commit to code your own stuff.

    http://help.beanstalkapp.com/articles/17-deployment-and-releases

    0 讨论(0)
提交回复
热议问题