Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
15,751 changed files
with
527,968 additions
and
98,365 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
WORKSPACE=`pwd` | ||
rm -rf ${WORKSPACE}/ci | ||
mkdir -p ${WORKSPACE}/ci/gateway | ||
cp -r ${WORKSPACE}/src/gateway/* ${WORKSPACE}/ci/gateway | ||
cd ${WORKSPACE}/scripts/ | ||
sh ./render_local -m ci ../support-files/templates/* | ||
cd ${WORKSPACE}/ci/gateway | ||
cp ./lua/auth/auth_user_oa.lua ./lua/auth/auth_user.lua | ||
cp ./lua/auth/oauth_util_oa.lua ./lua/auth/oauth_util.lua |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
|
||
# consul 相关配置 init.lua 和 common.yml | ||
BKCI_CONSUL_PORT=8500 | ||
BKCI_CONSUL_TAG=dev | ||
BKCI_CONSUL_DOMAIN=bkdevops | ||
BKCI_CONSUL_DNS_PORT=8600 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
#!/bin/bash | ||
|
||
# 渲染蓝鲸的__VAR_NUM__ 类似的模板,通过环境变量自动替换它 | ||
set -o nounset # Treat unset variables as an error | ||
|
||
set -a | ||
BK_ENV_FILE=./ci_env.properties | ||
[ -r $BK_ENV_FILE ] && source $BK_ENV_FILE | ||
set +a | ||
|
||
trap 'rm -f $sed_script' EXIT TERM | ||
sed_script=$(mktemp /tmp/XXXXXX.sed) | ||
|
||
usage () { | ||
echo "Usage: $0 [-c] [-n] [-E k=v, -E k=v] tpl_path ..." | ||
} | ||
|
||
usage_and_exit () { | ||
usage | ||
exit $1 | ||
} | ||
|
||
target_file_path () { | ||
local module=$MODULE | ||
local tpl_file=${1##*/} | ||
local _target_file | ||
_target_file=../$module/${tpl_file//#//} | ||
|
||
echo ${_target_file%.tpl} | ||
} | ||
|
||
[[ $# -eq 0 ]] && usage_and_exit 1 | ||
declare -i DRY_RUN=0 CHECK=0 | ||
declare MODULE="" | ||
declare -a EXTRA_ENV=() | ||
|
||
while getopts ncm:E: arg; do | ||
case $arg in | ||
n) DRY_RUN=1 ;; | ||
c) CHECK=1 ;; | ||
m) MODULE="$OPTARG" ;; | ||
E) EXTRA_ENV+=("$OPTARG") ;; | ||
*) usage_and_exit 0 ;; | ||
esac | ||
done | ||
shift $((OPTIND - 1)) | ||
|
||
# 校验必须变量 | ||
if [[ -z $INSTALL_PATH ]]; then | ||
echo "INSTALL_PATH 变量不能为空。" | ||
exit 1 | ||
fi | ||
place_holders=$(cat $* 2>/dev/null | grep -wEo '__[0-9A-Z_]+__' | sort -u) | ||
|
||
set +u | ||
for p in $place_holders | ||
do | ||
k=$(echo $p | sed 's/^__//; s/__$//;') | ||
v=${!k} | ||
[[ $CHECK -eq 1 ]] && [[ -z "$v" ]] && echo "EMPTY PLACE_HOLDER: $p" | ||
echo "s|$p|$v|g" >> $sed_script | ||
done | ||
set -u | ||
unset p k v | ||
|
||
# 仅检查变量 | ||
[[ $CHECK -eq 1 ]] && exit 0 | ||
|
||
for file in "$@"; do | ||
# 是否真正替换变量到目标路径 | ||
if [[ $DRY_RUN -eq 0 ]]; then | ||
target_file=$(target_file_path $file) | ||
echo "render $file -> $target_file" | ||
mkdir -p ${target_file%/*} | ||
sed -f $sed_script $file > $target_file | ||
else | ||
sed -f $sed_script $file | ||
fi | ||
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
#!/bin/bash | ||
|
||
# 渲染蓝鲸的__VAR_NUM__ 类似的模板,通过环境变量自动替换它 | ||
set -o nounset # Treat unset variables as an error | ||
|
||
set -a | ||
BK_ENV_FILE=./ci_env_local.properties | ||
[ -r $BK_ENV_FILE ] && source $BK_ENV_FILE | ||
set +a | ||
|
||
trap 'rm -f $sed_script' EXIT TERM | ||
sed_script=$(mktemp /tmp/XXXXXX.sed) | ||
|
||
usage () { | ||
echo "Usage: $0 [-c] [-n] [-E k=v, -E k=v] tpl_path ..." | ||
} | ||
|
||
usage_and_exit () { | ||
usage | ||
exit $1 | ||
} | ||
|
||
target_file_path () { | ||
local module=$MODULE | ||
local tpl_file=${1##*/} | ||
local _target_file | ||
_target_file=../$module/${tpl_file//#//} | ||
|
||
echo ${_target_file%.tpl} | ||
} | ||
|
||
[[ $# -eq 0 ]] && usage_and_exit 1 | ||
declare -i DRY_RUN=0 CHECK=0 | ||
declare MODULE="" | ||
declare -a EXTRA_ENV=() | ||
|
||
while getopts ncm:E: arg; do | ||
case $arg in | ||
n) DRY_RUN=1 ;; | ||
c) CHECK=1 ;; | ||
m) MODULE="$OPTARG" ;; | ||
E) EXTRA_ENV+=("$OPTARG") ;; | ||
*) usage_and_exit 0 ;; | ||
esac | ||
done | ||
shift $((OPTIND - 1)) | ||
|
||
# 校验必须变量 | ||
if [[ -z $INSTALL_PATH ]]; then | ||
echo "INSTALL_PATH 变量不能为空。" | ||
exit 1 | ||
fi | ||
place_holders=$(cat $* 2>/dev/null | grep -wEo '__[0-9A-Z_]+__' | sort -u) | ||
|
||
set +u | ||
for p in $place_holders | ||
do | ||
k=$(echo $p | sed 's/^__//; s/__$//;') | ||
v=${!k} | ||
[[ $CHECK -eq 1 ]] && [[ -z "$v" ]] && echo "EMPTY PLACE_HOLDER: $p" | ||
echo "s|$p|$v|g" >> $sed_script | ||
done | ||
set -u | ||
unset p k v | ||
|
||
# 仅检查变量 | ||
[[ $CHECK -eq 1 ]] && exit 0 | ||
|
||
for file in "$@"; do | ||
# 是否真正替换变量到目标路径 | ||
if [[ $DRY_RUN -eq 0 ]]; then | ||
target_file=$(target_file_path $file) | ||
echo "render $file -> $target_file" | ||
mkdir -p ${target_file%/*} | ||
sed -f $sed_script $file > $target_file | ||
else | ||
sed -f $sed_script $file | ||
fi | ||
done |
Oops, something went wrong.