webdevRefinery Forum: Any easier way to get files from your comp to aws server - webdevRefinery Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Rate Topic: -----

User is offline Wyatt 

  • Group: Members
  • Posts: 293
  • Joined: 08-March 10
  • LocationCANADA!!
  • Expertise:HTML,CSS,PHP,Javascript,SQL

Posted 12 February 2012 - 02:54 PM (#1)

Any easier way to get files from your comp to aws server


In the past year whenever i wanted to get code from me computer to the server i had to sftp in and then ssh into the server and move the files to the htdocs directory. Is thier any way to just push the code to the server?? Thanks
HTML | CSS | PHP | JavaScript | SQL
0


User is offline callumacrae 

  • {{ post.author }}
  • Group: Members
  • Posts: 2862
  • Joined: 20-January 11
  • LocationWarwickshire, England
  • Expertise:HTML,CSS,PHP,Javascript,Node.js,SQL

Posted 12 February 2012 - 03:03 PM (#2)

rsync
git
scp
Front-end developer and writer
Twitter | GitHub | phpBB Contributor and Website Team Member | lynxphp
1


User is offline Lemon 

  • I have a dream...
  • Group: Members
  • Posts: 686
  • Joined: 24-February 11
  • Expertise:HTML,CSS,PHP,Javascript,Node.js,SQL

Posted 12 February 2012 - 03:12 PM (#3)

There's probably a million ways, depending on how you complex you want to get. Most simple:
- Just SFTP into the htdocs directory in the first place and put the files there instead. This would save having to do the SSH part of the process.
- Partly similar to the above, change the http server's root directory to the folder you are currently SFTPing the files to.

A lot of IDEs have the option to upload to the server automatically, either on save or when you want to publish, meaning the above options can be made into one click options

More complex:
- If you are using Git, you could setup a repo on the server as a remote to your local repository. Then have a post receive hook that checks out the latest commit of a certain branch to the htdocs directory. Then, to publish the latest code, you'd do something like
git push live
on your local machine. Edit: Here's a tutorial for this method
Posted Image
In the end, it's not the years in your life that count. It's the life in your years
1


User is offline Wyatt 

  • Group: Members
  • Posts: 293
  • Joined: 08-March 10
  • LocationCANADA!!
  • Expertise:HTML,CSS,PHP,Javascript,SQL

Posted 12 February 2012 - 03:29 PM (#4)

rep to both thanks guys, git is exactly what i wanted but i couldnt find a tut :D
HTML | CSS | PHP | JavaScript | SQL
0


User is offline Daniel15 

  • dan.cx
  • Group: Moderators
  • Posts: 3415
  • Joined: 17-April 10
  • LocationMelbourne, Australia
  • Expertise:HTML,CSS,PHP,Java,Javascript,Node.js,SQL

Posted 12 February 2012 - 04:09 PM (#5)

Git is often overkill, unless you're already using it for your project. I'd just use rsync

I'm on my phone but can't check, but I think the syntax I normally use is
rsync -avz --progress /home/filesyouwanttocopy username@server:/var/www/whatever

Daniel15! :D
Posted Image

Repeat after me: jQuery is not JavaScript. It is not the answer to every JavaScript-related question. When you have to write some JavaScript, do not instantly react with "Oh, I'll do that with jQuery!"

Spoiler
1


User is offline callumacrae 

  • {{ post.author }}
  • Group: Members
  • Posts: 2862
  • Joined: 20-January 11
  • LocationWarwickshire, England
  • Expertise:HTML,CSS,PHP,Javascript,Node.js,SQL

Posted 12 February 2012 - 04:22 PM (#6)

Git <3!
Front-end developer and writer
Twitter | GitHub | phpBB Contributor and Website Team Member | lynxphp
0


User is offline Ruku 

  • I do Linux and that Internet thing.
  • Group: Members
  • Posts: 1349
  • Joined: 17-April 10
  • Location/root
  • Expertise:HTML,CSS,PHP,Javascript,Python,SQL

Posted 12 February 2012 - 06:15 PM (#7)

Git is not a deployment tool, guys. Versioning shouldn't be the production server's issue, and you definitely don't need all those prior revisions cluttering up its disk. Doing a Git push is convenient from a devops perspective, but storing history in production really isn't optimal.
1


User is offline Lemon 

  • I have a dream...
  • Group: Members
  • Posts: 686
  • Joined: 24-February 11
  • Expertise:HTML,CSS,PHP,Javascript,Node.js,SQL

Posted 12 February 2012 - 07:14 PM (#8)

I partly agree; however, for the scale of projects most of us work on, Git is both something we know and a satisfactory stand in for a full on deployment system. From what I've seen around here, our personal projects generally don't have massive code bases, have maybe one or two servers and don't have much in the way of pre-deployment unit testing; in this position I would be hesitant to setup a deployment system that is more complicated than the code is. However, obviously for a larger site where all the above are not the case, I clearly wouldn't expect Git to be a choice for deployment as there are other tools that make code testing and distribution easier.

Whilst I would usually suggest learning the absolutely correct way first time around, in this case it makes very little sense to spend time setting up or building a deployment path when Git acts a reasonable, albeit not perfect, stand in. Going the fully correct way raises the question: at what point do you stop trying to emulate a large scale (and finance) site and accept that the tools that you already know, such as Git, work well enough for what you're trying to achieve? Do we decide that pushing to a live server is no good and have to fork out for another? Do we decide that we must have staging servers to test stuff out? All of these things cost time and potentially money, both of which small projects have little of. I'd much rather chuck things at a Git remote until I can be sure the project is going to work out; the staging and other servers can then be what you can strive for as they become a necessity.

Therefore it's all about reaching a balance between learning how to build a solid deployment system and actually having enough time to spend on your product. As your site grows, the deployment is relatively easy to replace, but a bad code-base is a lot harder; so I'd prefer to spend time getting the code right than the deployment.
Posted Image
In the end, it's not the years in your life that count. It's the life in your years
0


User is offline Daniel15 

  • dan.cx
  • Group: Moderators
  • Posts: 3415
  • Joined: 17-April 10
  • LocationMelbourne, Australia
  • Expertise:HTML,CSS,PHP,Java,Javascript,Node.js,SQL

Posted 12 February 2012 - 09:22 PM (#9)

rsync is just as easy to use as Git for deployment. Actually it's even easier since you don't need to worry about all the Git stuff. rsync is simply a very efficient method to copy files (it only copies the segments that have actually changed). Nothing more.
Daniel15! :D
Posted Image

Repeat after me: jQuery is not JavaScript. It is not the answer to every JavaScript-related question. When you have to write some JavaScript, do not instantly react with "Oh, I'll do that with jQuery!"

Spoiler
0


User is offline Lemon 

  • I have a dream...
  • Group: Members
  • Posts: 686
  • Joined: 24-February 11
  • Expertise:HTML,CSS,PHP,Javascript,Node.js,SQL

Posted 12 February 2012 - 09:46 PM (#10)

View PostDaniel15, on 12 February 2012 - 09:22 PM, said:

rsync is just as easy to use as Git for deployment. Actually it's even easier since you don't need to worry about all the Git stuff. rsync is simply a very efficient method to copy files (it only copies the segments that have actually changed). Nothing more.

Last time I tried Rsync for deployment to an EC2 instance it kept giving an error (to do with connection I think. Ports were open on security group), which is a shame because I have it working perfectly for linked hourly local backups. I'll give it a another go sometime soon anyway, perhaps I'll have more luck with something non-AWS.
Posted Image
In the end, it's not the years in your life that count. It's the life in your years
0


User is offline Daniel15 

  • dan.cx
  • Group: Moderators
  • Posts: 3415
  • Joined: 17-April 10
  • LocationMelbourne, Australia
  • Expertise:HTML,CSS,PHP,Java,Javascript,Node.js,SQL

Posted 12 February 2012 - 10:20 PM (#11)

Hmm... rsync just uses SSH so it should work fine on AWS.
Daniel15! :D
Posted Image

Repeat after me: jQuery is not JavaScript. It is not the answer to every JavaScript-related question. When you have to write some JavaScript, do not instantly react with "Oh, I'll do that with jQuery!"

Spoiler
0


User is offline Ruku 

  • I do Linux and that Internet thing.
  • Group: Members
  • Posts: 1349
  • Joined: 17-April 10
  • Location/root
  • Expertise:HTML,CSS,PHP,Javascript,Python,SQL

Posted 13 February 2012 - 03:51 PM (#12)

View PostLemon, on 12 February 2012 - 09:46 PM, said:

Last time I tried Rsync for deployment to an EC2 instance it kept giving an error (to do with connection I think. Ports were open on security group), which is a shame because I have it working perfectly for linked hourly local backups. I'll give it a another go sometime soon anyway, perhaps I'll have more luck with something non-AWS.

You need to install rsync on the machine you're SSHing into, as well as the one you're running the tool from. The documentation is useless at clarifying that, but you'll get I/O errors if it's not installed on both client and server.

As for scalability, I don't think that even comes into it; it's just good practice and ease of administration and upkeep. Git has its place within any iterative development -> testing -> deployment cycle, but it's essentially a versioning tool. It's impossible to know whether your apps will ever make it big, so you might as well be prepared for whatever comes. I've been caught out in the past... ;)
0


User is offline gibbonweb 

  • 兄ヨハネス
  • Group: Members
  • Posts: 2061
  • Joined: 23-June 10
  • LocationMunich(DE)
  • Expertise:HTML,CSS,PHP,Javascript,Python,SQL,Graphics

Posted 13 February 2012 - 05:29 PM (#13)

View PostRuku, on 13 February 2012 - 03:51 PM, said:

You need to install rsync on the machine you're SSHing into, as well as the one you're running the tool from. The documentation is useless at clarifying that, but you'll get I/O errors if it's not installed on both client and server.

*cough*

man rsync
[... bunch of lines ...]
SETUP
       [...]

       Note  that  rsync  must be installed on both the source and destination
       machines.


wha?
0


Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users


Enter your sign in name and password


Sign in options
  Or sign in with these services