Removed keys from broker code, retired keys in commit history, and moved key to secret file.
This commit is contained in:
parent
cd969ada4f
commit
3496955095
1
.gitignore
vendored
1
.gitignore
vendored
@ -1,2 +1,3 @@
|
|||||||
errors
|
errors
|
||||||
.eslintrc.json
|
.eslintrc.json
|
||||||
|
gitlab_read.pat
|
||||||
|
49
broker.sh
49
broker.sh
@ -231,10 +231,12 @@ get_remote_ssh_port () {
|
|||||||
|
|
||||||
get_remote_user () {
|
get_remote_user () {
|
||||||
local user=$(get_data $* remote user)
|
local user=$(get_data $* remote user)
|
||||||
if [[ -z $user ]]; then
|
if [[ -z $user ]] || [[ $user == "null" ]]; then
|
||||||
user=$dealer
|
echo $dealer
|
||||||
|
else
|
||||||
|
echo $user
|
||||||
fi
|
fi
|
||||||
echo $user
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
######################################################################
|
######################################################################
|
||||||
@ -556,17 +558,9 @@ cluster_info () {
|
|||||||
# new gitlab
|
# new gitlab
|
||||||
gitlab_http_port="45080"
|
gitlab_http_port="45080"
|
||||||
gitlab_ssh_port="45022"
|
gitlab_ssh_port="45022"
|
||||||
gitlab_read_token="uYoP-1HRpvMx3MWoRDHF"
|
|
||||||
|
|
||||||
# old gitlab (overwriting new)
|
|
||||||
gitlab_http_port="45000"
|
|
||||||
gitlab_ssh_port="45002"
|
|
||||||
gitlab_read_token="JF1ymVmbfe1cp4z8eKKb"
|
|
||||||
#master token overwrite
|
|
||||||
#gitlab_read_token="G3Z9G5HeiTp74zFfeUnN"
|
|
||||||
gitlab_token="$gitlab_read_token"
|
|
||||||
|
|
||||||
gitlab_owner="$dealer"
|
gitlab_owner="$dealer"
|
||||||
|
gitlab_token=$(gitlab_get_token)
|
||||||
gitlab_url="gitlab.adamo.network"
|
gitlab_url="gitlab.adamo.network"
|
||||||
gitlab_http_url="http://${gitlab_url}:${gitlab_http_port}"
|
gitlab_http_url="http://${gitlab_url}:${gitlab_http_port}"
|
||||||
gitlab_ssh_url="ssh://git@${gitlab_url}:${gitlab_ssh_port}"
|
gitlab_ssh_url="ssh://git@${gitlab_url}:${gitlab_ssh_port}"
|
||||||
@ -591,6 +585,28 @@ git_update_self () {
|
|||||||
cd ${owd}
|
cd ${owd}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
git_pull_all () {
|
||||||
|
owd=`pwd`
|
||||||
|
for gitdir in `git_list_dirs_under $1`; do
|
||||||
|
local dir=$(dirname $gitdir)
|
||||||
|
if [[ $TESTING_MODE ]]; then
|
||||||
|
pr_vars dir owd
|
||||||
|
else
|
||||||
|
cd $dir
|
||||||
|
git pull
|
||||||
|
cd $owd
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
}
|
||||||
|
|
||||||
|
git_list_dirs_under () {
|
||||||
|
find $1 -type d -a -name '.git'
|
||||||
|
}
|
||||||
|
|
||||||
|
gitlab_get_token () {
|
||||||
|
cat ${program_root}/gitlab_read.pat
|
||||||
|
}
|
||||||
|
|
||||||
# $1: directory
|
# $1: directory
|
||||||
# $2: gitlab namespace path (this better exist!)
|
# $2: gitlab namespace path (this better exist!)
|
||||||
gitlab_create_project_from_repo () {
|
gitlab_create_project_from_repo () {
|
||||||
@ -609,14 +625,19 @@ gitlab_create_project_from_repo () {
|
|||||||
else
|
else
|
||||||
local uri="${gitlab_ssh_url}"
|
local uri="${gitlab_ssh_url}"
|
||||||
fi
|
fi
|
||||||
echo git push --set-upstream ${uri}/${name}.git $branch
|
pr_vars uri name branch
|
||||||
|
if [[ $TESTING_MODE ]]; then
|
||||||
|
echo git push --set-upstream ${uri}.git $branch
|
||||||
|
else
|
||||||
|
git push --set-upstream ${uri}.git $branch
|
||||||
|
fi
|
||||||
cd $owd
|
cd $owd
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
|
|
||||||
gitlab_create_projects_for_all_in_dir () {
|
gitlab_create_projects_for_all_in_dir () {
|
||||||
local root=$1
|
local root=$1
|
||||||
for gitdir in `find $root -type d -a -name '.git'`; do
|
for gitdir in `git_list_dirs_under $root`; do
|
||||||
local dir=$(dirname $gitdir)
|
local dir=$(dirname $gitdir)
|
||||||
local path=$(echo $dir|sed "s|${root}/||")
|
local path=$(echo $dir|sed "s|${root}/||")
|
||||||
gitlab_create_project_from_repo $dir $path
|
gitlab_create_project_from_repo $dir $path
|
||||||
|
Loading…
Reference in New Issue
Block a user