R
R
Renat Sagdeev2015-07-05 14:36:29
git
Renat Sagdeev, 2015-07-05 14:36:29

How to properly deploy a site?

Hello.
Perhaps the question is banal, but still, how to properly deploy a site?
I googled of course, and found several solutions:
1. Using post-receive on the server.
2. With the help of capistrano.
etc.
I searched on the toaster, but did not find a suitable solution.
All I need to do is upload HTML/CSS/js to the server and basically that's it. (vps on digitalocean)
I read articles, and it seems like post-receive is not quite right, and capistrano is not needed for a simple site.
In the end, what will be more correct and more convenient? Not through sftp to fill in.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
N
Nazar Mokrinsky, 2015-07-05
@nazarpc

In my post-receive:

#!/bin/sh
cd ..
env -i git reset --hard

Well, in .git/config:
[receive]
  denyCurrentBranch = ignore

Works great, quite satisfied. Directly from the IDE push to the production branch - and you're done.
I don't think there's a definitive answer to what's right and what's wrong.

K
kompi, 2015-07-05
@kompi

1) It is possible to use an IDE, for example, Phpstorm has to do upload and show diffs;
2) You can use git hooks, use a central repository, or like nazarpc ;
3) You can use CI;
1 - useful only if the team is 1 developer.
2 is quite easy to set up.
3 - convenient when, in addition to copying, some other manipulations are performed on the code.
2nd and 3rd options - it would be nice to be able to configure for general development.
PS "Correctly and conveniently" are relative and subjective concepts.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question