Skip to content

Commit

Permalink
refactor: refactor installation process and update usage examples in …
Browse files Browse the repository at this point in the history
…main files

- Update the `SCRIPT_DATA` variable with the current timestamp
- Change the name from "Quickon" to "DevOPS" in the usage example
- Update the comment about the install type to mention Zentao DevOPS
- Remove the comment about the install version when installing Quickon,
  and replace it with a comment about installing Zentao DevOPS with a custom version
- Remove the comment about skipping the devops init step
- Add the `--debug` flag to the `INSTALL_COMMAND` if the `DEBUG` variable is set
- Update the `GetFlags` function in `devops.go` to include a custom version usage message
- Remove the comment about skipping devops init in `quickon.go`, and update the usage message about it

Signed-off-by: ysicing <[email protected]>
  • Loading branch information
ysicing committed May 29, 2024
1 parent 8b832a8 commit af154e4
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 10 deletions.
14 changes: 6 additions & 8 deletions hack/scripts/devops/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,28 +8,26 @@
# Source code is available at https://github.com/easysoft/quickon_cli

# SCRIPT_COMMIT_SHA="a77fcbaf862d7b2d1eb8b08c5920adde14edc4ca"
# SCRIPT_DATA="Fri Sep 8 09:46:36 AM CST 2023"
# SCRIPT_DATA="Wed May 29 17:29:14 CST 2024"

# Usage:
# curl ... | ENV_VAR=... sh -
# or
# ENV_VAR=... ./install.sh
#
# Example:
# Installing Quickon with ZenTao:
# Installing DevOPS with ZenTao:
# curl ... | DEVOPS_TYPE="" sh -
# - DEVOPS_TYPE
# Install Type when install Quickon.
# Install Type when install Zentao DevOPS.
# Defaults to '', support 'max', 'biz', 'ipd'
# - DEVOPS_VERSION
# Install Version when install Quickon.
# Install Version when install Zentao DevOPS.
# Defaults to ''
# - INSTALL_DOMAIN
# If not set default use gen default domain
# - DEBUG
# If set, print debug information
# - SKIP_DEVOPS_INIT
# If set, skip devops init

set -e
set -o noglob
Expand Down Expand Up @@ -204,8 +202,8 @@ install_zentao_devops() {
if [ -n "${DEVOPS_VERSION}" ]; then
INSTALL_COMMAND="${INSTALL_COMMAND} --version ${DEVOPS_VERSION}"
fi
if [ -n "${SKIP_DEVOPS_INIT}" ]; then
INSTALL_COMMAND="${INSTALL_COMMAND} --skip-devops-init"
if [ -n "${DEBUG}" ]; then
INSTALL_COMMAND="${INSTALL_COMMAND} --debug"
fi
eval "$INSTALL_COMMAND"
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/providers/devops/devops.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ func (q *Devops) GetFlags() []types.Flag {
fs := q.MetaData.GetCustomFlags()
fs = append(fs, types.Flag{
Name: "version",
Usage: fmt.Sprintf("zentao devops version %s", common.DefaultZentaoDevOPSOSSVersion),
Usage: fmt.Sprintf("zentao version %s,custom version use custom-%s", common.DefaultZentaoDevOPSOSSVersion, common.DefaultZentaoDevOPSOSSVersion),
P: &q.MetaData.Version,
V: q.MetaData.Version,
}, types.Flag{
Expand Down
2 changes: 1 addition & 1 deletion pkg/quickon/quickon.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ func (m *Meta) GetCustomFlags() []types.Flag {
},
{
Name: "skip-devops-init",
Usage: "allow user skip devops init, default: true",
Usage: "allow user skip devops init",
P: &m.SkipDevOPSInit,
V: true,
},
Expand Down

0 comments on commit af154e4

Please sign in to comment.