The Cache: Technology Expert's Forum
 
*
Welcome, Guest. Please login or register. September 22, 2019, 05:16:50 AM

Login with username, password and session length


Pages: [1] 2
  Print  
Author Topic: code deployment system?  (Read 4975 times)
nutballs
Administrator
Lifer
*****
Offline Offline

Posts: 5627


Back in my day we had 9 planets


View Profile
« on: April 09, 2009, 07:19:10 PM »

I know there is another thread kind of, specifically SVN.

however, anyone suggest a client side windows app,
that can scan directories, looking for updated files, and copy them to a another directory?

basically a simple code deployer?

I don't need, nor want, any bells and whistles. And I am just trying to avoid having to write my own VBscript to do it.

I cant even figure out what to search for on google in this case.
Logged

I could eat a bowl of Alphabet Soup and shit a better argument than that.
perkiset
Olde World Hacker
Administrator
Lifer
*****
Offline Offline

Posts: 10096



View Profile
« Reply #1 on: April 09, 2009, 10:17:21 PM »

I'll betcha VS could cobble together an rsync method.

I wrote a little php system that does it pretty manually - it asks the master for the listing of all files and dates - it compares them against itself locally, pulling up whatever is out of sync. The delivery is via HTTP and Apache. Works pretty well, although it's far from perfect. It's also pull oriented, rather than push oriented. Some of the earliest PHP code I wrote, still in production today, keeping cached content up to date on load balanced HTML renderers. I could probably grab it all if you want, but knowing that method you'd probably write it better today.
Logged

It is now believed, that after having lived in one compound with 3 wives and never leaving the house for 5 years, Bin Laden called the U.S. Navy Seals himself.
nutballs
Administrator
Lifer
*****
Offline Offline

Posts: 5627


Back in my day we had 9 planets


View Profile
« Reply #2 on: April 09, 2009, 10:37:37 PM »

Nah, thats ok but thanks.

I most likely will just write a VBS to do it.
I think it might be annoying to have to SSH, or even hit a webpage just to deploy code. Instead I could just double click a file on my desktop and it would do its thing.
I gotta see if there is way to track changes so I don't have to scan everytime.
Logged

I could eat a bowl of Alphabet Soup and shit a better argument than that.
perkiset
Olde World Hacker
Administrator
Lifer
*****
Offline Offline

Posts: 10096



View Profile
« Reply #3 on: April 09, 2009, 10:46:13 PM »

A scan doesn't take that long... and if you kept a simple XML file locally with the last push dates, it'd be a snap.
Logged

It is now believed, that after having lived in one compound with 3 wives and never leaving the house for 5 years, Bin Laden called the U.S. Navy Seals himself.
vsloathe
vim ftw!
Global Moderator
Lifer
*****
Offline Offline

Posts: 1669



View Profile
« Reply #4 on: April 10, 2009, 08:57:55 AM »

rsync -r

is incremental by default.

Code:
rsync -r /home/nutballs/code/. nutballs@myhost:/var/www/html/.

Quite fast and efficient. Put it into an alias by editing your .bashrc

This is assuming that you run a linuxish OS or at least cygwin.
Logged

hai
nutballs
Administrator
Lifer
*****
Offline Offline

Posts: 5627


Back in my day we had 9 planets


View Profile
« Reply #5 on: April 10, 2009, 08:09:15 PM »

hmm. i wonder.

I could do a cron that scans all the root web directories for a "deploy" file every few minutes
then execute an rsync on that webfolder.

If i want to deploy a website, I just would drop a file named "deploy" into the root of that site, and then it would push live at the next scan.
I think that would work, and be simple enough.

so then I now have another question about MySQL, but starting a new thread.
Logged

I could eat a bowl of Alphabet Soup and shit a better argument than that.
deregular
Expert
****
Offline Offline

Posts: 172


View Profile
« Reply #6 on: April 10, 2009, 11:25:44 PM »

I had very much the same kind of question a little while ago, however rsync wont do it for me, as the sites im updateing are on a reseller account with no SSH access.

So I opted to write a simple php script that read a seperate file list (core files that were singled out as files that do not change across sites) - just a text file list really. And then zipped them up. I can manually move that zip file across with another which activates the zip to unzip and overwrite, or choose to ftp that zip file automatically once its finished zipping, and then access the update file in order to unzip it automatically, have not coded the ftp stuff yet, so I am doing it manually for the moment, but uploading 2 files and unzipping is still a hell of a lot quicker than uploading the individual files. Unzipping is way faster in linux by comparison.

Would be interested in responses to your mysql db thread so Ill follow that too, thanks for bringing it up NB.
« Last Edit: April 11, 2009, 11:09:10 PM by deregular » Logged
nutballs
Administrator
Lifer
*****
Offline Offline

Posts: 5627


