diff --git a/common/func.go b/common/func.go index 85b09239..7a458c89 100644 --- a/common/func.go +++ b/common/func.go @@ -82,10 +82,19 @@ func GetChannel(p string) string { } // GetVersion 获取版本地址 -func GetVersion(version string) string { +func GetVersion(p, version string) string { v := strings.Split(version, "-") if len(v) != 2 { - return version + switch p { + case string(ZenTaoIPDType): + return DefaultZentaoDevOPSIPDVersion + case string(ZenTaoBizType): + return DefaultZentaoDevOPSBizVersion + case string(ZenTaoMaxType): + return DefaultZentaoDevOPSMaxVersion + default: + return DefaultZentaoDevOPSOSSVersion + } } return v[1] } diff --git a/hack/scripts/devops/install.sh b/hack/scripts/devops/install.sh index 82860dcd..843d163a 100755 --- a/hack/scripts/devops/install.sh +++ b/hack/scripts/devops/install.sh @@ -181,11 +181,17 @@ download_and_verify() { # --- install zentao devops install_zentao_devops() { - if [ -z "${INSTALL_DOMAIN}" ]; then - ${BIN_DIR}/z init --provider devops - else - ${BIN_DIR}/z init --provider devops --domain ${INSTALL_DOMAIN} + INSTALL_COMMAND="${BIN_DIR}/z init --provider devops" + if [ -n "${INSTALL_DOMAIN}" ]; then + INSTALL_COMMAND="${BIN_DIR}/z init --provider devops --domain ${INSTALL_DOMAIN}" fi + if [ -n "${DEVOPS_TYPE}" ]; then + INSTALL_COMMAND="${INSTALL_COMMAND} --type ${DEVOPS_TYPE}" + fi + if [ -n "${DEVOPS_VERSION}" ]; then + INSTALL_COMMAND="${INSTALL_COMMAND} --version ${DEVOPS_VERSION}" + fi + eval "$INSTALL_COMMAND" } # --- run the install process -- diff --git a/pkg/quickon/quickon.go b/pkg/quickon/quickon.go index b618749f..9cc5f92f 100644 --- a/pkg/quickon/quickon.go +++ b/pkg/quickon/quickon.go @@ -335,7 +335,7 @@ func (m *Meta) Init() error { } helmargs = append(helmargs, "--set", fmt.Sprintf("ingress.host=%s", hostdomain)) - installVersion := common.GetVersion(m.Version) + installVersion := common.GetVersion(m.Type, m.Version) if m.DevopsMode { // 指定类型 helmargs = append(helmargs, "--set", fmt.Sprintf("deploy.product=%s", m.Type))