A
A
Artem00712017-10-13 10:03:48
git
Artem0071, 2017-10-13 10:03:48

How is versioning done?

Project:
backend - api.site.com - pure php (without using frameworks)
front - site.com - vue.js
First I do it locally Then I make
changes in git and upload via ftp to the server and to the front
1 problem: After all, when I I fill in, there is a gap of ~ a minute when the back does not match the front
2 problem: I do it on the local => all links are initially on localhost. At what point should I change them to the production server? (for example, a link to submit a form on the front - api.localhost.com/auth When to change to api.site.com/auth (before commit or after, or in general?))
Problem 3: I often see in all sorts of articles that people make a commit to master and everything is automatically uploaded somehow, maybe this will help somehow?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
E
Egor Zhivagin, 2017-10-13
@Krasnodar_etc

3 - yes, there is webhook.js for git for that. How to create it - in Google a bunch of manuals. It seems to work via ssh, that is, you need to make yourself an ssh key for git . Again, there are many manuals on this topic.
2 - Environment variables. For example, before starting the project, write in the console: export NODE_ENV=development
In the template/code, create a variable that will be responsible for links depending on the value of NODE_ENV .
And that's all, it remains to substitute this variable in the link.
1 - webhook.js helps with this as well.

M
Maxim Fedorov, 2017-10-13
@Maksclub

At what point should I change them to the production server?

Take it out to the config so that the links in the code are not written, but the variable from the config is written. Learn how frame environments are made, it's not difficult to repeat the simplest configuration. Node.js has environments through NODE_ENV,
I also found https://habrahabr.ru/company/nordavind/blog/197166/
Is this how FTP appeared when working with Git? Git on local, git on server, repository in the middle.
1. Locally made changes, committed -- pushed to the repo
2. Pulled from the repo to the server
Before that, they committed to other branches and tested everything, then merged into the master, and the already configured software sees the changed master and rolls it to the combat server along with various migrations, additional changes (for example, the config of nginx has changed or the node has been restarted)
1. Study how to set up a simple environment (develop + production)
2. Understand how GIT works
3. Dig towards CI,
https://habrahabr.ru/post/82724/

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question