A git server with Nginx as the HTTP frontend and fast cgi wrapper for running the git http backend
This is currently manually deployed as kim-nginx on ECS. You need to log into AWS, and then perform then execute the following with AWS CLI v2. The full instructions can be found on AWS Web Console by going to ECR, clicking "kim-nginx" then "View Push Commands" in the top right corner.
docker build -t kim-nginx .
docker tag kim-nginx:latest xxxxxx.dkr.ecr.eu-central-1.amazonaws.com/kim-nginx:latest
docker push xxxxxx.dkr.ecr.eu-central-1.amazonaws.com/kim-nginx:latest
Then on AWS web console:
- Go to Elastic Container Service
- Click on "Task Definitions"
- Click on "Nginx-Git-Server"
- Click on the most recent revision
- Click on "Update Definition" in top right corner
- Click next until then end and then create with existing options.
After executing the above, the running tasks should update to the new latest revision after a few minutes.
- Go to Elastic Container Service
- Under the "Amazon ECS" sidebar header, click on "Clusters" (there are two mentions of "Clusters" in the sidebar, click on the right one.)
- Click on "Internal-Services"
- Click on "Nginx-Git-Server" in the list
- Click "Update" in top right corner
- Check the box "force-redeploy"
- Click "Skip to Review"
- Click "Update Service"
In order to test serving repositories from ./example/initial, do the following:
- Build an image based on your Nginx config.
docker build -t local-gitserver-http .
- Run the image to serve the repos.
make example
Then you can either query your repos, like:
curl localhost:8080/myrepo.git/info/refs
Or actually clone a repo:
git clone http://localhost:8080/myrepo.git
While doing this, in the tab where you have make example
executed, you'll be able to see whether your request hit the cache.
Note: If you run into issues with exit code 128, build your docker image with --no-cache
option.
Run a local test with make test
. Note, you have to build the image with --no-cache
after each test run or you run into exited with code 128
.