Skip to content

Commit

Permalink
feat(test): fix test install
Browse files Browse the repository at this point in the history
fix test install

Signed-off-by: ysicing <[email protected]>
  • Loading branch information
ysicing committed Aug 30, 2023
1 parent a830104 commit 720187f
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 7 deletions.
13 changes: 11 additions & 2 deletions common/func.go
Original file line number Diff line number Diff line change
Expand Up @@ -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]
}
Expand Down
14 changes: 10 additions & 4 deletions hack/scripts/devops/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 --
Expand Down
2 changes: 1 addition & 1 deletion pkg/quickon/quickon.go
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down

0 comments on commit 720187f

Please sign in to comment.