8

Current Situation

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.

enter image description here

So we did it like this.

What's wrong?

The git clone is painfully slow and our files are > 50 mb.

What have you tried?

I am thinking of setting up an intermediate server in HongKong to reduce the latency for git clone.

enter image description here

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.

So what's your issue?

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.

Kim Stacks
  • 10,202
  • 35
  • 151
  • 282
  • 2
    Do you need to clone the whole git history in the China server? Or do you only need the working copy? If the latter, you could do a shallow clone, which will improve performance – vguzmanp Sep 22 '16 at 08:05
  • wow. i didn't know there was such a thing as a shallow clone. I don't mind trying that. yes i only need working copy. – Kim Stacks Sep 24 '16 at 07:05

1 Answers1

2

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.

vguzmanp
  • 785
  • 1
  • 10
  • 31