Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
663 views
in Technique[技术] by (71.8m points)

deployment - Using 'git checkout -f' to deploy files from a bare git repo in Gitlab

I am in the process of implementing Gitlab at my workplace and transitioning everyone over to it for better code reviews, issue management directly linked to commits, and integration with user stories on Pivotal tracker.

My current setup for a test app is as such:

  1. Git bare repo with all the code for my PHP based web-app found in: /var/opt/gitlab/git-data/repositories/git/test-app.git

  2. Deploy directory is: /var/www/test-app

In the Git repo directory, I did the following:

export GIT_WORK_TREE=/var/www/test-app
git checkout -f master

This worked like a charm and all the files are accessible in /var/www/test-app as expected.

Here is where I am stumped. I want the Gitlab server to ONLY host the Git bare repos and not the deploy directories. The deploy directory is to be hosted on a separate server.

Is there a way to have a different server setup as the GIT_WORK_TREE? I tried putting my server's details in there such as :

GIT_WORK_TREE=git@devserver.mydomain.com:/var/www/test-app

but no dice.

Is this even possible or am I barking up the wrong tree here? Would love some advice.

Thanks.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...