2013-08-01 24 views
8

有什麼方法可以在OpenShift中配置私人Git存儲庫?OpenShift上的私人Git

或者OpenShift不提供對Git存儲庫的外部訪問?

+0

爲什麼我收到downvote? – Berneck

+0

「OpenShift中的私人github存儲庫」?你的意思是「OpenShift中的一個私人* git *存儲庫」 – saeedgnu

+1

@ilius true,現在編輯。 –

回答

10

您需要執行以下步驟:

git clone <your-external-repo-url> 
change to newly cloned git directory 
git remote add openshift -f <openshift-git-repo-url> 
git merge openshift/master -s recursive -X ours 

git push openshift master 

這裏的reference

+1

不用說''your-external-repo-url>'從'rhc show-app MYAPP | grep'Git URL:'' – saeedgnu

0

Akram Ben Aissi published an interesting post in the Openshift blog有關如何在Openshift V3部署Gitlab。

我看到它非常有用,如果有人正在尋找最近的更新或這個問題,也許可能會有趣。

很容易,創造postgress,Redis的和gitce並在最後3級新的應用程序添加持久卷:

PostgreSQL的:

oc new-app --template=postgresql-persistent \ 
-p POSTGRESQL_USER=admin,POSTGRESQL_PASSWORD=redhat,POSTGRESQL_DATABASE=gitlab 

Redis的

oc new-app sameersbn/redis 
oc volume dc/redis --add --overwrite -t persistentVolumeClaim \ 
        --claim-name=redis-data --name=redis-volume-1 \ 
        --mount-path=/var/lib/redis 

獲取的Redis和postgresql服務IPs被傳遞給git-ce容器(在本例中爲172.30.25.83,172.30.198.140)

oc get svc postgresql redis 

的Git-CE容器

oc new-app sameersbn/gitlab --name=gitlab-ce 
         -e 'GITLAB_HOST=http://gitlab.apps.mycompany.com' \ 
         -e 'DB_TYPE=postgres' -e 'DB_HOST=172.30.25.83' \ 
         -e 'DB_PORT=5432' -e 'DB_NAME=gitlab' -e 'DB_USER=admin' \ 
         -e 'DB_PASS=admin' -e 'REDIS_HOST=172.30.198.140 -e 'REDIS_PORT=6379' \ 
         -e 'GITLAB_SECRETS_DB_KEY_BASE=1234567890' -e 'SMTP_ENABLED=true' \ 
         -e 'SMTP_HOST=smtp.mycompany.com' -e 'SMTP_PORT=25' \ 
         -e '[email protected]' 

配置持久卷:

oc volumes dc/gitlab-ce --add --claim-name=gitlab-log --mount-path=/var/log/gitlab \ 
       -t persistentVolumeClaim --overwrite 
oc volumes dc/gitlab-ce --add --claim-name=gitlab-data --mount-path=/home/git/data \ 
       -t persistentVolumeClaim --overwrite 
+0

由於鏈接可能會隨時間而改變,所以在您的回答中包含相關信息並提供上下文鏈接會更好。你能編輯你的答案嗎?謝謝,歡迎來到StackOverflow。 –

0

你可以簡單地做:

oc new-app http:<git url> 

如果您需要提供憑據Git倉庫,然後這將需要更多的努力。您需要將與構建配置關聯的訪問權關聯起來,詳細信息請參閱here