Back in my day we had 9 planets


View Profile
« Reply #7 on: April 11, 2009, 09:20:50 AM »

Ya the machines in my case are all stacked on top of each other and behind ipcop, so ssh and whatever else could be needed is fine.

I was going to do a management system, like it sounds like you are doing.
I still might go that route. Have a list of domains, hit deploy on the one you want.

I could then list the changed files as well and deploy individual files... hmmmm.
Logged

I could eat a bowl of Alphabet Soup and shit a better argument than that.
vsloathe
vim ftw!
Global Moderator
Lifer
*****
Offline Offline

Posts: 1669



View Profile
« Reply #8 on: April 11, 2009, 05:31:17 PM »

I would just make an rsync alias in your .bashrc man.

Make it so you can type "deploy site1", "deploy site2", etc. but obviously use more descriptive names than site1 site2...
Logged

hai
nutballs
Administrator
Lifer
*****
Offline Offline

Posts: 5627


Back in my day we had 9 planets


View Profile
« Reply #9 on: April 11, 2009, 06:43:03 PM »

I need it a little more automated than that, because of some of my work i do.
I also need a little more fine grained control, like deploying a directory only.

You guys gave me some ideas though, and I am going to write a quick dev to live deployer.
I will post it here, to see if we can improve it since I don't know the backend tricks that are available like rsync.

Logged

I could eat a bowl of Alphabet Soup and shit a better argument than that.
perkiset
Olde World Hacker
Administrator
Lifer
*****
Offline Offline

Posts: 10096



View Profile
« Reply #10 on: April 12, 2009, 10:09:44 AM »

LOL you're back to my cached update system. It's cronned to run once a minute, making sure that all the machines behind the master are up to date. Each one pulls for itself, the main machine has a private Apache config that allows access to source files. Switching that to a push rather than a pull would be pretty easy I think.
Logged

It is now believed, that after having lived in one compound with 3 wives and never leaving the house for 5 years, Bin Laden called the U.S. Navy Seals himself.
nutballs
Administrator
Lifer
*****
Offline Offline

Posts: 5627


Back in my day we had 9 planets


View Profile
« Reply #11 on: April 12, 2009, 01:51:18 PM »

yea. I swam with a couple ideas in prototype, but I think I have settled on something that is portable, and simple to use.
Its a little hands on, but, thats actually how I want it now that I ran through some scenarios.

Logged

I could eat a bowl of Alphabet Soup and shit a better argument than that.
nop_90
Global Moderator
Lifer
*****
Offline Offline

Posts: 2203


View Profile
« Reply #12 on: April 16, 2009, 06:49:43 PM »

Simple linux command called rsync Smiley
so i make a little bash script like this

Code:
#/bin/sh
rsync --filter "- *.pyc" --filter "- /database/" -av -e ssh ~/Projects/xxxx/ server:Projects/xxxx/

server is set in hostname to what ever IP server is at.
I also setup public key encrytion so I do not need to enter password all the time (rsync runs over ssh)

If you where really keen you could using PHP etc run the rsync and modify variables in it.
Also you can add flags to compress etc.
Logged
nutballs
Administrator
Lifer
*****
Offline Offline

Posts: 5627


Back in my day we had 9 planets


View Profile
« Reply #13 on: April 16, 2009, 10:25:58 PM »

yea. I am using rsync to backup assorted things, but it's too "over reaching" for deployment.

Part of the problem is that I work on multiple things over time. Like two sections of a site. 1 is finished first, but I wouldnt want to deploy the whole site's worth of changes.

In the end, I really need a system that is able to deploy single files, directories, or full sites, depending on what I need. So I think I have a good little system in progress now, and when its "done" i will post it.
file based, granular to the file level, and able to deploy directories recursively, and we based.
Logged

I could eat a bowl of Alphabet Soup and shit a better argument than that.
vsloathe
vim ftw!
Global Moderator
Lifer
*****
Offline Offline

Posts: 1669



View Profile
« Reply #14 on: April 18, 2009, 02:50:09 PM »

Interesting. You have sites with that many static files, or source code files that it would really be a pain to re-import everything? Why not just have standard libs that rarely if ever get changed or pushed out, as your "framework" if you want to call it that...and then deploy the code specific to various sites on-demand?
Logged

hai
Pages: [1] 2
  Print  
 
Jump to:  

Perkiset's Place Home   Best of The Cache   phpMyIDE: MySQL Stored Procedures, Functions & Triggers
Politics @ Perkiset's   Pinkhat's Perspective   
cache
mart
coder
programmers
ajax
php
javascript
Powered by MySQL Powered by PHP Powered by SMF 1.1.2 | SMF © 2006-2007, Simple Machines LLC
Seo4Smf v0.2 © Webmaster's Talks


Valid XHTML 1.0! Valid CSS!