Commit 28b16c4b authored by Oleg Dzhimiev's avatar Oleg Dzhimiev

removed hardcoded git host

parent c070acae
...@@ -14,6 +14,7 @@ import subprocess ...@@ -14,6 +14,7 @@ import subprocess
import os import os
import sys import sys
import shutil import shutil
import re
import json import json
from collections import OrderedDict from collections import OrderedDict
...@@ -117,20 +118,30 @@ def read_local_conf_dev(conf_file,pattern): ...@@ -117,20 +118,30 @@ def read_local_conf_dev(conf_file,pattern):
return ret return ret
def update_branch(names_from_conf,name_from_list,pars,git_proto): def update_branch(names_from_conf,name_from_list,pars,git_proto):
if (git_proto=="1"):
tmp = "https://git.elphel.com/Elphel" # GIT host is defined in projects.json,
if pars[0].find(tmp)!=-1: # https or git is defined in local.conf
pars[0] = "git@git.elphel.com:Elphel"+pars[0][len(tmp):] # get host
else: s0 = re.search("^(https:\/\/|git@)(.+)(\/|:)Elphel.*",pars[0])
tmp = "git@git.elphel.com:Elphel" if s0:
if pars[0].find(tmp)!=-1: host = s0.group(2)
pars[0] = "https://git.elphel.com/Elphel"+pars[0][len(tmp):] print("git host: "+host)
if (git_proto=="1"):
for p in names_from_conf: tmp = "https://"+host+"/Elphel"
if name_from_list in p: if pars[0].find(tmp)!=-1:
pars[1] = p[1] pars[0] = "git@"+host+":Elphel"+pars[0][len(tmp):]
else:
tmp = "git@"+host+":Elphel"
if pars[0].find(tmp)!=-1:
pars[0] = "https://"+host+"/Elphel"+pars[0][len(tmp):]
for p in names_from_conf:
if name_from_list in p:
pars[1] = p[1]
return pars return pars
#main #main
#self pull? #self pull?
...@@ -266,6 +277,11 @@ MIRRORS =+ "http://.*/.* http://mirror.elphel.com/elphel393_mirror/ \\n " ...@@ -266,6 +277,11 @@ MIRRORS =+ "http://.*/.* http://mirror.elphel.com/elphel393_mirror/ \\n "
# 0 (or commented) - for https:// - access using a password # 0 (or commented) - for https:// - access using a password
# ELPHEL393_DEV = "1" # ELPHEL393_DEV = "1"
# To change git host edit: projects.json (a copy of projects-default.json)
# New git host must match "^(https:\/\/|git@)(.+)(\/|:)Elphel.*", e.g.:
# "https://something.com/Elphel/someproject" or
# "git@something.com:Elphel/someproject"
REMOTE_USER ?= "root" REMOTE_USER ?= "root"
IDENTITY_FILE ?= "~/.ssh/id_rsa" IDENTITY_FILE ?= "~/.ssh/id_rsa"
COPY_TO_NAND = "0" COPY_TO_NAND = "0"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment