My team is based in Singapore. We needed to install a Django web app inside China for speed reasons for an enterprise client for intranet usage.
So we did it like this.
The git clone is painfully slow and our files are > 50 mb.
I am thinking of setting up an intermediate server in HongKong to reduce the latency for git clone.
Maybe the diagram is a bit off.
We used CircleCI. I think we can get CircleCI to have the following setup.
Whenever GitHub received an update on the master branch of our repo, the HongKong server will pull the latest master branch copy down.
For the China server, I guess I can configure it to do a git pull every day at some off peak hours using cronjob.
I can google for the git setup steps quite easily like this https://git-scm.com/book/en/v1/Git-on-the-Server-Setting-Up-the-Server
My concern is whether my approach described above makes sense.
If it makes sense, then my question is how do I configure the CircleCI to do that?
Our team experience with CircleCi is limited to having it work with GitHub and Heroku. We never have used it with GitHub and a standalone server which we will operate on.
Git allows you to host your own Git server. Instead of setting up your own server, you can also use a hosting service. The most popular Git hosting sites are GitHub and Bitbucket. Both offer free hosting with certain limitations.
Even though a central server may make things somewhat easier, you don't need one. At work, I use some scripts around git-bundle to synchronize my git repositories between machines that are not connected to networks in a way that they can access each other.
The default on both GitHub.com (the website) and in GitHub CLI is using the HTTPS protocol for git operations. This default was chosen for interoperability and ease of use: Git users who are behind firewalls find that traffic to port 443 (HTTPS) is more often allowed than traffic to port 22 (SSH).
You can use a shallow clone in the China server to improve git clone's performance.
For example, if you want only the last version:
git clone --depth 1 <repository-url>
You say that your files are > 50 MB, so it will still take a bit to clone if there are many of them, but at least you only download them once.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With