E
E
Evanre2015-09-04 23:57:07
git
Evanre, 2015-09-04 23:57:07

Working environment: gulp + git + deploy to the server. How to work with git correctly?

I'm building a frontend in Gulp. The client needs to be shown the work, browserSync works very crookedly and is not stable, especially with regard to the tunnel being raised. Deployed a server on digital ocean. I want to set up the work with the following bundle: I collect via gulp, I commit to the repository and the source and build of the project, and I only pull the build to the server.
What is the best way to do this?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
I
Igor Deyashkin, 2015-09-07
@Evanre

I can offer two options:

  1. Write as usual, set up synchronization of the folder with the collected code with your remote server via rsync or winscp
  2. You can upload your code to the server only when pushing to the repository. Then you set up a hook in the repository that will build the project and send it to your server. It can be implemented in different ways, depending on where the main git repository is located, whether there is ssh access to the web server from there, etc.
    For example, you can do this: Install git on the web server, and when pushing to the repository on the web server via ssh, a command will be sent to run the deployment script. He will pull and build the project
    In any case, I don't think it's a good idea to keep the build in the code repository. It's almost like storing compiled binaries there =)

E
Evanre, 2015-09-06
@Evanre

In general, I made 2 repos on bitbucket.
- In the first comic, according to all the rules, the source code.
- In the second commic only for the pull build on the server.

P
Pavel Kononenko, 2015-09-05
@premas

Either make git init only for the directory with builds, or write in .gitignore everything that should not participate in the commit history.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question