dev-tools
3412 lines
| 77.8 KiB
| text/plain
|
TextLexer
r179 | #!/usr/bin/env bash | |||
r249 | # This script was generated by bashly 1.0.8 (https://bashly.dannyb.co) | |||
r179 | # Modifying it manually is not recommended | |||
# :wrapper.bash3_bouncer | ||||
if [[ "${BASH_VERSINFO:-0}" -lt 4 ]]; then | ||||
printf "bash version 4 or higher is required\n" >&2 | ||||
exit 1 | ||||
fi | ||||
# :command.master_script | ||||
# :command.version_command | ||||
version_command() { | ||||
echo "$version" | ||||
} | ||||
# :command.usage | ||||
dev_tools_usage() { | ||||
if [[ -n $long_usage ]]; then | ||||
printf "dev-tools - CLI for various dev-tools operation on the stack\n" | ||||
echo | ||||
else | ||||
printf "dev-tools - CLI for various dev-tools operation on the stack\n" | ||||
echo | ||||
fi | ||||
printf "%s\n" "Usage:" | ||||
printf " dev-tools COMMAND\n" | ||||
printf " dev-tools [COMMAND] --help | -h\n" | ||||
printf " dev-tools --version | -v\n" | ||||
echo | ||||
# :command.usage_commands | ||||
r375 | printf "%s\n" "dev-env Commands:" | |||
printf " %s run bash console for vcsserver\n" "vcs " | ||||
printf " %s run bash console for rhodecode-ee\n" "ee " | ||||
printf " %s run bash console for rhodecode-ce\n" "ce " | ||||
printf " %s run bash console for rhodecode-celery\n" "celery " | ||||
r400 | printf " %s run celery instance on top of mounted source code, e.g ./dev-tools celeryd&\n" "celeryd " | |||
r403 | printf " %s run bash console for rhodecode-ssh\n" "ssh " | |||
printf " %s run sshd instance for rhodecode-ssh\n" "sshd " | ||||
r408 | printf " %s run bash console for rhodecode-ssh\n" "svn " | |||
printf " %s run sshd instance for rhodecode-ssh\n" "svnd " | ||||
r381 | printf " %s run bash console for rhodecode-tools-ce\n" "tools " | |||
r375 | printf " %s create dev env required to run vcsserver and rhodecode\n" "dev-env " | |||
echo | ||||
printf "%s\n" "Cleanup Commands:" | ||||
printf " %s clears docker images\n" "prune " | ||||
printf " %s clears docker images and system cache, full cleanup. Be cautious !\n" "prune-all " | ||||
echo | ||||
printf "%s\n" "CLI generation Commands:" | ||||
printf " %s pull latest image of bashly\n" "cli-generate-pull " | ||||
printf " %s print out help about bashly\n" "cli-generate-help " | ||||
printf " %s set the version for rcstack\n" "stack-cli-version " | ||||
printf " %s run a ./rcstack generation script\n" "cli-generate-rc " | ||||
printf " %s run a ./dev-tools generation script\n" "cli-generate-dev " | ||||
echo | ||||
printf "%s\n" "Build Commands:" | ||||
printf " %s Fetch Artifacts to run installer based build\n" "get-build-artifacts" | ||||
printf " %s Build RhodeCode image from installer, ./dev-tools get-build-artifacts initially\n" "build-installer " | ||||
printf " %s Fetch RhodeCode sources, store in .source dir to run a source-based builds\n" "get-build-source " | ||||
printf " %s Build RhodeCode image from source, requires ./dev-tools get-build-source initially\n" "build-source " | ||||
r179 | echo | |||
# :command.long_usage | ||||
if [[ -n $long_usage ]]; then | ||||
printf "%s\n" "Options:" | ||||
# :command.usage_fixed_flags | ||||
printf " %s\n" "--help, -h" | ||||
printf " Show this help\n" | ||||
echo | ||||
printf " %s\n" "--version, -v" | ||||
printf " Show version number\n" | ||||
echo | ||||
# :command.footer | ||||
r400 | printf "RhodeCode Inc 2024\n\n" | |||
r179 | echo | |||
fi | ||||
} | ||||
# :command.usage | ||||
dev_tools_vcs_usage() { | ||||
if [[ -n $long_usage ]]; then | ||||
printf "dev-tools vcs - run bash console for vcsserver\n" | ||||
echo | ||||
else | ||||
printf "dev-tools vcs - run bash console for vcsserver\n" | ||||
echo | ||||
fi | ||||
printf "Alias: v\n" | ||||
echo | ||||
printf "%s\n" "Usage:" | ||||
printf " dev-tools vcs\n" | ||||
printf " dev-tools vcs --help | -h\n" | ||||
echo | ||||
# :command.long_usage | ||||
if [[ -n $long_usage ]]; then | ||||
printf "%s\n" "Options:" | ||||
# :command.usage_fixed_flags | ||||
printf " %s\n" "--help, -h" | ||||
printf " Show this help\n" | ||||
echo | ||||
fi | ||||
} | ||||
# :command.usage | ||||
dev_tools_ee_usage() { | ||||
if [[ -n $long_usage ]]; then | ||||
printf "dev-tools ee - run bash console for rhodecode-ee\n" | ||||
echo | ||||
else | ||||
printf "dev-tools ee - run bash console for rhodecode-ee\n" | ||||
echo | ||||
fi | ||||
printf "Alias: e\n" | ||||
echo | ||||
printf "%s\n" "Usage:" | ||||
printf " dev-tools ee\n" | ||||
printf " dev-tools ee --help | -h\n" | ||||
echo | ||||
# :command.long_usage | ||||
if [[ -n $long_usage ]]; then | ||||
printf "%s\n" "Options:" | ||||
# :command.usage_fixed_flags | ||||
printf " %s\n" "--help, -h" | ||||
printf " Show this help\n" | ||||
echo | ||||
fi | ||||
} | ||||
# :command.usage | ||||
dev_tools_ce_usage() { | ||||
if [[ -n $long_usage ]]; then | ||||
printf "dev-tools ce - run bash console for rhodecode-ce\n" | ||||
echo | ||||
else | ||||
printf "dev-tools ce - run bash console for rhodecode-ce\n" | ||||
echo | ||||
fi | ||||
printf "Alias: c\n" | ||||
echo | ||||
printf "%s\n" "Usage:" | ||||
printf " dev-tools ce\n" | ||||
printf " dev-tools ce --help | -h\n" | ||||
echo | ||||
# :command.long_usage | ||||
if [[ -n $long_usage ]]; then | ||||
printf "%s\n" "Options:" | ||||
# :command.usage_fixed_flags | ||||
printf " %s\n" "--help, -h" | ||||
printf " Show this help\n" | ||||
echo | ||||
fi | ||||
} | ||||
# :command.usage | ||||
r408 | dev_tools_celery_usage() { | |||
r342 | if [[ -n $long_usage ]]; then | |||
r408 | printf "dev-tools celery - run bash console for rhodecode-celery\n" | |||
r342 | echo | |||
else | ||||
r408 | printf "dev-tools celery - run bash console for rhodecode-celery\n" | |||
r342 | echo | |||
fi | ||||
r408 | printf "%s\n" "Usage:" | |||
printf " dev-tools celery [OPTIONS]\n" | ||||
printf " dev-tools celery --help | -h\n" | ||||
r342 | echo | |||
r408 | # :command.long_usage | |||
if [[ -n $long_usage ]]; then | ||||
printf "%s\n" "Options:" | ||||
# :command.usage_flags | ||||
# :flag.usage | ||||
printf " %s\n" "--workdir WORKDIR" | ||||
printf " workdir to run the pip install -e on top of can be ce or ee only\n" | ||||
printf " Default: /home/rhodecode/rhodecode-enterprise-ce\n" | ||||
echo | ||||
# :flag.usage | ||||
printf " %s\n" "--cmd CMD" | ||||
printf " cmd script to run, this is on host machine, relative to $WORKSPACE_HOME\n" | ||||
printf " Default: .dev-env/cmd-celery.sh\n" | ||||
echo | ||||
# :command.usage_fixed_flags | ||||
printf " %s\n" "--help, -h" | ||||
printf " Show this help\n" | ||||
echo | ||||
fi | ||||
} | ||||
# :command.usage | ||||
dev_tools_celeryd_usage() { | ||||
if [[ -n $long_usage ]]; then | ||||
printf "dev-tools celeryd - run celery instance on top of mounted source code, e.g ./dev-tools celeryd&\n" | ||||
echo | ||||
else | ||||
printf "dev-tools celeryd - run celery instance on top of mounted source code, e.g ./dev-tools celeryd&\n" | ||||
echo | ||||
fi | ||||
r342 | printf "%s\n" "Usage:" | |||
r408 | printf " dev-tools celeryd [OPTIONS]\n" | |||
printf " dev-tools celeryd --help | -h\n" | ||||
r342 | echo | |||
# :command.long_usage | ||||
if [[ -n $long_usage ]]; then | ||||
printf "%s\n" "Options:" | ||||
r408 | # :command.usage_flags | |||
# :flag.usage | ||||
printf " %s\n" "--workdir WORKDIR" | ||||
printf " workdir to run the pip install -e on top of can be ce or ee only\n" | ||||
printf " Default: /home/rhodecode/rhodecode-enterprise-ce\n" | ||||
echo | ||||
# :flag.usage | ||||
printf " %s\n" "--cmd CMD" | ||||
printf " cmd script to run, this is on host machine, relative to $WORKSPACE_HOME\n" | ||||
printf " Default: .dev-env/cmd-celeryd.sh\n" | ||||
echo | ||||
r342 | # :command.usage_fixed_flags | |||
printf " %s\n" "--help, -h" | ||||
printf " Show this help\n" | ||||
echo | ||||
fi | ||||
} | ||||
# :command.usage | ||||
r408 | dev_tools_ssh_usage() { | |||
r211 | if [[ -n $long_usage ]]; then | |||
r408 | printf "dev-tools ssh - run bash console for rhodecode-ssh\n" | |||
r211 | echo | |||
else | ||||
r408 | printf "dev-tools ssh - run bash console for rhodecode-ssh\n" | |||
r211 | echo | |||
fi | ||||
r381 | printf "%s\n" "Usage:" | |||
r408 | printf " dev-tools ssh [OPTIONS]\n" | |||
printf " dev-tools ssh --help | -h\n" | ||||
r211 | echo | |||
r381 | # :command.long_usage | |||
if [[ -n $long_usage ]]; then | ||||
printf "%s\n" "Options:" | ||||
r400 | # :command.usage_flags | |||
# :flag.usage | ||||
printf " %s\n" "--workdir WORKDIR" | ||||
printf " workdir to run the pip install -e on top of can be ce or ee only\n" | ||||
printf " Default: /home/rhodecode/rhodecode-enterprise-ce\n" | ||||
echo | ||||
# :flag.usage | ||||
printf " %s\n" "--cmd CMD" | ||||
printf " cmd script to run, this is on host machine, relative to $WORKSPACE_HOME\n" | ||||
r408 | printf " Default: .dev-env/cmd-ssh.sh\n" | |||
r400 | echo | |||
# :command.usage_fixed_flags | ||||
printf " %s\n" "--help, -h" | ||||
printf " Show this help\n" | ||||
echo | ||||
fi | ||||
} | ||||
# :command.usage | ||||
r408 | dev_tools_sshd_usage() { | |||
r400 | if [[ -n $long_usage ]]; then | |||
r408 | printf "dev-tools sshd - run sshd instance for rhodecode-ssh\n" | |||
r400 | echo | |||
else | ||||
r408 | printf "dev-tools sshd - run sshd instance for rhodecode-ssh\n" | |||
r400 | echo | |||
fi | ||||
printf "%s\n" "Usage:" | ||||
r408 | printf " dev-tools sshd [OPTIONS]\n" | |||
printf " dev-tools sshd --help | -h\n" | ||||
r400 | echo | |||
# :command.long_usage | ||||
if [[ -n $long_usage ]]; then | ||||
printf "%s\n" "Options:" | ||||
# :command.usage_flags | ||||
# :flag.usage | ||||
printf " %s\n" "--workdir WORKDIR" | ||||
printf " workdir to run the pip install -e on top of can be ce or ee only\n" | ||||
printf " Default: /home/rhodecode/rhodecode-enterprise-ce\n" | ||||
echo | ||||
# :flag.usage | ||||
printf " %s\n" "--cmd CMD" | ||||
printf " cmd script to run, this is on host machine, relative to $WORKSPACE_HOME\n" | ||||
r408 | printf " Default: .dev-env/cmd-sshd.sh\n" | |||
r403 | echo | |||
# :command.usage_fixed_flags | ||||
printf " %s\n" "--help, -h" | ||||
printf " Show this help\n" | ||||
echo | ||||
fi | ||||
} | ||||
# :command.usage | ||||
r408 | dev_tools_svn_usage() { | |||
r403 | if [[ -n $long_usage ]]; then | |||
r408 | printf "dev-tools svn - run bash console for rhodecode-ssh\n" | |||
r403 | echo | |||
else | ||||
r408 | printf "dev-tools svn - run bash console for rhodecode-ssh\n" | |||
r403 | echo | |||
fi | ||||
printf "%s\n" "Usage:" | ||||
r408 | printf " dev-tools svn [OPTIONS]\n" | |||
printf " dev-tools svn --help | -h\n" | ||||
r403 | echo | |||
# :command.long_usage | ||||
if [[ -n $long_usage ]]; then | ||||
printf "%s\n" "Options:" | ||||
# :command.usage_flags | ||||
# :flag.usage | ||||
printf " %s\n" "--workdir WORKDIR" | ||||
printf " workdir to run the pip install -e on top of can be ce or ee only\n" | ||||
printf " Default: /home/rhodecode/rhodecode-enterprise-ce\n" | ||||
echo | ||||
# :flag.usage | ||||
printf " %s\n" "--cmd CMD" | ||||
printf " cmd script to run, this is on host machine, relative to $WORKSPACE_HOME\n" | ||||
r408 | printf " Default: .dev-env/cmd-svn.sh\n" | |||
r400 | echo | |||
r381 | # :command.usage_fixed_flags | |||
printf " %s\n" "--help, -h" | ||||
printf " Show this help\n" | ||||
echo | ||||
fi | ||||
} | ||||
# :command.usage | ||||
r408 | dev_tools_svnd_usage() { | |||
r381 | if [[ -n $long_usage ]]; then | |||
r408 | printf "dev-tools svnd - run sshd instance for rhodecode-ssh\n" | |||
r381 | echo | |||
else | ||||
r408 | printf "dev-tools svnd - run sshd instance for rhodecode-ssh\n" | |||
r381 | echo | |||
fi | ||||
r211 | printf "%s\n" "Usage:" | |||
r408 | printf " dev-tools svnd [OPTIONS]\n" | |||
printf " dev-tools svnd --help | -h\n" | ||||
r211 | echo | |||
# :command.long_usage | ||||
if [[ -n $long_usage ]]; then | ||||
printf "%s\n" "Options:" | ||||
r403 | # :command.usage_flags | |||
# :flag.usage | ||||
printf " %s\n" "--workdir WORKDIR" | ||||
printf " workdir to run the pip install -e on top of can be ce or ee only\n" | ||||
printf " Default: /home/rhodecode/rhodecode-enterprise-ce\n" | ||||
echo | ||||
# :flag.usage | ||||
printf " %s\n" "--cmd CMD" | ||||
printf " cmd script to run, this is on host machine, relative to $WORKSPACE_HOME\n" | ||||
r408 | printf " Default: .dev-env/cmd-svnd.sh\n" | |||
r403 | echo | |||
r211 | # :command.usage_fixed_flags | |||
printf " %s\n" "--help, -h" | ||||
printf " Show this help\n" | ||||
echo | ||||
fi | ||||
} | ||||
# :command.usage | ||||
r381 | dev_tools_tools_usage() { | |||
r179 | if [[ -n $long_usage ]]; then | |||
r381 | printf "dev-tools tools - run bash console for rhodecode-tools-ce\n" | |||
r179 | echo | |||
else | ||||
r381 | printf "dev-tools tools - run bash console for rhodecode-tools-ce\n" | |||
r179 | echo | |||
fi | ||||
r381 | printf "Alias: t\n" | |||
echo | ||||
r179 | printf "%s\n" "Usage:" | |||
r381 | printf " dev-tools tools\n" | |||
printf " dev-tools tools --help | -h\n" | ||||
r179 | echo | |||
# :command.long_usage | ||||
if [[ -n $long_usage ]]; then | ||||
printf "%s\n" "Options:" | ||||
# :command.usage_fixed_flags | ||||
printf " %s\n" "--help, -h" | ||||
printf " Show this help\n" | ||||
echo | ||||
fi | ||||
} | ||||
# :command.usage | ||||
dev_tools_dev_env_usage() { | ||||
if [[ -n $long_usage ]]; then | ||||
printf "dev-tools dev-env - create dev env required to run vcsserver and rhodecode\n" | ||||
echo | ||||
else | ||||
printf "dev-tools dev-env - create dev env required to run vcsserver and rhodecode\n" | ||||
echo | ||||
fi | ||||
printf "%s\n" "Usage:" | ||||
printf " dev-tools dev-env\n" | ||||
printf " dev-tools dev-env --help | -h\n" | ||||
echo | ||||
# :command.long_usage | ||||
if [[ -n $long_usage ]]; then | ||||
printf "%s\n" "Options:" | ||||
# :command.usage_fixed_flags | ||||
printf " %s\n" "--help, -h" | ||||
printf " Show this help\n" | ||||
echo | ||||
fi | ||||
} | ||||
# :command.usage | ||||
dev_tools_prune_usage() { | ||||
if [[ -n $long_usage ]]; then | ||||
printf "dev-tools prune - clears docker images\n" | ||||
echo | ||||
else | ||||
printf "dev-tools prune - clears docker images\n" | ||||
echo | ||||
fi | ||||
printf "%s\n" "Usage:" | ||||
printf " dev-tools prune\n" | ||||
printf " dev-tools prune --help | -h\n" | ||||
echo | ||||
# :command.long_usage | ||||
if [[ -n $long_usage ]]; then | ||||
printf "%s\n" "Options:" | ||||
# :command.usage_fixed_flags | ||||
printf " %s\n" "--help, -h" | ||||
printf " Show this help\n" | ||||
echo | ||||
fi | ||||
} | ||||
# :command.usage | ||||
dev_tools_prune_all_usage() { | ||||
if [[ -n $long_usage ]]; then | ||||
r211 | printf "dev-tools prune-all - clears docker images and system cache, full cleanup. Be cautious !\n" | |||
r179 | echo | |||
else | ||||
r211 | printf "dev-tools prune-all - clears docker images and system cache, full cleanup. Be cautious !\n" | |||
r179 | echo | |||
fi | ||||
printf "%s\n" "Usage:" | ||||
printf " dev-tools prune-all\n" | ||||
printf " dev-tools prune-all --help | -h\n" | ||||
echo | ||||
# :command.long_usage | ||||
if [[ -n $long_usage ]]; then | ||||
printf "%s\n" "Options:" | ||||
# :command.usage_fixed_flags | ||||
printf " %s\n" "--help, -h" | ||||
printf " Show this help\n" | ||||
echo | ||||
fi | ||||
} | ||||
# :command.usage | ||||
r207 | dev_tools_cli_generate_pull_usage() { | |||
if [[ -n $long_usage ]]; then | ||||
printf "dev-tools cli-generate-pull - pull latest image of bashly\n" | ||||
echo | ||||
else | ||||
printf "dev-tools cli-generate-pull - pull latest image of bashly\n" | ||||
echo | ||||
fi | ||||
printf "%s\n" "Usage:" | ||||
printf " dev-tools cli-generate-pull\n" | ||||
printf " dev-tools cli-generate-pull --help | -h\n" | ||||
echo | ||||
# :command.long_usage | ||||
if [[ -n $long_usage ]]; then | ||||
printf "%s\n" "Options:" | ||||
# :command.usage_fixed_flags | ||||
printf " %s\n" "--help, -h" | ||||
printf " Show this help\n" | ||||
echo | ||||
fi | ||||
} | ||||
# :command.usage | ||||
r249 | dev_tools_cli_generate_help_usage() { | |||
if [[ -n $long_usage ]]; then | ||||
printf "dev-tools cli-generate-help - print out help about bashly\n" | ||||
echo | ||||
else | ||||
printf "dev-tools cli-generate-help - print out help about bashly\n" | ||||
echo | ||||
fi | ||||
printf "%s\n" "Usage:" | ||||
printf " dev-tools cli-generate-help\n" | ||||
printf " dev-tools cli-generate-help --help | -h\n" | ||||
echo | ||||
# :command.long_usage | ||||
if [[ -n $long_usage ]]; then | ||||
printf "%s\n" "Options:" | ||||
# :command.usage_fixed_flags | ||||
printf " %s\n" "--help, -h" | ||||
printf " Show this help\n" | ||||
echo | ||||
fi | ||||
} | ||||
# :command.usage | ||||
r314 | dev_tools_stack_cli_version_usage() { | |||
if [[ -n $long_usage ]]; then | ||||
printf "dev-tools stack-cli-version - set the version for rcstack\n" | ||||
echo | ||||
else | ||||
printf "dev-tools stack-cli-version - set the version for rcstack\n" | ||||
echo | ||||
fi | ||||
printf "%s\n" "Usage:" | ||||
printf " dev-tools stack-cli-version VERSION\n" | ||||
printf " dev-tools stack-cli-version --help | -h\n" | ||||
echo | ||||
# :command.long_usage | ||||
if [[ -n $long_usage ]]; then | ||||
printf "%s\n" "Options:" | ||||
# :command.usage_fixed_flags | ||||
printf " %s\n" "--help, -h" | ||||
printf " Show this help\n" | ||||
echo | ||||
# :command.usage_args | ||||
printf "%s\n" "Arguments:" | ||||
# :argument.usage | ||||
printf " %s\n" "VERSION" | ||||
printf " Version to set e.g '5.0.0'\n" | ||||
echo | ||||
fi | ||||
} | ||||
# :command.usage | ||||
r375 | dev_tools_cli_generate_rc_usage() { | |||
r179 | if [[ -n $long_usage ]]; then | |||
r375 | printf "dev-tools cli-generate-rc - run a ./rcstack generation script\n" | |||
r179 | echo | |||
else | ||||
r375 | printf "dev-tools cli-generate-rc - run a ./rcstack generation script\n" | |||
r179 | echo | |||
fi | ||||
printf "%s\n" "Usage:" | ||||
r375 | printf " dev-tools cli-generate-rc [OPTIONS]\n" | |||
printf " dev-tools cli-generate-rc --help | -h\n" | ||||
r179 | echo | |||
# :command.long_usage | ||||
if [[ -n $long_usage ]]; then | ||||
printf "%s\n" "Options:" | ||||
r225 | # :command.usage_flags | |||
# :flag.usage | ||||
printf " %s\n" "--one-time, -o" | ||||
printf " run the command a single time without watch\n" | ||||
echo | ||||
r179 | # :command.usage_fixed_flags | |||
printf " %s\n" "--help, -h" | ||||
printf " Show this help\n" | ||||
echo | ||||
fi | ||||
} | ||||
# :command.usage | ||||
r375 | dev_tools_cli_generate_dev_usage() { | |||
r179 | if [[ -n $long_usage ]]; then | |||
r375 | printf "dev-tools cli-generate-dev - run a ./dev-tools generation script\n" | |||
r179 | echo | |||
else | ||||
r375 | printf "dev-tools cli-generate-dev - run a ./dev-tools generation script\n" | |||
r179 | echo | |||
fi | ||||
printf "%s\n" "Usage:" | ||||
r375 | printf " dev-tools cli-generate-dev [OPTIONS]\n" | |||
printf " dev-tools cli-generate-dev --help | -h\n" | ||||
r179 | echo | |||
# :command.long_usage | ||||
if [[ -n $long_usage ]]; then | ||||
printf "%s\n" "Options:" | ||||
r225 | # :command.usage_flags | |||
# :flag.usage | ||||
printf " %s\n" "--one-time, -o" | ||||
printf " run the command a single time without watch\n" | ||||
echo | ||||
r179 | # :command.usage_fixed_flags | |||
printf " %s\n" "--help, -h" | ||||
printf " Show this help\n" | ||||
echo | ||||
fi | ||||
} | ||||
r375 | # :command.usage | |||
dev_tools_get_build_artifacts_usage() { | ||||
if [[ -n $long_usage ]]; then | ||||
printf "dev-tools get-build-artifacts - Fetch Artifacts to run installer based build\n" | ||||
echo | ||||
else | ||||
printf "dev-tools get-build-artifacts - Fetch Artifacts to run installer based build\n" | ||||
echo | ||||
fi | ||||
printf "%s\n" "Usage:" | ||||
printf " dev-tools get-build-artifacts [OPTIONS]\n" | ||||
printf " dev-tools get-build-artifacts --help | -h\n" | ||||
echo | ||||
# :command.long_usage | ||||
if [[ -n $long_usage ]]; then | ||||
printf "%s\n" "Options:" | ||||
# :command.usage_flags | ||||
# :flag.usage | ||||
printf " %s\n" "--auth AUTH" | ||||
printf " Specify custom auth for curl e.g -u admin:secret\n" | ||||
printf " Default: \n" | ||||
echo | ||||
# :flag.usage | ||||
printf " %s\n" "--installer-url INSTALLER_URL" | ||||
printf " Installer Download URL\n" | ||||
printf " Default: https://dls.rhodecode.com/dls/N2E2ZTY1NzA3NjYxNDA2NTc1NjI3MTcyNzA2MjcxNzIyZTcwNjI3YQ==/rhodecode-control/latest-linux-ee\n" | ||||
echo | ||||
# :flag.usage | ||||
printf " %s\n" "--manifest-url MANIFEST_URL" | ||||
printf " Manifest file url\n" | ||||
printf " Default: https://dls.rhodecode.com/linux/MANIFEST\n" | ||||
echo | ||||
# :flag.usage | ||||
printf " %s\n" "--version-name VERSION_NAME" | ||||
printf " Specify custom build ver e.g 4.27.0\n" | ||||
printf " Default: $RC_CLI_VERSION_NAME\n" | ||||
echo | ||||
# :command.usage_fixed_flags | ||||
printf " %s\n" "--help, -h" | ||||
printf " Show this help\n" | ||||
echo | ||||
fi | ||||
} | ||||
# :command.usage | ||||
dev_tools_build_installer_usage() { | ||||
if [[ -n $long_usage ]]; then | ||||
printf "dev-tools build-installer - Build RhodeCode image from installer, ./dev-tools get-build-artifacts initially\n" | ||||
echo | ||||
else | ||||
printf "dev-tools build-installer - Build RhodeCode image from installer, ./dev-tools get-build-artifacts initially\n" | ||||
echo | ||||
fi | ||||
printf "%s\n" "Usage:" | ||||
printf " dev-tools build-installer [OPTIONS]\n" | ||||
printf " dev-tools build-installer --help | -h\n" | ||||
echo | ||||
# :command.long_usage | ||||
if [[ -n $long_usage ]]; then | ||||
printf "%s\n" "Options:" | ||||
# :command.usage_flags | ||||
# :flag.usage | ||||
printf " %s\n" "--version-name VERSION_NAME" | ||||
printf " Specify custom build ver e.g 4.27.0\n" | ||||
printf " Default: $RC_CLI_VERSION_NAME\n" | ||||
echo | ||||
# :command.usage_fixed_flags | ||||
printf " %s\n" "--help, -h" | ||||
printf " Show this help\n" | ||||
echo | ||||
fi | ||||
} | ||||
# :command.usage | ||||
dev_tools_get_build_source_usage() { | ||||
if [[ -n $long_usage ]]; then | ||||
printf "dev-tools get-build-source - Fetch RhodeCode sources, store in .source dir to run a source-based builds\n" | ||||
echo | ||||
else | ||||
printf "dev-tools get-build-source - Fetch RhodeCode sources, store in .source dir to run a source-based builds\n" | ||||
echo | ||||
fi | ||||
printf "%s\n" "Usage:" | ||||
printf " dev-tools get-build-source [OPTIONS]\n" | ||||
printf " dev-tools get-build-source --help | -h\n" | ||||
echo | ||||
# :command.long_usage | ||||
if [[ -n $long_usage ]]; then | ||||
printf "%s\n" "Options:" | ||||
# :command.usage_flags | ||||
# :flag.usage | ||||
printf " %s\n" "--revision REVISION" | ||||
printf " revision to download\n" | ||||
printf " Default: default\n" | ||||
echo | ||||
# :flag.usage | ||||
printf " %s\n" "--auth-token AUTH_TOKEN" | ||||
printf " Specify AUTH TOKEN to obtain sources\n" | ||||
echo | ||||
# :flag.usage | ||||
printf " %s\n" "--server-url SERVER_URL" | ||||
printf " Specify RhodeCode server location where projects should be downloaded\n" | ||||
printf " Default: https://code.rhodecode.com\n" | ||||
echo | ||||
# :command.usage_fixed_flags | ||||
printf " %s\n" "--help, -h" | ||||
printf " Show this help\n" | ||||
echo | ||||
# :command.usage_examples | ||||
printf "%s\n" "Examples:" | ||||
printf " ./dev-tools get-sources $RC_CLI_VERSION_NAME\n" | ||||
printf " ./dev-tools get-sources default --auth-token xyxyxyx --server-url\n https://secret.repo/\n" | ||||
echo | ||||
fi | ||||
} | ||||
# :command.usage | ||||
dev_tools_build_source_usage() { | ||||
if [[ -n $long_usage ]]; then | ||||
printf "dev-tools build-source - Build RhodeCode image from source, requires ./dev-tools get-build-source initially\n" | ||||
echo | ||||
else | ||||
printf "dev-tools build-source - Build RhodeCode image from source, requires ./dev-tools get-build-source initially\n" | ||||
echo | ||||
fi | ||||
printf "%s\n" "Usage:" | ||||
printf " dev-tools build-source [OPTIONS]\n" | ||||
printf " dev-tools build-source --help | -h\n" | ||||
echo | ||||
# :command.long_usage | ||||
if [[ -n $long_usage ]]; then | ||||
printf "%s\n" "Options:" | ||||
# :command.usage_flags | ||||
# :flag.usage | ||||
printf " %s\n" "--version-name VERSION_NAME" | ||||
printf " Specify custom build ver e.g 4.27.0\n" | ||||
printf " Default: $RC_CLI_VERSION_NAME\n" | ||||
echo | ||||
# :flag.usage | ||||
printf " %s\n" "--source-build-yaml BUILD_SOURCE_YAML" | ||||
printf " yaml file to build source against\n" | ||||
printf " Default: build_yaml/docker-compose-apps.5.yaml\n" | ||||
echo | ||||
# :flag.usage | ||||
printf " %s\n" "--tag TAG (repeatable)" | ||||
printf " tag build image\n" | ||||
echo | ||||
# :command.usage_fixed_flags | ||||
printf " %s\n" "--help, -h" | ||||
printf " Show this help\n" | ||||
echo | ||||
# :command.usage_examples | ||||
printf "%s\n" "Examples:" | ||||
printf " ./dev-tools build-source --source-build-yaml\n build_yaml/docker-compose-apps.5.yaml --version-name 5.0.0.beta1 --tag beta\n" | ||||
printf " ./dev-tools build-source --source-build-yaml\n build_yaml/docker-compose-apps.4.yaml --version-name 4.28.0 --tag stable\n" | ||||
echo | ||||
fi | ||||
} | ||||
r179 | # :command.normalize_input | |||
normalize_input() { | ||||
local arg flags | ||||
while [[ $# -gt 0 ]]; do | ||||
arg="$1" | ||||
if [[ $arg =~ ^(--[a-zA-Z0-9_\-]+)=(.+)$ ]]; then | ||||
input+=("${BASH_REMATCH[1]}") | ||||
input+=("${BASH_REMATCH[2]}") | ||||
elif [[ $arg =~ ^(-[a-zA-Z0-9])=(.+)$ ]]; then | ||||
input+=("${BASH_REMATCH[1]}") | ||||
input+=("${BASH_REMATCH[2]}") | ||||
elif [[ $arg =~ ^-([a-zA-Z0-9][a-zA-Z0-9]+)$ ]]; then | ||||
flags="${BASH_REMATCH[1]}" | ||||
for ((i = 0; i < ${#flags}; i++)); do | ||||
input+=("-${flags:i:1}") | ||||
done | ||||
else | ||||
input+=("$arg") | ||||
fi | ||||
shift | ||||
done | ||||
} | ||||
# :command.inspect_args | ||||
inspect_args() { | ||||
if ((${#args[@]})); then | ||||
r207 | readarray -t sorted_keys < <(printf '%s\n' "${!args[@]}" | sort) | |||
r179 | echo args: | |||
for k in "${sorted_keys[@]}"; do echo "- \${args[$k]} = ${args[$k]}"; done | ||||
else | ||||
echo args: none | ||||
fi | ||||
if ((${#other_args[@]})); then | ||||
echo | ||||
echo other_args: | ||||
echo "- \${other_args[*]} = ${other_args[*]}" | ||||
for i in "${!other_args[@]}"; do | ||||
echo "- \${other_args[$i]} = ${other_args[$i]}" | ||||
done | ||||
fi | ||||
r207 | ||||
if ((${#deps[@]})); then | ||||
readarray -t sorted_keys < <(printf '%s\n' "${!deps[@]}" | sort) | ||||
echo | ||||
echo deps: | ||||
for k in "${sorted_keys[@]}"; do echo "- \${deps[$k]} = ${deps[$k]}"; done | ||||
fi | ||||
r179 | } | |||
# :command.command_functions | ||||
# :command.function | ||||
dev_tools_vcs_command() { | ||||
# src/vcs_command.sh | ||||
container_name=dev-vcsserver | ||||
r381 | dev_env_file="/home/rhodecode/rhodecode-vcsserver/.dev/dev-env.sh" | |||
env_file=".custom/.dev.env" | ||||
r179 | ||||
r381 | docker_id=$(docker ps -q --filter "name=$container_name") | |||
if [[ $docker_id ]]; then | ||||
echo $container_name FOUND, Killing old one ! | ||||
docker kill -s 9 $docker_id | ||||
sleep 5 | ||||
docker rm -fv $container_name | ||||
echo "done..." | ||||
else | ||||
echo $container_name not found | ||||
# # bootstrap dev-env.sh | ||||
# if [[ ! -f $dev_env_file ]]; then | ||||
# echo "bootstrap of new dev-env file under $dev_env_file" | ||||
# fi | ||||
fi | ||||
r179 | ||||
r274 | if [[ -v WORKSPACE_HOME ]]; | |||
then | ||||
DEFAULT_WORKSPACE_HOME=$WORKSPACE_HOME | ||||
else | ||||
r354 | echo "WORKSPACE_HOME env var is not set" | |||
exit 1 | ||||
r274 | fi | |||
r354 | echo "Using default WORKSPACE_HOME path: $DEFAULT_WORKSPACE_HOME" | |||
r274 | ||||
r179 | eval " | |||
r299 | WORKSPACE_HOME=$DEFAULT_WORKSPACE_HOME \ | |||
r381 | ./rcstack stack --env-file-path $env_file rhodecode -f docker-compose-apps.dev.yaml \ | |||
r383 | run -e ENV_FILE= -e RC_ENV_FILE= -e RC_APP_TYPE=rhodecode_sh \ | |||
r299 | --publish 10010:10010 --rm --use-aliases \ | |||
r179 | --workdir=\"/home/rhodecode/rhodecode-vcsserver\" \ | |||
r299 | --interactive --tty \ | |||
r381 | --name=\"$container_name\" vcsserver bash $dev_env_file" | |||
r179 | } | |||
# :command.function | ||||
dev_tools_ee_command() { | ||||
# src/ee_command.sh | ||||
container_name=dev-enterprise-ee | ||||
r381 | dev_env_file="/home/rhodecode/rhodecode-enterprise-ee/.dev/dev-env.sh" | |||
env_file=".custom/.dev.env" | ||||
r179 | ||||
r381 | docker_id=$(docker ps -q --filter "name=$container_name") | |||
if [[ $docker_id ]]; then | ||||
echo $container_name FOUND, Killing old one ! | ||||
docker kill -s 9 $docker_id | ||||
sleep 5 | ||||
docker rm -fv $container_name | ||||
echo "done..." | ||||
else | ||||
echo $container_name not found | ||||
# # bootstrap dev-env.sh | ||||
# if [[ ! -f $dev_env_file ]]; then | ||||
# echo "bootstrap of new dev-env file under $dev_env_file" | ||||
# fi | ||||
fi | ||||
r179 | ||||
r274 | if [[ -v WORKSPACE_HOME ]]; | |||
then | ||||
DEFAULT_WORKSPACE_HOME=$WORKSPACE_HOME | ||||
else | ||||
r354 | echo "WORKSPACE_HOME env var is not set" | |||
exit 1 | ||||
r274 | fi | |||
r354 | echo "Using default WORKSPACE_HOME path: $DEFAULT_WORKSPACE_HOME" | |||
r274 | ||||
r179 | eval " | |||
r342 | WORKSPACE_HOME=$DEFAULT_WORKSPACE_HOME \ | |||
r381 | ./rcstack stack --env-file-path $env_file rhodecode -f docker-compose-apps.dev.yaml \ | |||
r383 | run -e ENV_FILE= -e RC_ENV_FILE= -e RC_APP_TYPE=rhodecode_sh --rm --use-aliases \ | |||
r342 | --publish 10020:10020 --rm --use-aliases \ | |||
r179 | --workdir=\"/home/rhodecode/rhodecode-enterprise-ee\" \ | |||
r342 | --interactive --tty \ | |||
r381 | --name=\"$container_name\" rhodecode bash $dev_env_file" | |||
r179 | } | |||
# :command.function | ||||
dev_tools_ce_command() { | ||||
# src/ce_command.sh | ||||
container_name=dev-enterprise-ce | ||||
r381 | dev_env_file="/home/rhodecode/rhodecode-enterprise-ce/.dev/dev-env.sh" | |||
env_file=".custom/.dev.env" | ||||
r179 | ||||
r381 | docker_id=$(docker ps -q --filter "name=$container_name") | |||
if [[ $docker_id ]]; then | ||||
echo $container_name FOUND, Killing old one ! | ||||
docker kill -s 9 $docker_id | ||||
sleep 5 | ||||
docker rm -fv $container_name | ||||
echo "done..." | ||||
else | ||||
echo $container_name not found | ||||
# # bootstrap dev-env.sh | ||||
# if [[ ! -f $dev_env_file ]]; then | ||||
# echo "bootstrap of new dev-env file under $dev_env_file" | ||||
# fi | ||||
fi | ||||
r179 | ||||
r274 | if [[ -v WORKSPACE_HOME ]]; | |||
then | ||||
DEFAULT_WORKSPACE_HOME=$WORKSPACE_HOME | ||||
else | ||||
r354 | echo "WORKSPACE_HOME env var is not set" | |||
exit 1 | ||||
r274 | fi | |||
r354 | echo "Using default WORKSPACE_HOME path: $DEFAULT_WORKSPACE_HOME" | |||
r274 | ||||
r179 | eval " | |||
r299 | WORKSPACE_HOME=$DEFAULT_WORKSPACE_HOME \ | |||
r381 | ./rcstack stack --env-file-path $env_file rhodecode -f docker-compose-apps.dev.yaml \ | |||
r383 | run -e ENV_FILE= -e RC_ENV_FILE= -e RC_APP_TYPE=rhodecode_sh --rm --use-aliases \ | |||
r299 | --publish 10020:10020 --rm --use-aliases \ | |||
r179 | --workdir=\"/home/rhodecode/rhodecode-enterprise-ce\" \ | |||
r299 | --interactive --tty \ | |||
r381 | --name=\"$container_name\" rhodecode bash $dev_env_file" | |||
r342 | } | |||
# :command.function | ||||
r381 | dev_tools_celery_command() { | |||
# src/celery_command.sh | ||||
r403 | if [[ -v WORKSPACE_HOME ]]; | |||
then | ||||
DEFAULT_WORKSPACE_HOME=$WORKSPACE_HOME | ||||
echo "Using default WORKSPACE_HOME path: $DEFAULT_WORKSPACE_HOME" | ||||
else | ||||
echo "WORKSPACE_HOME env var is not set" | ||||
exit 1 | ||||
fi | ||||
r400 | code_workdir=${args[--workdir]} | |||
cmd_script=${args[--cmd]} | ||||
exec_script=$WORKSPACE_HOME/$cmd_script | ||||
r381 | container_name=dev-celery | |||
r403 | env_file=".custom/.dev.env" | |||
r211 | ||||
r400 | echo "Using exec script: $exec_script" | |||
r403 | RC_DEV_CMD_HELP="celery --no-color --app=rhodecode.lib.celerylib.loader worker --autoscale=4,2 --max-tasks-per-child=100 --task-events --loglevel=DEBUG --ini=.dev/dev.ini" | |||
r400 | if [[ ! -f $exec_script ]]; then | |||
echo "Generating new $exec_script file..." | ||||
mkdir -p $(dirname $exec_script) | ||||
cat <<< " | ||||
r403 | # Generated dev-env script for celery | |||
echo \"Run celery dev using the following command:\" | ||||
echo \"++++++++++++++++++++++++++++++++++++++++++++++++++\" | ||||
echo \"$RC_DEV_CMD_HELP\" | ||||
echo \"++++++++++++++++++++++++++++++++++++++++++++++++++\" | ||||
make sh | ||||
" > $exec_script | ||||
r400 | chmod +x $exec_script | |||
fi | ||||
docker_exec_script="/var/opt/rhodecode_repo_store/$cmd_script" | ||||
r404 | docker_id=$(docker ps -q --filter "name=$container_name" --filter name="rc_cluster_apps-celery") | |||
r403 | ||||
if [[ $docker_id ]]; then | ||||
echo $container_name FOUND, Killing old one ! | ||||
docker kill -s 9 $docker_id | ||||
sleep 5 | ||||
docker rm -fv $container_name | ||||
echo "done..." | ||||
else | ||||
echo $container_name not found | ||||
fi | ||||
r381 | ||||
eval " | ||||
r403 | WORKSPACE_HOME=$DEFAULT_WORKSPACE_HOME RC_DEV_CMD_HELP=\"$RC_DEV_CMD_HELP\" \ | |||
./rcstack stack --env-file-path $env_file rhodecode -f docker-compose-apps.dev.yaml \ | ||||
run -e RC_DEV_CMD_HELP=\"'$RC_DEV_CMD_HELP'\" -e ENV_FILE= -e RC_ENV_FILE= -e RC_APP_TYPE=rhodecode_$container_name --rm --use-aliases \ | ||||
r400 | --workdir=\"$code_workdir\" \ | |||
r403 | --name=\"$container_name\" \ | |||
--interactive --tty \ | ||||
rhodecode bash $docker_exec_script" | ||||
r400 | ||||
} | ||||
# :command.function | ||||
dev_tools_celeryd_command() { | ||||
# src/celeryd_command.sh | ||||
r403 | if [[ -v WORKSPACE_HOME ]]; | |||
then | ||||
DEFAULT_WORKSPACE_HOME=$WORKSPACE_HOME | ||||
echo "Using default WORKSPACE_HOME path: $DEFAULT_WORKSPACE_HOME" | ||||
else | ||||
echo "WORKSPACE_HOME env var is not set" | ||||
exit 1 | ||||
fi | ||||
r400 | code_workdir=${args[--workdir]} | |||
cmd_script=${args[--cmd]} | ||||
exec_script=$WORKSPACE_HOME/$cmd_script | ||||
container_name=dev-celeryd | ||||
r403 | env_file=".custom/.dev.env" | |||
r400 | ||||
echo "Using exec script: $exec_script" | ||||
r403 | RC_DEV_CMD_HELP="" | |||
r400 | if [[ ! -f $exec_script ]]; then | |||
echo "Generating new $exec_script file..." | ||||
mkdir -p $(dirname $exec_script) | ||||
cat <<< " | ||||
r403 | # Generated dev-env script for celeryd | |||
r400 | ||||
r403 | echo \"Run celery dev using the following command:\" | |||
make dev-env && celery --no-color --app=rhodecode.lib.celerylib.loader worker --autoscale=4,2 --max-tasks-per-child=100 --task-events --loglevel=DEBUG --ini=.dev/dev.ini | ||||
" > $exec_script | ||||
r400 | chmod +x $exec_script | |||
fi | ||||
docker_exec_script="/var/opt/rhodecode_repo_store/$cmd_script" | ||||
r404 | docker_id=$(docker ps -q --filter "name=$container_name" --filter name="rc_cluster_apps-celery") | |||
r403 | ||||
if [[ $docker_id ]]; then | ||||
echo $container_name FOUND, Killing old one ! | ||||
docker kill -s 9 $docker_id | ||||
sleep 5 | ||||
docker rm -fv $container_name | ||||
echo "done..." | ||||
else | ||||
echo $container_name not found | ||||
fi | ||||
r400 | ||||
eval " | ||||
r403 | WORKSPACE_HOME=$DEFAULT_WORKSPACE_HOME RC_DEV_CMD_HELP=\"$RC_DEV_CMD_HELP\" \ | |||
./rcstack stack --env-file-path $env_file rhodecode -f docker-compose-apps.dev.yaml \ | ||||
run -e RC_DEV_CMD_HELP=\"'$RC_DEV_CMD_HELP'\" -e ENV_FILE= -e RC_ENV_FILE= -e RC_APP_TYPE=rhodecode_$container_name --rm --use-aliases \ | ||||
r400 | --workdir=\"$code_workdir\" \ | |||
r403 | --name=\"$container_name\" \ | |||
--detach \ | ||||
rhodecode $docker_exec_script" | ||||
r381 | ||||
} | ||||
# :command.function | ||||
r403 | dev_tools_ssh_command() { | |||
# src/ssh_command.sh | ||||
if [[ -v WORKSPACE_HOME ]]; | ||||
then | ||||
DEFAULT_WORKSPACE_HOME=$WORKSPACE_HOME | ||||
echo "Using default WORKSPACE_HOME path: $DEFAULT_WORKSPACE_HOME" | ||||
else | ||||
echo "WORKSPACE_HOME env var is not set" | ||||
exit 1 | ||||
fi | ||||
code_workdir=${args[--workdir]} | ||||
cmd_script=${args[--cmd]} | ||||
exec_script=$WORKSPACE_HOME/$cmd_script | ||||
container_name=dev-ssh | ||||
r381 | env_file=".custom/.dev.env" | |||
r403 | echo "Using exec script: $exec_script" | |||
RC_DEV_CMD_HELP="mkdir -p /run/sshd && /usr/sbin/sshd -f /etc/rhodecode/sshd_config -D -e" | ||||
if [[ ! -f $exec_script ]]; then | ||||
echo "Generating new $exec_script file..." | ||||
mkdir -p $(dirname $exec_script) | ||||
cat <<< " | ||||
# Generated dev-env script for ssh | ||||
echo \"Run ssh dev using the following command:\" | ||||
echo \"++++++++++++++++++++++++++++++++++++++++++++++++++\" | ||||
echo \"$RC_DEV_CMD_HELP\" | ||||
echo \"++++++++++++++++++++++++++++++++++++++++++++++++++\" | ||||
make sh | ||||
" > $exec_script | ||||
chmod +x $exec_script | ||||
fi | ||||
docker_exec_script="/var/opt/rhodecode_repo_store/$cmd_script" | ||||
r404 | docker_id=$(docker ps -q --filter "name=$container_name" --filter name="rc_cluster_apps-sshd") | |||
r381 | ||||
if [[ $docker_id ]]; then | ||||
echo $container_name FOUND, Killing old one ! | ||||
docker kill -s 9 $docker_id | ||||
sleep 5 | ||||
docker rm -fv $container_name | ||||
echo "done..." | ||||
else | ||||
echo $container_name not found | ||||
fi | ||||
r211 | ||||
r403 | RC_SSH_PORT=9022 | |||
eval " | ||||
WORKSPACE_HOME=$DEFAULT_WORKSPACE_HOME RC_DEV_CMD_HELP=\"$RC_DEV_CMD_HELP\" \ | ||||
./rcstack stack --env-file-path $env_file rhodecode -f docker-compose-apps.dev.yaml \ | ||||
run -e RC_DEV_CMD_HELP=\"'$RC_DEV_CMD_HELP'\" -e ENV_FILE= -e RC_ENV_FILE= -e RC_APP_TYPE=rhodecode_$container_name --rm --use-aliases \ | ||||
--workdir=\"$code_workdir\" \ | ||||
--name=\"$container_name\" \ | ||||
--interactive --tty \ | ||||
--publish $RC_SSH_PORT:$RC_SSH_PORT \ | ||||
sshd bash $docker_exec_script" | ||||
} | ||||
# :command.function | ||||
dev_tools_sshd_command() { | ||||
# src/sshd_command.sh | ||||
r342 | if [[ -v WORKSPACE_HOME ]]; | |||
then | ||||
DEFAULT_WORKSPACE_HOME=$WORKSPACE_HOME | ||||
r403 | echo "Using default WORKSPACE_HOME path: $DEFAULT_WORKSPACE_HOME" | |||
r342 | else | |||
r354 | echo "WORKSPACE_HOME env var is not set" | |||
exit 1 | ||||
r342 | fi | |||
r403 | code_workdir=${args[--workdir]} | |||
cmd_script=${args[--cmd]} | ||||
exec_script=$WORKSPACE_HOME/$cmd_script | ||||
container_name=dev-sshd | ||||
env_file=".custom/.dev.env" | ||||
echo "Using exec script: $exec_script" | ||||
RC_DEV_CMD_HELP="" | ||||
if [[ ! -f $exec_script ]]; then | ||||
echo "Generating new $exec_script file..." | ||||
mkdir -p $(dirname $exec_script) | ||||
cat <<< " | ||||
# Generated dev-env script for ssh | ||||
echo \"Run ssh dev using the following command:\" | ||||
make dev-env && mkdir -p /run/sshd && /usr/sbin/sshd -f /etc/rhodecode/sshd_config -D -e | ||||
" > $exec_script | ||||
chmod +x $exec_script | ||||
fi | ||||
docker_exec_script="/var/opt/rhodecode_repo_store/$cmd_script" | ||||
r404 | docker_id=$(docker ps -q --filter "name=$container_name" --filter name="rc_cluster_apps-sshd") | |||
r403 | ||||
if [[ $docker_id ]]; then | ||||
echo $container_name FOUND, Killing old one ! | ||||
docker kill -s 9 $docker_id | ||||
sleep 5 | ||||
docker rm -fv $container_name | ||||
echo "done..." | ||||
else | ||||
echo $container_name not found | ||||
fi | ||||
r342 | ||||
r381 | RC_SSH_PORT=9022 | |||
r211 | eval " | |||
r403 | WORKSPACE_HOME=$DEFAULT_WORKSPACE_HOME RC_DEV_CMD_HELP=\"$RC_DEV_CMD_HELP\" \ | |||
r381 | ./rcstack stack --env-file-path $env_file rhodecode -f docker-compose-apps.dev.yaml \ | |||
r403 | run -e RC_DEV_CMD_HELP=\"'$RC_DEV_CMD_HELP'\" -e ENV_FILE= -e RC_ENV_FILE= -e RC_APP_TYPE=rhodecode_$container_name --rm --use-aliases \ | |||
--workdir=\"$code_workdir\" \ | ||||
--name=\"$container_name\" \ | ||||
--detach \ | ||||
--publish $RC_SSH_PORT:$RC_SSH_PORT \ | ||||
sshd $docker_exec_script" | ||||
r211 | ||||
} | ||||
# :command.function | ||||
r408 | dev_tools_svn_command() { | |||
# src/svn_command.sh | ||||
if [[ -v WORKSPACE_HOME ]]; | ||||
then | ||||
DEFAULT_WORKSPACE_HOME=$WORKSPACE_HOME | ||||
echo "Using default WORKSPACE_HOME path: $DEFAULT_WORKSPACE_HOME" | ||||
else | ||||
echo "WORKSPACE_HOME env var is not set" | ||||
exit 1 | ||||
fi | ||||
code_workdir=${args[--workdir]} | ||||
cmd_script=${args[--cmd]} | ||||
exec_script=$WORKSPACE_HOME/$cmd_script | ||||
container_name=dev-svn | ||||
env_file=".custom/.dev.env" | ||||
echo "Using exec script: $exec_script" | ||||
RC_DEV_CMD_HELP="apachectl -D FOREGROUND" | ||||
if [[ ! -f $exec_script ]]; then | ||||
echo "Generating new $exec_script file..." | ||||
mkdir -p $(dirname $exec_script) | ||||
cat <<< " | ||||
# Generated dev-env script for svn | ||||
echo \"Run svn dev using the following command:\" | ||||
echo \"++++++++++++++++++++++++++++++++++++++++++++++++++\" | ||||
echo \"$RC_DEV_CMD_HELP\" | ||||
echo \"++++++++++++++++++++++++++++++++++++++++++++++++++\" | ||||
make sh | ||||
" > $exec_script | ||||
chmod +x $exec_script | ||||
fi | ||||
docker_exec_script="/var/opt/rhodecode_repo_store/$cmd_script" | ||||
docker_id=$(docker ps -q --filter "name=$container_name" --filter name="rc_cluster_apps-svn") | ||||
if [[ $docker_id ]]; then | ||||
echo $container_name FOUND, Killing old one ! | ||||
docker kill -s 9 $docker_id | ||||
sleep 5 | ||||
docker rm -fv $container_name | ||||
echo "done..." | ||||
else | ||||
echo $container_name not found | ||||
fi | ||||
eval " | ||||
WORKSPACE_HOME=$DEFAULT_WORKSPACE_HOME RC_DEV_CMD_HELP=\"$RC_DEV_CMD_HELP\" \ | ||||
./rcstack stack --env-file-path $env_file rhodecode -f docker-compose-apps.dev.yaml \ | ||||
run -e RC_DEV_CMD_HELP=\"'$RC_DEV_CMD_HELP'\" -e ENV_FILE= -e RC_ENV_FILE= -e RC_APP_TYPE=rhodecode_$container_name --rm --use-aliases \ | ||||
--workdir=\"$code_workdir\" \ | ||||
--name=\"$container_name\" \ | ||||
--interactive --tty \ | ||||
svn bash $docker_exec_script" | ||||
} | ||||
# :command.function | ||||
dev_tools_svnd_command() { | ||||
# src/svnd_command.sh | ||||
echo "# this file is located in 'src/svnd_command.sh'" | ||||
echo "# code for 'dev-tools svnd' goes here" | ||||
echo "# you can edit it freely and regenerate (it will not be overwritten)" | ||||
inspect_args | ||||
} | ||||
# :command.function | ||||
r381 | dev_tools_tools_command() { | |||
# src/tools_command.sh | ||||
container_name=dev-tools | ||||
r179 | ||||
docker ps -q --filter "name=$container_name" | grep -q . && echo $container_name found || echo $container_name not found | ||||
r381 | docker ps -q --filter "name=$container_name" | grep -q . && docker stop -t 120 $container_name && docker rm -fv $container_name | |||
if [[ -v WORKSPACE_HOME ]]; | ||||
then | ||||
DEFAULT_WORKSPACE_HOME=$WORKSPACE_HOME | ||||
else | ||||
echo "WORKSPACE_HOME env var is not set" | ||||
exit 1 | ||||
fi | ||||
echo "Using default WORKSPACE_HOME path: $DEFAULT_WORKSPACE_HOME" | ||||
r179 | ||||
eval " | ||||
r381 | WORKSPACE_HOME=$DEFAULT_WORKSPACE_HOME \ | |||
r179 | ./rcstack stack --env-file-path .custom/.dev.env rhodecode -f docker-compose-apps.dev.yaml \ | |||
r381 | run -e ENV_FILE= -e RC_ENV_FILE= -e RC_APP_TYPE=rhodecode_tools_bash \ | |||
--rm --use-aliases \ | ||||
--workdir=\"/home/rhodecode/rhodecode-tools-ce\" \ | ||||
--interactive --tty \ | ||||
--name=\"$container_name\" rhodecode bash /home/rhodecode/rhodecode-tools-ce/.dev/dev-env.sh" | ||||
r179 | ||||
} | ||||
# :command.function | ||||
dev_tools_dev_env_command() { | ||||
# src/dev_env_command.sh | ||||
eval " \ | ||||
./rcstack stack metrics up --detach statsd-exporter && \ | ||||
./rcstack stack services up --detach && \ | ||||
r225 | ./rcstack stack services up --detach httpbin && \ | |||
r249 | ./rcstack stack services up --detach ldap-server && \ | |||
r402 | ./rcstack stack rhodecode up --detach svn && \ | |||
r404 | ./rcstack stack rhodecode up --detach celery celery-beat && \ | |||
./rcstack stack rhodecode up --detach sshd && \ | ||||
r179 | ./rcstack status" | |||
} | ||||
# :command.function | ||||
dev_tools_prune_command() { | ||||
# src/prune_command.sh | ||||
docker container prune -f | ||||
docker image prune -f | ||||
docker builder prune -f | ||||
docker system df | ||||
} | ||||
# :command.function | ||||
dev_tools_prune_all_command() { | ||||
# src/prune_all_command.sh | ||||
docker container prune -f | ||||
docker image prune -f | ||||
docker builder prune -f | ||||
docker system prune -f | ||||
docker system df | ||||
} | ||||
# :command.function | ||||
r207 | dev_tools_cli_generate_pull_command() { | |||
# src/cli_generate_pull_command.sh | ||||
docker pull $bashly_image | ||||
} | ||||
# :command.function | ||||
r249 | dev_tools_cli_generate_help_command() { | |||
# src/cli_generate_help_command.sh | ||||
source_dir=/media/psf/Home/workspace/rcstack-cli-modules/dev-tools | ||||
target_dir=/media/psf/Home/workspace/rhodecode-docker/scripts/dev-tools | ||||
echo "To pull latest image:" | ||||
echo " docker pull $bashly_image" | ||||
echo "To run generation manually:" | ||||
echo " docker run --rm -it --user $(id -u):$(id -g) --volume "$source_dir:/app" --volume "$target_dir:/dest" -e BASHLY_TARGET_DIR=/dest $bashly_image generate" | ||||
echo "To upgrade builting scripts:" | ||||
echo " docker run --rm -it --user $(id -u):$(id -g) --volume "$source_dir:/app" --volume "$target_dir:/dest" -e BASHLY_TARGET_DIR=/dest $bashly_image generate --upgrade" | ||||
#bashly generate --upgrade | ||||
# bashly add completions_script && source ./completions.bash | ||||
#alias bashly='docker run --rm -it --user $(id -u):$(id -g) --volume "$PWD:/app" dannyben/bashly:edge' | ||||
} | ||||
# :command.function | ||||
r314 | dev_tools_stack_cli_version_command() { | |||
# src/stack_cli_version_command.sh | ||||
version=${args[version]} | ||||
version_file=$(pwd)/VERSION | ||||
yaml_file=$(pwd)/scripts/rcstack/src/bashly.yml | ||||
echo "Setting $version to $version_file" | ||||
echo -n $version > $version_file | ||||
echo "Setting $version to $yaml_file" | ||||
sed -i -E "s/version:.+/version: $version/" $yaml_file | ||||
} | ||||
# :command.function | ||||
r375 | dev_tools_cli_generate_rc_command() { | |||
# src/cli_generate_rc_command.sh | ||||
r225 | one_time=${args[--one-time]} | |||
r179 | ||||
r207 | echo "Using scripts/scripts/rcstack/bashly.yaml @ $bashly_image" | |||
source_dir=/media/psf/Home/workspace/rcstack-cli-modules/rcstack | ||||
target_dir=/media/psf/Home/workspace/rhodecode-docker/scripts/rcstack | ||||
r225 | ||||
if [[ $one_time ]]; then | ||||
r250 | docker run --rm -it --user $(id -u):$(id -g) --volume "$source_dir:/app" --volume "$target_dir:/dest" -e BASHLY_TARGET_DIR=/dest $bashly_image generate --upgrade | |||
r225 | else | |||
docker run --rm -it --user $(id -u):$(id -g) --volume "$source_dir:/app" --volume "$target_dir:/dest" -e BASHLY_TARGET_DIR=/dest $bashly_image generate --watch | ||||
fi | ||||
r179 | ||||
} | ||||
# :command.function | ||||
r375 | dev_tools_cli_generate_dev_command() { | |||
# src/cli_generate_dev_command.sh | ||||
r225 | one_time=${args[--one-time]} | |||
r207 | echo "Using scripts/dev-tools/bashly.yaml @ $bashly_image" | |||
source_dir=/media/psf/Home/workspace/rcstack-cli-modules/dev-tools | ||||
target_dir=/media/psf/Home/workspace/rhodecode-docker/scripts/dev-tools | ||||
r225 | ||||
if [[ $one_time ]]; then | ||||
r250 | docker run --rm -it --user $(id -u):$(id -g) --volume "$source_dir:/app" --volume "$target_dir:/dest" -e BASHLY_TARGET_DIR=/dest $bashly_image generate --upgrade | |||
r225 | else | |||
docker run --rm -it --user $(id -u):$(id -g) --volume "$source_dir:/app" --volume "$target_dir:/dest" -e BASHLY_TARGET_DIR=/dest $bashly_image generate --watch | ||||
fi | ||||
r179 | ||||
} | ||||
r375 | # :command.function | |||
dev_tools_get_build_artifacts_command() { | ||||
# src/get_build_artifacts_command.sh | ||||
DEBUG=${args[--debug]} | ||||
AUTH=${args[--auth]} | ||||
INSTALLER_URL=${args[--installer-url]} | ||||
MANIFEST_URL=${args[--manifest-url]} | ||||
RC_VERSION=${args[--version-name]} | ||||
VER=$RC_VERSION | ||||
CACHE_DIR=$PWD/.cache | ||||
VER_REGEX="$VER+x86_64" | ||||
if [[ $VER == "" ]]; then | ||||
msg="Version is empty, please set --version-name correctly" | ||||
echo "$(red $msg)" | ||||
exit 1 | ||||
fi | ||||
echo "Downloading Artifacts for version: $VER" | ||||
mkdir -p $CACHE_DIR | ||||
echo "1/4 Checking available downloads from MANIFEST file" | ||||
ARTS=$(curl -s $AUTH $MANIFEST_URL | grep --ignore-case "$VER_REGEX" | cut -d ' ' -f 2) | ||||
if [[ $DEBUG ]]; then | ||||
echo "DEBUG START" | ||||
curl -s $AUTH $MANIFEST_URL | grep --ignore-case "$VER_REGEX" || echo "no regex match" | ||||
curl -s $AUTH $MANIFEST_URL | grep --ignore-case "$VER_REGEX" | cut -d ' ' -f 2 | ||||
echo "Found following artifacts:" | ||||
echo $ARTS | ||||
echo "DEBUG END" | ||||
fi | ||||
if [[ $ARTS == "" ]]; then | ||||
MSG="Failed to found any MANIFEST entries for version $VER make sure there exists release with that version or use --version to specify different version" | ||||
echo "$(red $MSG)" | ||||
exit 1 | ||||
fi | ||||
echo "2/4 Downloading locale-archive" | ||||
curl -L https://dls.rhodecode.com/assets/locale-archive -J -O | ||||
mv -v locale-archive "$CACHE_DIR" | ||||
# vcsserver/ce/ee | ||||
echo "3/4 Downloading installer artifacts" | ||||
for url in $ARTS; do | ||||
echo "Downloading $url with $AUTH" | ||||
curl $AUTH --fail-early -L ${url} -J -O | ||||
done | ||||
#for url in $(curl -s $MANIFEST_URL | grep --ignore-case -E 'control.+\+x86_64' | cut -d ' ' -f 2); do | ||||
# echo "Downloading $url" | ||||
# curl -L ${url} -J -O | ||||
#done | ||||
echo "4/4 Downloading installer from $INSTALLER_URL" | ||||
curl $AUTH -L $INSTALLER_URL -J -O | ||||
INSTALLER=$(ls -Art RhodeCode-installer-* | tail -n 1) | ||||
if [[ -n $INSTALLER ]]; then | ||||
chmod +x "${INSTALLER}" | ||||
fi | ||||
echo "Copying artifacts into $CACHE_DIR" | ||||
mv -v "${INSTALLER}" $CACHE_DIR | ||||
mv -v *.bz2 $CACHE_DIR | ||||
ls -lh $CACHE_DIR | ||||
} | ||||
# :command.function | ||||
dev_tools_build_installer_command() { | ||||
# src/build_installer_command.sh | ||||
rc_version=${args[--version-name]} | ||||
export RC_VERSION=$rc_version | ||||
eval "echo INSTALLER BASED BUILDING${RC_VERSION}" | ||||
RC_VERSION=$rc_version ./$RC_SCRIPT_NAME stack rhodecode build --progress plain rhodecode | ||||
} | ||||
# :command.function | ||||
dev_tools_get_build_source_command() { | ||||
# src/get_build_source_command.sh | ||||
DEBUG=${args[--debug]} | ||||
AUTH_TOKEN=${args[--auth-token]} | ||||
SERVER_URL=${args[--server-url]} | ||||
revision=${args[--revision]} | ||||
SOURCE_DIR=$PWD/.source | ||||
RHODECODE_VCS_HASH=$revision | ||||
RHODECODE_CE_HASH=$revision | ||||
RHODECODE_EE_HASH=$revision | ||||
# download sources | ||||
echo "** download rhodecode source for build from $SERVER_URL using '$revision' hash **" | ||||
mkdir -p $SOURCE_DIR | ||||
echo "getting $SERVER_URL/rhodecode-vcsserver/archive/$RHODECODE_VCS_HASH.tgz" | ||||
curl --fail --header "X-Rc-Auth-Token: $AUTH_TOKEN" -L $SERVER_URL/rhodecode-vcsserver/archive/$RHODECODE_VCS_HASH.tgz?with_hash=0 | tar -xz -C $SOURCE_DIR | ||||
echo "getting $SERVER_URL/rhodecode-enterprise-ce/archive/$RHODECODE_CE_HASH.tgz" | ||||
curl --fail --header "X-Rc-Auth-Token: $AUTH_TOKEN" -L $SERVER_URL/rhodecode-enterprise-ce/archive/$RHODECODE_CE_HASH.tgz?with_hash=0 | tar -xz -C $SOURCE_DIR | ||||
echo "getting $SERVER_URL/rhodecode-enterprise-ee/archive/$RHODECODE_EE_HASH.tgz" | ||||
curl --fail --header "X-Rc-Auth-Token: $AUTH_TOKEN" -L $SERVER_URL/rhodecode-enterprise-ee/archive/$RHODECODE_EE_HASH.tgz?with_hash=0 | tar -xz -C $SOURCE_DIR | ||||
rm -rf $SOURCE_DIR/rhodecode-vcsserver && \ | ||||
mv $SOURCE_DIR/*rhodecode-vcsserver-* $SOURCE_DIR/rhodecode-vcsserver | ||||
rm -rf $SOURCE_DIR/rhodecode-vcsserver/.hg | ||||
rm -rf $SOURCE_DIR/rhodecode-enterprise-ce && \ | ||||
mv $SOURCE_DIR/*rhodecode-enterprise-ce-* $SOURCE_DIR/rhodecode-enterprise-ce | ||||
rm -rf $SOURCE_DIR/rhodecode-enterprise-ce/.hg | ||||
rm -rf $SOURCE_DIR/rhodecode-enterprise-ee && \ | ||||
mv $SOURCE_DIR/*rhodecode-enterprise-ee-* $SOURCE_DIR/rhodecode-enterprise-ee | ||||
rm -rf $SOURCE_DIR/rhodecode-enterprise-ee/.hg | ||||
echo "downloading sources done to $SOURCE_DIR, directory now consists:" | ||||
ls -l $SOURCE_DIR | ||||
echo "" | ||||
date_formatted=$(date +%Y.%m.%d.1) | ||||
echo "to create source based build run:" | ||||
echo " ./$RC_SCRIPT_NAME build-source --version-name 4.28.0.$date_formatted --tag beta" | ||||
echo " ./$RC_SCRIPT_NAME build-source --version-name 5.0.0.$date_formatted --tag beta" | ||||
} | ||||
# :command.function | ||||
dev_tools_build_source_command() { | ||||
# src/build_source_command.sh | ||||
rc_version=${args[--version-name]} | ||||
source_build_yaml=${args[--source-build-yaml]} | ||||
eval "tags_data=(${args[--tag]})" | ||||
export RC_VERSION=$rc_version | ||||
export RC_EDITION=ee | ||||
VCS_SHA=$(cat .source/rhodecode-vcsserver/.archival.txt | grep commit_id | cut -d ":" -f 2 | cut -c 1-6) | ||||
CE_SHA=$(cat .source/rhodecode-enterprise-ce/.archival.txt | grep commit_id | cut -d ":" -f 2 | cut -c 1-6) | ||||
EE_SHA=$(cat .source/rhodecode-enterprise-ee/.archival.txt | grep commit_id | cut -d ":" -f 2 | cut -c 1-6) | ||||
echo "build_source: SOURCE BASED BUILDING: $rc_version @ vcs:$VCS_SHA ce:$CE_SHA ee:$EE_SHA" | ||||
echo "build_source: tags:" ${tags_data[@]} | ||||
echo "" | ||||
RC_SCRIPT_NAME=rcstack | ||||
DOCKER_SCAN_SUGGEST=false RC_VERSION=$rc_version \ | ||||
./$RC_SCRIPT_NAME stack rhodecode -f $source_build_yaml \ | ||||
--progress plain \ | ||||
build \ | ||||
--build-arg VCS_SHA=$VCS_SHA \ | ||||
--build-arg CE_SHA=$CE_SHA \ | ||||
--build-arg EE_SHA=$EE_SHA \ | ||||
rhodecode | ||||
# now tag the ee to ce | ||||
docker tag rhodecode/rhodecode-ee:$rc_version rhodecode/rhodecode-ce:$rc_version | ||||
# apply the tags | ||||
for tag in "${tags_data[@]}"; do | ||||
echo "build_source: creating tag:$tag" | ||||
docker tag rhodecode/rhodecode-ee:$rc_version rhodecode/rhodecode-ee:$tag | ||||
docker tag rhodecode/rhodecode-ee:$rc_version rhodecode/rhodecode-ce:$tag | ||||
done | ||||
echo "build_source: consider setting release version using" | ||||
echo " ./$RC_SCRIPT_NAME cli set-runtime-image $rc_version" | ||||
echo "build_source: push this image using" | ||||
echo " docker push rhodecode/rhodecode-ee:$rc_version" | ||||
echo " docker push rhodecode/rhodecode-ce:$rc_version" | ||||
for tag in "${tags_data[@]}"; do | ||||
echo " docker push rhodecode/rhodecode-ee:$tag" | ||||
echo " docker push rhodecode/rhodecode-ce:$tag" | ||||
done | ||||
} | ||||
r179 | # :command.parse_requirements | |||
parse_requirements() { | ||||
# :command.fixed_flags_filter | ||||
while [[ $# -gt 0 ]]; do | ||||
case "${1:-}" in | ||||
--version | -v) | ||||
version_command | ||||
exit | ||||
;; | ||||
--help | -h) | ||||
long_usage=yes | ||||
dev_tools_usage | ||||
exit | ||||
;; | ||||
*) | ||||
break | ||||
;; | ||||
esac | ||||
done | ||||
# :command.command_filter | ||||
action=${1:-} | ||||
case $action in | ||||
-*) ;; | ||||
vcs | v) | ||||
action="vcs" | ||||
shift | ||||
dev_tools_vcs_parse_requirements "$@" | ||||
shift $# | ||||
;; | ||||
ee | e) | ||||
action="ee" | ||||
shift | ||||
dev_tools_ee_parse_requirements "$@" | ||||
shift $# | ||||
;; | ||||
ce | c) | ||||
action="ce" | ||||
shift | ||||
dev_tools_ce_parse_requirements "$@" | ||||
shift $# | ||||
;; | ||||
r381 | celery) | |||
action="celery" | ||||
r211 | shift | |||
r381 | dev_tools_celery_parse_requirements "$@" | |||
r211 | shift $# | |||
;; | ||||
r400 | celeryd) | |||
action="celeryd" | ||||
shift | ||||
dev_tools_celeryd_parse_requirements "$@" | ||||
shift $# | ||||
;; | ||||
r403 | ssh) | |||
action="ssh" | ||||
shift | ||||
dev_tools_ssh_parse_requirements "$@" | ||||
shift $# | ||||
;; | ||||
r381 | sshd) | |||
action="sshd" | ||||
r179 | shift | |||
r381 | dev_tools_sshd_parse_requirements "$@" | |||
shift $# | ||||
;; | ||||
r408 | svn) | |||
action="svn" | ||||
shift | ||||
dev_tools_svn_parse_requirements "$@" | ||||
shift $# | ||||
;; | ||||
svnd) | ||||
action="svnd" | ||||
shift | ||||
dev_tools_svnd_parse_requirements "$@" | ||||
shift $# | ||||
;; | ||||
r381 | tools | t) | |||
action="tools" | ||||
shift | ||||
dev_tools_tools_parse_requirements "$@" | ||||
r179 | shift $# | |||
;; | ||||
dev-env) | ||||
action="dev-env" | ||||
shift | ||||
dev_tools_dev_env_parse_requirements "$@" | ||||
shift $# | ||||
;; | ||||
prune) | ||||
action="prune" | ||||
shift | ||||
dev_tools_prune_parse_requirements "$@" | ||||
shift $# | ||||
;; | ||||
prune-all) | ||||
action="prune-all" | ||||
shift | ||||
dev_tools_prune_all_parse_requirements "$@" | ||||
shift $# | ||||
;; | ||||
r207 | cli-generate-pull) | |||
action="cli-generate-pull" | ||||
shift | ||||
dev_tools_cli_generate_pull_parse_requirements "$@" | ||||
shift $# | ||||
;; | ||||
r249 | cli-generate-help) | |||
action="cli-generate-help" | ||||
shift | ||||
dev_tools_cli_generate_help_parse_requirements "$@" | ||||
shift $# | ||||
;; | ||||
r314 | stack-cli-version) | |||
action="stack-cli-version" | ||||
shift | ||||
dev_tools_stack_cli_version_parse_requirements "$@" | ||||
shift $# | ||||
;; | ||||
r375 | cli-generate-rc) | |||
action="cli-generate-rc" | ||||
shift | ||||
dev_tools_cli_generate_rc_parse_requirements "$@" | ||||
shift $# | ||||
;; | ||||
cli-generate-dev) | ||||
action="cli-generate-dev" | ||||
shift | ||||
dev_tools_cli_generate_dev_parse_requirements "$@" | ||||
shift $# | ||||
;; | ||||
get-build-artifacts) | ||||
action="get-build-artifacts" | ||||
r179 | shift | |||
r375 | dev_tools_get_build_artifacts_parse_requirements "$@" | |||
r179 | shift $# | |||
;; | ||||
r375 | build-installer) | |||
action="build-installer" | ||||
r179 | shift | |||
r375 | dev_tools_build_installer_parse_requirements "$@" | |||
shift $# | ||||
;; | ||||
get-build-source) | ||||
action="get-build-source" | ||||
shift | ||||
dev_tools_get_build_source_parse_requirements "$@" | ||||
shift $# | ||||
;; | ||||
build-source) | ||||
action="build-source" | ||||
shift | ||||
dev_tools_build_source_parse_requirements "$@" | ||||
r179 | shift $# | |||
;; | ||||
# :command.command_fallback | ||||
"") | ||||
dev_tools_usage >&2 | ||||
exit 1 | ||||
;; | ||||
*) | ||||
printf "invalid command: %s\n" "$action" >&2 | ||||
exit 1 | ||||
;; | ||||
esac | ||||
# :command.parse_requirements_while | ||||
while [[ $# -gt 0 ]]; do | ||||
key="$1" | ||||
case "$key" in | ||||
-?*) | ||||
printf "invalid option: %s\n" "$key" >&2 | ||||
exit 1 | ||||
;; | ||||
*) | ||||
# :command.parse_requirements_case | ||||
# :command.parse_requirements_case_simple | ||||
printf "invalid argument: %s\n" "$key" >&2 | ||||
exit 1 | ||||
;; | ||||
esac | ||||
done | ||||
} | ||||
# :command.parse_requirements | ||||
dev_tools_vcs_parse_requirements() { | ||||
# :command.fixed_flags_filter | ||||
while [[ $# -gt 0 ]]; do | ||||
case "${1:-}" in | ||||
--help | -h) | ||||
long_usage=yes | ||||
dev_tools_vcs_usage | ||||
exit | ||||
;; | ||||
*) | ||||
break | ||||
;; | ||||
esac | ||||
done | ||||
# :command.command_filter | ||||
action="vcs" | ||||
# :command.parse_requirements_while | ||||
while [[ $# -gt 0 ]]; do | ||||
key="$1" | ||||
case "$key" in | ||||
-?*) | ||||
printf "invalid option: %s\n" "$key" >&2 | ||||
exit 1 | ||||
;; | ||||
*) | ||||
# :command.parse_requirements_case | ||||
# :command.parse_requirements_case_simple | ||||
printf "invalid argument: %s\n" "$key" >&2 | ||||
exit 1 | ||||
;; | ||||
esac | ||||
done | ||||
} | ||||
# :command.parse_requirements | ||||
dev_tools_ee_parse_requirements() { | ||||
# :command.fixed_flags_filter | ||||
while [[ $# -gt 0 ]]; do | ||||
case "${1:-}" in | ||||
--help | -h) | ||||
long_usage=yes | ||||
dev_tools_ee_usage | ||||
exit | ||||
;; | ||||
*) | ||||
break | ||||
;; | ||||
esac | ||||
done | ||||
# :command.command_filter | ||||
action="ee" | ||||
# :command.parse_requirements_while | ||||
while [[ $# -gt 0 ]]; do | ||||
key="$1" | ||||
case "$key" in | ||||
-?*) | ||||
printf "invalid option: %s\n" "$key" >&2 | ||||
exit 1 | ||||
;; | ||||
*) | ||||
# :command.parse_requirements_case | ||||
# :command.parse_requirements_case_simple | ||||
printf "invalid argument: %s\n" "$key" >&2 | ||||
exit 1 | ||||
;; | ||||
esac | ||||
done | ||||
} | ||||
# :command.parse_requirements | ||||
dev_tools_ce_parse_requirements() { | ||||
# :command.fixed_flags_filter | ||||
while [[ $# -gt 0 ]]; do | ||||
case "${1:-}" in | ||||
--help | -h) | ||||
long_usage=yes | ||||
dev_tools_ce_usage | ||||
exit | ||||
;; | ||||
*) | ||||
break | ||||
;; | ||||
esac | ||||
done | ||||
# :command.command_filter | ||||
action="ce" | ||||
# :command.parse_requirements_while | ||||
while [[ $# -gt 0 ]]; do | ||||
key="$1" | ||||
case "$key" in | ||||
-?*) | ||||
printf "invalid option: %s\n" "$key" >&2 | ||||
exit 1 | ||||
;; | ||||
*) | ||||
# :command.parse_requirements_case | ||||
# :command.parse_requirements_case_simple | ||||
printf "invalid argument: %s\n" "$key" >&2 | ||||
exit 1 | ||||
;; | ||||
esac | ||||
done | ||||
} | ||||
# :command.parse_requirements | ||||
r408 | dev_tools_celery_parse_requirements() { | |||
r342 | # :command.fixed_flags_filter | |||
while [[ $# -gt 0 ]]; do | ||||
case "${1:-}" in | ||||
--help | -h) | ||||
long_usage=yes | ||||
r408 | dev_tools_celery_usage | |||
r342 | exit | |||
;; | ||||
*) | ||||
break | ||||
;; | ||||
esac | ||||
done | ||||
# :command.command_filter | ||||
r408 | action="celery" | |||
r342 | ||||
# :command.parse_requirements_while | ||||
while [[ $# -gt 0 ]]; do | ||||
key="$1" | ||||
case "$key" in | ||||
r408 | # :flag.case | |||
--workdir) | ||||
# :flag.case_arg | ||||
if [[ -n ${2+x} ]]; then | ||||
args['--workdir']="$2" | ||||
shift | ||||
shift | ||||
else | ||||
printf "%s\n" "--workdir requires an argument: --workdir WORKDIR" >&2 | ||||
exit 1 | ||||
fi | ||||
;; | ||||
# :flag.case | ||||
--cmd) | ||||
# :flag.case_arg | ||||
if [[ -n ${2+x} ]]; then | ||||
args['--cmd']="$2" | ||||
shift | ||||
shift | ||||
else | ||||
printf "%s\n" "--cmd requires an argument: --cmd CMD" >&2 | ||||
exit 1 | ||||
fi | ||||
;; | ||||
r342 | ||||
-?*) | ||||
printf "invalid option: %s\n" "$key" >&2 | ||||
exit 1 | ||||
;; | ||||
*) | ||||
# :command.parse_requirements_case | ||||
# :command.parse_requirements_case_simple | ||||
printf "invalid argument: %s\n" "$key" >&2 | ||||
exit 1 | ||||
;; | ||||
esac | ||||
done | ||||
r408 | # :command.default_assignments | |||
[[ -n ${args['--workdir']:-} ]] || args['--workdir']="/home/rhodecode/rhodecode-enterprise-ce" | ||||
[[ -n ${args['--cmd']:-} ]] || args['--cmd']=".dev-env/cmd-celery.sh" | ||||
r342 | } | |||
# :command.parse_requirements | ||||
r408 | dev_tools_celeryd_parse_requirements() { | |||
r211 | # :command.fixed_flags_filter | |||
while [[ $# -gt 0 ]]; do | ||||
case "${1:-}" in | ||||
--help | -h) | ||||
long_usage=yes | ||||
r408 | dev_tools_celeryd_usage | |||
r211 | exit | |||
;; | ||||
*) | ||||
break | ||||
;; | ||||
esac | ||||
done | ||||
# :command.command_filter | ||||
r408 | action="celeryd" | |||
r211 | ||||
# :command.parse_requirements_while | ||||
while [[ $# -gt 0 ]]; do | ||||
key="$1" | ||||
case "$key" in | ||||
r400 | # :flag.case | |||
--workdir) | ||||
# :flag.case_arg | ||||
if [[ -n ${2+x} ]]; then | ||||
args['--workdir']="$2" | ||||
shift | ||||
shift | ||||
else | ||||
printf "%s\n" "--workdir requires an argument: --workdir WORKDIR" >&2 | ||||
exit 1 | ||||
fi | ||||
;; | ||||
# :flag.case | ||||
--cmd) | ||||
# :flag.case_arg | ||||
if [[ -n ${2+x} ]]; then | ||||
args['--cmd']="$2" | ||||
shift | ||||
shift | ||||
else | ||||
printf "%s\n" "--cmd requires an argument: --cmd CMD" >&2 | ||||
exit 1 | ||||
fi | ||||
;; | ||||
r211 | ||||
-?*) | ||||
printf "invalid option: %s\n" "$key" >&2 | ||||
exit 1 | ||||
;; | ||||
*) | ||||
# :command.parse_requirements_case | ||||
# :command.parse_requirements_case_simple | ||||
printf "invalid argument: %s\n" "$key" >&2 | ||||
exit 1 | ||||
;; | ||||
esac | ||||
done | ||||
r400 | # :command.default_assignments | |||
[[ -n ${args['--workdir']:-} ]] || args['--workdir']="/home/rhodecode/rhodecode-enterprise-ce" | ||||
r408 | [[ -n ${args['--cmd']:-} ]] || args['--cmd']=".dev-env/cmd-celeryd.sh" | |||
r400 | ||||
} | ||||
# :command.parse_requirements | ||||
r408 | dev_tools_ssh_parse_requirements() { | |||
r400 | # :command.fixed_flags_filter | |||
while [[ $# -gt 0 ]]; do | ||||
case "${1:-}" in | ||||
--help | -h) | ||||
long_usage=yes | ||||
r408 | dev_tools_ssh_usage | |||
r400 | exit | |||
;; | ||||
*) | ||||
break | ||||
;; | ||||
esac | ||||
done | ||||
# :command.command_filter | ||||
r408 | action="ssh" | |||
r400 | ||||
# :command.parse_requirements_while | ||||
while [[ $# -gt 0 ]]; do | ||||
key="$1" | ||||
case "$key" in | ||||
# :flag.case | ||||
--workdir) | ||||
# :flag.case_arg | ||||
if [[ -n ${2+x} ]]; then | ||||
args['--workdir']="$2" | ||||
shift | ||||
shift | ||||
else | ||||
printf "%s\n" "--workdir requires an argument: --workdir WORKDIR" >&2 | ||||
exit 1 | ||||
fi | ||||
;; | ||||
# :flag.case | ||||
--cmd) | ||||
# :flag.case_arg | ||||
if [[ -n ${2+x} ]]; then | ||||
args['--cmd']="$2" | ||||
shift | ||||
shift | ||||
else | ||||
printf "%s\n" "--cmd requires an argument: --cmd CMD" >&2 | ||||
exit 1 | ||||
fi | ||||
;; | ||||
-?*) | ||||
printf "invalid option: %s\n" "$key" >&2 | ||||
exit 1 | ||||
;; | ||||
*) | ||||
# :command.parse_requirements_case | ||||
# :command.parse_requirements_case_simple | ||||
printf "invalid argument: %s\n" "$key" >&2 | ||||
exit 1 | ||||
;; | ||||
esac | ||||
done | ||||
# :command.default_assignments | ||||
[[ -n ${args['--workdir']:-} ]] || args['--workdir']="/home/rhodecode/rhodecode-enterprise-ce" | ||||
r408 | [[ -n ${args['--cmd']:-} ]] || args['--cmd']=".dev-env/cmd-ssh.sh" | |||
r403 | ||||
} | ||||
# :command.parse_requirements | ||||
r408 | dev_tools_sshd_parse_requirements() { | |||
r403 | # :command.fixed_flags_filter | |||
while [[ $# -gt 0 ]]; do | ||||
case "${1:-}" in | ||||
--help | -h) | ||||
long_usage=yes | ||||
r408 | dev_tools_sshd_usage | |||
r403 | exit | |||
;; | ||||
*) | ||||
break | ||||
;; | ||||
esac | ||||
done | ||||
# :command.command_filter | ||||
r408 | action="sshd" | |||
r403 | ||||
# :command.parse_requirements_while | ||||
while [[ $# -gt 0 ]]; do | ||||
key="$1" | ||||
case "$key" in | ||||
# :flag.case | ||||
--workdir) | ||||
# :flag.case_arg | ||||
if [[ -n ${2+x} ]]; then | ||||
args['--workdir']="$2" | ||||
shift | ||||
shift | ||||
else | ||||
printf "%s\n" "--workdir requires an argument: --workdir WORKDIR" >&2 | ||||
exit 1 | ||||
fi | ||||
;; | ||||
# :flag.case | ||||
--cmd) | ||||
# :flag.case_arg | ||||
if [[ -n ${2+x} ]]; then | ||||
args['--cmd']="$2" | ||||
shift | ||||
shift | ||||
else | ||||
printf "%s\n" "--cmd requires an argument: --cmd CMD" >&2 | ||||
exit 1 | ||||
fi | ||||
;; | ||||
-?*) | ||||
printf "invalid option: %s\n" "$key" >&2 | ||||
exit 1 | ||||
;; | ||||
*) | ||||
# :command.parse_requirements_case | ||||
# :command.parse_requirements_case_simple | ||||
printf "invalid argument: %s\n" "$key" >&2 | ||||
exit 1 | ||||
;; | ||||
esac | ||||
done | ||||
# :command.default_assignments | ||||
[[ -n ${args['--workdir']:-} ]] || args['--workdir']="/home/rhodecode/rhodecode-enterprise-ce" | ||||
r408 | [[ -n ${args['--cmd']:-} ]] || args['--cmd']=".dev-env/cmd-sshd.sh" | |||
r400 | ||||
r211 | } | |||
# :command.parse_requirements | ||||
r408 | dev_tools_svn_parse_requirements() { | |||
r179 | # :command.fixed_flags_filter | |||
while [[ $# -gt 0 ]]; do | ||||
case "${1:-}" in | ||||
--help | -h) | ||||
long_usage=yes | ||||
r408 | dev_tools_svn_usage | |||
r179 | exit | |||
;; | ||||
*) | ||||
break | ||||
;; | ||||
esac | ||||
done | ||||
# :command.command_filter | ||||
r408 | action="svn" | |||
r381 | ||||
# :command.parse_requirements_while | ||||
while [[ $# -gt 0 ]]; do | ||||
key="$1" | ||||
case "$key" in | ||||
r403 | # :flag.case | |||
--workdir) | ||||
# :flag.case_arg | ||||
if [[ -n ${2+x} ]]; then | ||||
args['--workdir']="$2" | ||||
shift | ||||
shift | ||||
else | ||||
printf "%s\n" "--workdir requires an argument: --workdir WORKDIR" >&2 | ||||
exit 1 | ||||
fi | ||||
;; | ||||
# :flag.case | ||||
--cmd) | ||||
# :flag.case_arg | ||||
if [[ -n ${2+x} ]]; then | ||||
args['--cmd']="$2" | ||||
shift | ||||
shift | ||||
else | ||||
printf "%s\n" "--cmd requires an argument: --cmd CMD" >&2 | ||||
exit 1 | ||||
fi | ||||
;; | ||||
r381 | ||||
-?*) | ||||
printf "invalid option: %s\n" "$key" >&2 | ||||
exit 1 | ||||
;; | ||||
*) | ||||
# :command.parse_requirements_case | ||||
# :command.parse_requirements_case_simple | ||||
printf "invalid argument: %s\n" "$key" >&2 | ||||
exit 1 | ||||
;; | ||||
esac | ||||
done | ||||
r403 | # :command.default_assignments | |||
[[ -n ${args['--workdir']:-} ]] || args['--workdir']="/home/rhodecode/rhodecode-enterprise-ce" | ||||
r408 | [[ -n ${args['--cmd']:-} ]] || args['--cmd']=".dev-env/cmd-svn.sh" | |||
} | ||||
# :command.parse_requirements | ||||
dev_tools_svnd_parse_requirements() { | ||||
# :command.fixed_flags_filter | ||||
while [[ $# -gt 0 ]]; do | ||||
case "${1:-}" in | ||||
--help | -h) | ||||
long_usage=yes | ||||
dev_tools_svnd_usage | ||||
exit | ||||
;; | ||||
*) | ||||
break | ||||
;; | ||||
esac | ||||
done | ||||
# :command.command_filter | ||||
action="svnd" | ||||
# :command.parse_requirements_while | ||||
while [[ $# -gt 0 ]]; do | ||||
key="$1" | ||||
case "$key" in | ||||
# :flag.case | ||||
--workdir) | ||||
# :flag.case_arg | ||||
if [[ -n ${2+x} ]]; then | ||||
args['--workdir']="$2" | ||||
shift | ||||
shift | ||||
else | ||||
printf "%s\n" "--workdir requires an argument: --workdir WORKDIR" >&2 | ||||
exit 1 | ||||
fi | ||||
;; | ||||
# :flag.case | ||||
--cmd) | ||||
# :flag.case_arg | ||||
if [[ -n ${2+x} ]]; then | ||||
args['--cmd']="$2" | ||||
shift | ||||
shift | ||||
else | ||||
printf "%s\n" "--cmd requires an argument: --cmd CMD" >&2 | ||||
exit 1 | ||||
fi | ||||
;; | ||||
-?*) | ||||
printf "invalid option: %s\n" "$key" >&2 | ||||
exit 1 | ||||
;; | ||||
*) | ||||
# :command.parse_requirements_case | ||||
# :command.parse_requirements_case_simple | ||||
printf "invalid argument: %s\n" "$key" >&2 | ||||
exit 1 | ||||
;; | ||||
esac | ||||
done | ||||
# :command.default_assignments | ||||
[[ -n ${args['--workdir']:-} ]] || args['--workdir']="/home/rhodecode/rhodecode-enterprise-ce" | ||||
[[ -n ${args['--cmd']:-} ]] || args['--cmd']=".dev-env/cmd-svnd.sh" | ||||
r403 | ||||
r381 | } | |||
# :command.parse_requirements | ||||
dev_tools_tools_parse_requirements() { | ||||
# :command.fixed_flags_filter | ||||
while [[ $# -gt 0 ]]; do | ||||
case "${1:-}" in | ||||
--help | -h) | ||||
long_usage=yes | ||||
dev_tools_tools_usage | ||||
exit | ||||
;; | ||||
*) | ||||
break | ||||
;; | ||||
esac | ||||
done | ||||
# :command.command_filter | ||||
action="tools" | ||||
r179 | ||||
# :command.parse_requirements_while | ||||
while [[ $# -gt 0 ]]; do | ||||
key="$1" | ||||
case "$key" in | ||||
-?*) | ||||
printf "invalid option: %s\n" "$key" >&2 | ||||
exit 1 | ||||
;; | ||||
*) | ||||
# :command.parse_requirements_case | ||||
# :command.parse_requirements_case_simple | ||||
printf "invalid argument: %s\n" "$key" >&2 | ||||
exit 1 | ||||
;; | ||||
esac | ||||
done | ||||
} | ||||
# :command.parse_requirements | ||||
dev_tools_dev_env_parse_requirements() { | ||||
# :command.fixed_flags_filter | ||||
while [[ $# -gt 0 ]]; do | ||||
case "${1:-}" in | ||||
--help | -h) | ||||
long_usage=yes | ||||
dev_tools_dev_env_usage | ||||
exit | ||||
;; | ||||
*) | ||||
break | ||||
;; | ||||
esac | ||||
done | ||||
# :command.command_filter | ||||
action="dev-env" | ||||
# :command.parse_requirements_while | ||||
while [[ $# -gt 0 ]]; do | ||||
key="$1" | ||||
case "$key" in | ||||
-?*) | ||||
printf "invalid option: %s\n" "$key" >&2 | ||||
exit 1 | ||||
;; | ||||
*) | ||||
# :command.parse_requirements_case | ||||
# :command.parse_requirements_case_simple | ||||
printf "invalid argument: %s\n" "$key" >&2 | ||||
exit 1 | ||||
;; | ||||
esac | ||||
done | ||||
} | ||||
# :command.parse_requirements | ||||
dev_tools_prune_parse_requirements() { | ||||
# :command.fixed_flags_filter | ||||
while [[ $# -gt 0 ]]; do | ||||
case "${1:-}" in | ||||
--help | -h) | ||||
long_usage=yes | ||||
dev_tools_prune_usage | ||||
exit | ||||
;; | ||||
*) | ||||
break | ||||
;; | ||||
esac | ||||
done | ||||
# :command.command_filter | ||||
action="prune" | ||||
# :command.parse_requirements_while | ||||
while [[ $# -gt 0 ]]; do | ||||
key="$1" | ||||
case "$key" in | ||||
-?*) | ||||
printf "invalid option: %s\n" "$key" >&2 | ||||
exit 1 | ||||
;; | ||||
*) | ||||
# :command.parse_requirements_case | ||||
# :command.parse_requirements_case_simple | ||||
printf "invalid argument: %s\n" "$key" >&2 | ||||
exit 1 | ||||
;; | ||||
esac | ||||
done | ||||
} | ||||
# :command.parse_requirements | ||||
dev_tools_prune_all_parse_requirements() { | ||||
# :command.fixed_flags_filter | ||||
while [[ $# -gt 0 ]]; do | ||||
case "${1:-}" in | ||||
--help | -h) | ||||
long_usage=yes | ||||
dev_tools_prune_all_usage | ||||
exit | ||||
;; | ||||
*) | ||||
break | ||||
;; | ||||
esac | ||||
done | ||||
# :command.command_filter | ||||
action="prune-all" | ||||
# :command.parse_requirements_while | ||||
while [[ $# -gt 0 ]]; do | ||||
key="$1" | ||||
case "$key" in | ||||
-?*) | ||||
printf "invalid option: %s\n" "$key" >&2 | ||||
exit 1 | ||||
;; | ||||
*) | ||||
# :command.parse_requirements_case | ||||
# :command.parse_requirements_case_simple | ||||
printf "invalid argument: %s\n" "$key" >&2 | ||||
exit 1 | ||||
;; | ||||
esac | ||||
done | ||||
} | ||||
# :command.parse_requirements | ||||
r207 | dev_tools_cli_generate_pull_parse_requirements() { | |||
# :command.fixed_flags_filter | ||||
while [[ $# -gt 0 ]]; do | ||||
case "${1:-}" in | ||||
--help | -h) | ||||
long_usage=yes | ||||
dev_tools_cli_generate_pull_usage | ||||
exit | ||||
;; | ||||
*) | ||||
break | ||||
;; | ||||
esac | ||||
done | ||||
# :command.command_filter | ||||
action="cli-generate-pull" | ||||
# :command.parse_requirements_while | ||||
while [[ $# -gt 0 ]]; do | ||||
key="$1" | ||||
case "$key" in | ||||
-?*) | ||||
printf "invalid option: %s\n" "$key" >&2 | ||||
exit 1 | ||||
;; | ||||
*) | ||||
# :command.parse_requirements_case | ||||
# :command.parse_requirements_case_simple | ||||
printf "invalid argument: %s\n" "$key" >&2 | ||||
exit 1 | ||||
;; | ||||
esac | ||||
done | ||||
} | ||||
# :command.parse_requirements | ||||
r249 | dev_tools_cli_generate_help_parse_requirements() { | |||
# :command.fixed_flags_filter | ||||
while [[ $# -gt 0 ]]; do | ||||
case "${1:-}" in | ||||
--help | -h) | ||||
long_usage=yes | ||||
dev_tools_cli_generate_help_usage | ||||
exit | ||||
;; | ||||
*) | ||||
break | ||||
;; | ||||
esac | ||||
done | ||||
# :command.command_filter | ||||
action="cli-generate-help" | ||||
# :command.parse_requirements_while | ||||
while [[ $# -gt 0 ]]; do | ||||
key="$1" | ||||
case "$key" in | ||||
-?*) | ||||
printf "invalid option: %s\n" "$key" >&2 | ||||
exit 1 | ||||
;; | ||||
*) | ||||
# :command.parse_requirements_case | ||||
# :command.parse_requirements_case_simple | ||||
printf "invalid argument: %s\n" "$key" >&2 | ||||
exit 1 | ||||
;; | ||||
esac | ||||
done | ||||
} | ||||
# :command.parse_requirements | ||||
r314 | dev_tools_stack_cli_version_parse_requirements() { | |||
# :command.fixed_flags_filter | ||||
while [[ $# -gt 0 ]]; do | ||||
case "${1:-}" in | ||||
--help | -h) | ||||
long_usage=yes | ||||
dev_tools_stack_cli_version_usage | ||||
exit | ||||
;; | ||||
*) | ||||
break | ||||
;; | ||||
esac | ||||
done | ||||
# :command.command_filter | ||||
action="stack-cli-version" | ||||
# :command.parse_requirements_while | ||||
while [[ $# -gt 0 ]]; do | ||||
key="$1" | ||||
case "$key" in | ||||
-?*) | ||||
printf "invalid option: %s\n" "$key" >&2 | ||||
exit 1 | ||||
;; | ||||
*) | ||||
# :command.parse_requirements_case | ||||
# :command.parse_requirements_case_simple | ||||
if [[ -z ${args['version']+x} ]]; then | ||||
args['version']=$1 | ||||
shift | ||||
else | ||||
printf "invalid argument: %s\n" "$key" >&2 | ||||
exit 1 | ||||
fi | ||||
;; | ||||
esac | ||||
done | ||||
# :command.required_args_filter | ||||
if [[ -z ${args['version']+x} ]]; then | ||||
printf "missing required argument: VERSION\nusage: dev-tools stack-cli-version VERSION\n" >&2 | ||||
exit 1 | ||||
fi | ||||
} | ||||
# :command.parse_requirements | ||||
r375 | dev_tools_cli_generate_rc_parse_requirements() { | |||
r179 | # :command.fixed_flags_filter | |||
while [[ $# -gt 0 ]]; do | ||||
case "${1:-}" in | ||||
--help | -h) | ||||
long_usage=yes | ||||
r375 | dev_tools_cli_generate_rc_usage | |||
r179 | exit | |||
;; | ||||
*) | ||||
break | ||||
;; | ||||
esac | ||||
done | ||||
# :command.command_filter | ||||
r375 | action="cli-generate-rc" | |||
r179 | ||||
# :command.parse_requirements_while | ||||
while [[ $# -gt 0 ]]; do | ||||
key="$1" | ||||
case "$key" in | ||||
r225 | # :flag.case | |||
--one-time | -o) | ||||
# :flag.case_no_arg | ||||
args['--one-time']=1 | ||||
shift | ||||
;; | ||||
r179 | ||||
-?*) | ||||
printf "invalid option: %s\n" "$key" >&2 | ||||
exit 1 | ||||
;; | ||||
*) | ||||
# :command.parse_requirements_case | ||||
# :command.parse_requirements_case_simple | ||||
printf "invalid argument: %s\n" "$key" >&2 | ||||
exit 1 | ||||
;; | ||||
esac | ||||
done | ||||
} | ||||
# :command.parse_requirements | ||||
r375 | dev_tools_cli_generate_dev_parse_requirements() { | |||
r179 | # :command.fixed_flags_filter | |||
while [[ $# -gt 0 ]]; do | ||||
case "${1:-}" in | ||||
--help | -h) | ||||
long_usage=yes | ||||
r375 | dev_tools_cli_generate_dev_usage | |||
r179 | exit | |||
;; | ||||
*) | ||||
break | ||||
;; | ||||
esac | ||||
done | ||||
# :command.command_filter | ||||
r375 | action="cli-generate-dev" | |||
r179 | ||||
# :command.parse_requirements_while | ||||
while [[ $# -gt 0 ]]; do | ||||
key="$1" | ||||
case "$key" in | ||||
r225 | # :flag.case | |||
--one-time | -o) | ||||
# :flag.case_no_arg | ||||
args['--one-time']=1 | ||||
shift | ||||
;; | ||||
r179 | ||||
-?*) | ||||
printf "invalid option: %s\n" "$key" >&2 | ||||
exit 1 | ||||
;; | ||||
*) | ||||
# :command.parse_requirements_case | ||||
# :command.parse_requirements_case_simple | ||||
printf "invalid argument: %s\n" "$key" >&2 | ||||
exit 1 | ||||
;; | ||||
esac | ||||
done | ||||
} | ||||
r375 | # :command.parse_requirements | |||
dev_tools_get_build_artifacts_parse_requirements() { | ||||
# :command.fixed_flags_filter | ||||
while [[ $# -gt 0 ]]; do | ||||
case "${1:-}" in | ||||
--help | -h) | ||||
long_usage=yes | ||||
dev_tools_get_build_artifacts_usage | ||||
exit | ||||
;; | ||||
*) | ||||
break | ||||
;; | ||||
esac | ||||
done | ||||
# :command.command_filter | ||||
action="get-build-artifacts" | ||||
# :command.parse_requirements_while | ||||
while [[ $# -gt 0 ]]; do | ||||
key="$1" | ||||
case "$key" in | ||||
# :flag.case | ||||
--auth) | ||||
# :flag.case_arg | ||||
if [[ -n ${2+x} ]]; then | ||||
args['--auth']="$2" | ||||
shift | ||||
shift | ||||
else | ||||
printf "%s\n" "--auth requires an argument: --auth AUTH" >&2 | ||||
exit 1 | ||||
fi | ||||
;; | ||||
# :flag.case | ||||
--installer-url) | ||||
# :flag.case_arg | ||||
if [[ -n ${2+x} ]]; then | ||||
args['--installer-url']="$2" | ||||
shift | ||||
shift | ||||
else | ||||
printf "%s\n" "--installer-url requires an argument: --installer-url INSTALLER_URL" >&2 | ||||
exit 1 | ||||
fi | ||||
;; | ||||
# :flag.case | ||||
--manifest-url) | ||||
# :flag.case_arg | ||||
if [[ -n ${2+x} ]]; then | ||||
args['--manifest-url']="$2" | ||||
shift | ||||
shift | ||||
else | ||||
printf "%s\n" "--manifest-url requires an argument: --manifest-url MANIFEST_URL" >&2 | ||||
exit 1 | ||||
fi | ||||
;; | ||||
# :flag.case | ||||
--version-name) | ||||
# :flag.case_arg | ||||
if [[ -n ${2+x} ]]; then | ||||
args['--version-name']="$2" | ||||
shift | ||||
shift | ||||
else | ||||
printf "%s\n" "--version-name requires an argument: --version-name VERSION_NAME" >&2 | ||||
exit 1 | ||||
fi | ||||
;; | ||||
-?*) | ||||
printf "invalid option: %s\n" "$key" >&2 | ||||
exit 1 | ||||
;; | ||||
*) | ||||
# :command.parse_requirements_case | ||||
# :command.parse_requirements_case_simple | ||||
printf "invalid argument: %s\n" "$key" >&2 | ||||
exit 1 | ||||
;; | ||||
esac | ||||
done | ||||
# :command.default_assignments | ||||
[[ -n ${args['--auth']:-} ]] || args['--auth']="" | ||||
[[ -n ${args['--installer-url']:-} ]] || args['--installer-url']="https://dls.rhodecode.com/dls/N2E2ZTY1NzA3NjYxNDA2NTc1NjI3MTcyNzA2MjcxNzIyZTcwNjI3YQ==/rhodecode-control/latest-linux-ee" | ||||
[[ -n ${args['--manifest-url']:-} ]] || args['--manifest-url']="https://dls.rhodecode.com/linux/MANIFEST" | ||||
[[ -n ${args['--version-name']:-} ]] || args['--version-name']="$RC_CLI_VERSION_NAME" | ||||
} | ||||
# :command.parse_requirements | ||||
dev_tools_build_installer_parse_requirements() { | ||||
# :command.fixed_flags_filter | ||||
while [[ $# -gt 0 ]]; do | ||||
case "${1:-}" in | ||||
--help | -h) | ||||
long_usage=yes | ||||
dev_tools_build_installer_usage | ||||
exit | ||||
;; | ||||
*) | ||||
break | ||||
;; | ||||
esac | ||||
done | ||||
# :command.command_filter | ||||
action="build-installer" | ||||
# :command.parse_requirements_while | ||||
while [[ $# -gt 0 ]]; do | ||||
key="$1" | ||||
case "$key" in | ||||
# :flag.case | ||||
--version-name) | ||||
# :flag.case_arg | ||||
if [[ -n ${2+x} ]]; then | ||||
args['--version-name']="$2" | ||||
shift | ||||
shift | ||||
else | ||||
printf "%s\n" "--version-name requires an argument: --version-name VERSION_NAME" >&2 | ||||
exit 1 | ||||
fi | ||||
;; | ||||
-?*) | ||||
printf "invalid option: %s\n" "$key" >&2 | ||||
exit 1 | ||||
;; | ||||
*) | ||||
# :command.parse_requirements_case | ||||
# :command.parse_requirements_case_simple | ||||
printf "invalid argument: %s\n" "$key" >&2 | ||||
exit 1 | ||||
;; | ||||
esac | ||||
done | ||||
# :command.default_assignments | ||||
[[ -n ${args['--version-name']:-} ]] || args['--version-name']="$RC_CLI_VERSION_NAME" | ||||
} | ||||
# :command.parse_requirements | ||||
dev_tools_get_build_source_parse_requirements() { | ||||
# :command.fixed_flags_filter | ||||
while [[ $# -gt 0 ]]; do | ||||
case "${1:-}" in | ||||
--help | -h) | ||||
long_usage=yes | ||||
dev_tools_get_build_source_usage | ||||
exit | ||||
;; | ||||
*) | ||||
break | ||||
;; | ||||
esac | ||||
done | ||||
# :command.dependencies_filter | ||||
if command -v curl >/dev/null 2>&1; then | ||||
deps['curl']="$(command -v curl | head -n1)" | ||||
else | ||||
printf "missing dependency: curl\n" >&2 | ||||
exit 1 | ||||
fi | ||||
if command -v tar >/dev/null 2>&1; then | ||||
deps['tar']="$(command -v tar | head -n1)" | ||||
else | ||||
printf "missing dependency: tar\n" >&2 | ||||
exit 1 | ||||
fi | ||||
# :command.command_filter | ||||
action="get-build-source" | ||||
# :command.parse_requirements_while | ||||
while [[ $# -gt 0 ]]; do | ||||
key="$1" | ||||
case "$key" in | ||||
# :flag.case | ||||
--revision) | ||||
# :flag.case_arg | ||||
if [[ -n ${2+x} ]]; then | ||||
args['--revision']="$2" | ||||
shift | ||||
shift | ||||
else | ||||
printf "%s\n" "--revision requires an argument: --revision REVISION" >&2 | ||||
exit 1 | ||||
fi | ||||
;; | ||||
# :flag.case | ||||
--auth-token) | ||||
# :flag.case_arg | ||||
if [[ -n ${2+x} ]]; then | ||||
args['--auth-token']="$2" | ||||
shift | ||||
shift | ||||
else | ||||
printf "%s\n" "--auth-token requires an argument: --auth-token AUTH_TOKEN" >&2 | ||||
exit 1 | ||||
fi | ||||
;; | ||||
# :flag.case | ||||
--server-url) | ||||
# :flag.case_arg | ||||
if [[ -n ${2+x} ]]; then | ||||
args['--server-url']="$2" | ||||
shift | ||||
shift | ||||
else | ||||
printf "%s\n" "--server-url requires an argument: --server-url SERVER_URL" >&2 | ||||
exit 1 | ||||
fi | ||||
;; | ||||
-?*) | ||||
printf "invalid option: %s\n" "$key" >&2 | ||||
exit 1 | ||||
;; | ||||
*) | ||||
# :command.parse_requirements_case | ||||
# :command.parse_requirements_case_simple | ||||
printf "invalid argument: %s\n" "$key" >&2 | ||||
exit 1 | ||||
;; | ||||
esac | ||||
done | ||||
# :command.default_assignments | ||||
[[ -n ${args['--revision']:-} ]] || args['--revision']="default" | ||||
[[ -n ${args['--server-url']:-} ]] || args['--server-url']="https://code.rhodecode.com" | ||||
} | ||||
# :command.parse_requirements | ||||
dev_tools_build_source_parse_requirements() { | ||||
# :command.fixed_flags_filter | ||||
while [[ $# -gt 0 ]]; do | ||||
case "${1:-}" in | ||||
--help | -h) | ||||
long_usage=yes | ||||
dev_tools_build_source_usage | ||||
exit | ||||
;; | ||||
*) | ||||
break | ||||
;; | ||||
esac | ||||
done | ||||
# :command.command_filter | ||||
action="build-source" | ||||
# :command.parse_requirements_while | ||||
while [[ $# -gt 0 ]]; do | ||||
key="$1" | ||||
case "$key" in | ||||
# :flag.case | ||||
--version-name) | ||||
# :flag.case_arg | ||||
if [[ -n ${2+x} ]]; then | ||||
args['--version-name']="$2" | ||||
shift | ||||
shift | ||||
else | ||||
printf "%s\n" "--version-name requires an argument: --version-name VERSION_NAME" >&2 | ||||
exit 1 | ||||
fi | ||||
;; | ||||
# :flag.case | ||||
--source-build-yaml) | ||||
# :flag.case_arg | ||||
if [[ -n ${2+x} ]]; then | ||||
args['--source-build-yaml']="$2" | ||||
shift | ||||
shift | ||||
else | ||||
printf "%s\n" "--source-build-yaml requires an argument: --source-build-yaml BUILD_SOURCE_YAML" >&2 | ||||
exit 1 | ||||
fi | ||||
;; | ||||
# :flag.case | ||||
--tag) | ||||
# :flag.case_arg | ||||
if [[ -n ${2+x} ]]; then | ||||
if [[ -z ${args['--tag']+x} ]]; then | ||||
args['--tag']="\"$2\"" | ||||
else | ||||
args['--tag']="${args[--tag]} \"$2\"" | ||||
fi | ||||
shift | ||||
shift | ||||
else | ||||
printf "%s\n" "--tag requires an argument: --tag TAG" >&2 | ||||
exit 1 | ||||
fi | ||||
;; | ||||
-?*) | ||||
printf "invalid option: %s\n" "$key" >&2 | ||||
exit 1 | ||||
;; | ||||
*) | ||||
# :command.parse_requirements_case | ||||
# :command.parse_requirements_case_simple | ||||
printf "invalid argument: %s\n" "$key" >&2 | ||||
exit 1 | ||||
;; | ||||
esac | ||||
done | ||||
# :command.default_assignments | ||||
[[ -n ${args['--version-name']:-} ]] || args['--version-name']="$RC_CLI_VERSION_NAME" | ||||
[[ -n ${args['--source-build-yaml']:-} ]] || args['--source-build-yaml']="build_yaml/docker-compose-apps.5.yaml" | ||||
} | ||||
r179 | # :command.initialize | |||
initialize() { | ||||
r375 | version="1.0.0" | |||
r179 | long_usage='' | |||
set -e | ||||
# src/initialize.sh | ||||
r269 | bashly_image="dannyben/bashly:1.0.8" | |||
r179 | } | |||
# :command.run | ||||
run() { | ||||
declare -A args=() | ||||
r207 | declare -A deps=() | |||
r179 | declare -a other_args=() | |||
declare -a input=() | ||||
normalize_input "$@" | ||||
parse_requirements "${input[@]}" | ||||
case "$action" in | ||||
r207 | "vcs") dev_tools_vcs_command ;; | |||
"ee") dev_tools_ee_command ;; | ||||
"ce") dev_tools_ce_command ;; | ||||
"celery") dev_tools_celery_command ;; | ||||
r400 | "celeryd") dev_tools_celeryd_command ;; | |||
r403 | "ssh") dev_tools_ssh_command ;; | |||
r381 | "sshd") dev_tools_sshd_command ;; | |||
r408 | "svn") dev_tools_svn_command ;; | |||
"svnd") dev_tools_svnd_command ;; | ||||
r381 | "tools") dev_tools_tools_command ;; | |||
r207 | "dev-env") dev_tools_dev_env_command ;; | |||
"prune") dev_tools_prune_command ;; | ||||
"prune-all") dev_tools_prune_all_command ;; | ||||
"cli-generate-pull") dev_tools_cli_generate_pull_command ;; | ||||
r249 | "cli-generate-help") dev_tools_cli_generate_help_command ;; | |||
r314 | "stack-cli-version") dev_tools_stack_cli_version_command ;; | |||
r375 | "cli-generate-rc") dev_tools_cli_generate_rc_command ;; | |||
"cli-generate-dev") dev_tools_cli_generate_dev_command ;; | ||||
"get-build-artifacts") dev_tools_get_build_artifacts_command ;; | ||||
"build-installer") dev_tools_build_installer_command ;; | ||||
"get-build-source") dev_tools_get_build_source_command ;; | ||||
"build-source") dev_tools_build_source_command ;; | ||||
r179 | esac | |||
} | ||||
initialize | ||||
run "$@" | ||||