1 Star 0 Fork 0

ShiningRay/dokku-mysql

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
.devcontainer
.github
bin
docs
subcommands
app-links
backup
backup-auth
backup-deauth
backup-schedule
backup-schedule-cat
backup-set-encryption
backup-unschedule
backup-unset-encryption
clone
connect
create
destroy
enter
exists
export
expose
import
info
link
linked
links
list
logs
pause
promote
restart
set
start
stop
unexpose
unlink
upgrade
tests
.editorconfig
.gitignore
Dockerfile
LICENSE.txt
Makefile
README.md
Vagrantfile
commands
common-functions
config
functions
help-functions
install
plugin.toml
post-app-clone-setup
post-app-rename-setup
pre-delete
pre-restore
pre-start
service-list
update
克隆/下载
upgrade 3.28 KB
一键复制 编辑 原始数据 按行查看 历史
Jose Diaz-Gonzalez 提交于 2年前 . chore: fix typo
#!/usr/bin/env bash
source "$(dirname "$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)")/config"
set -eo pipefail
[[ $DOKKU_TRACE ]] && set -x
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
source "$(dirname "$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)")/functions"
source "$PLUGIN_AVAILABLE_PATH/ps/functions"
service-upgrade-cmd() {
#E you can upgrade an existing service to a new image or image-version
#E dokku $PLUGIN_COMMAND_PREFIX:upgrade lollipop
#A service, service to run command against
#F -c|--config-options "--args --go=here", extra arguments to pass to the container create command
#F -C|--custom-env "USER=alpha;HOST=beta", semi-colon delimited environment variables to start the service with
#F -i|--image IMAGE, the image name to start the service with
#F -I|--image-version IMAGE_VERSION, the image version to start the service with
#F -N|--initial-network INITIAL_NETWORK, the initial network to attach the service to
#F -P|--post-create-network NETWORKS, a comma-separated list of networks to attach the service container to after service creation
#F -R|--restart-apps "true", whether or not to force an app restart (default: false)
#F -S|--post-start-network NETWORKS, a comma-separated list of networks to attach the service container to after service start
#F -s|--shm-size SHM_SIZE, override shared memory size for $PLUGIN_COMMAND_PREFIX docker container
declare desc="upgrade service <service> to the specified versions"
local cmd="$PLUGIN_COMMAND_PREFIX:upgrade" argv=("$@")
[[ ${argv[0]} == "$cmd" ]] && shift 1
declare SERVICE="$1" UPGRADE_FLAGS_LIST=("${@:2}")
[[ -z "$SERVICE" ]] && dokku_log_fail "Please specify a valid name for the service"
verify_service_name "$SERVICE"
local SERVICE_ROOT="$PLUGIN_DATA_ROOT/$SERVICE"
service_parse_args "${@:2}"
if ! service_image_exists "$SERVICE" "$PLUGIN_IMAGE" "$PLUGIN_IMAGE_VERSION"; then
if [[ "$PLUGIN_DISABLE_PULL" == "true" ]]; then
dokku_log_warn "${PLUGIN_DISABLE_PULL_VARIABLE} environment variable detected. Not running pull command." 1>&2
dokku_log_warn " docker image pull ${IMAGE}" 1>&2
dokku_log_warn "$PLUGIN_SERVICE service $SERVICE upgrade failed"
exit 1
fi
"$DOCKER_BIN" image pull "$PLUGIN_IMAGE:$PLUGIN_IMAGE_VERSION" || dokku_log_fail "$PLUGIN_SERVICE image $PLUGIN_IMAGE:$PLUGIN_IMAGE_VERSION pull failed"
fi
local NEW_PLUGIN_IMAGE_TAG="$PLUGIN_IMAGE:$PLUGIN_IMAGE_VERSION"
if [[ "$(service_version "$SERVICE")" == "$NEW_PLUGIN_IMAGE_TAG" ]]; then
dokku_log_info1 "Service $SERVICE already running $NEW_PLUGIN_IMAGE_TAG"
return
fi
service_commit_config "$SERVICE"
dokku_log_info2 "Upgrading $SERVICE to $NEW_PLUGIN_IMAGE_TAG"
if [[ "$SERVICE_RESTART_APPS" == "true" ]]; then
dokku_log_info2 "Stopping all linked services"
for app in $(service_linked_apps "$SERVICE"); do
[[ "$app" == "-" ]] && continue
ps_stop "$app"
done
fi
dokku_log_info2 "Stopping $SERVICE"
service_container_rm "$SERVICE"
service_start "$SERVICE" "${@:2}"
if [[ "$SERVICE_RESTART_APPS" == "true" ]]; then
dokku_log_info2 "Starting all linked services"
for app in $(service_linked_apps "$SERVICE"); do
[[ "$app" == "-" ]] && continue
ps_start "$app"
done
fi
dokku_log_info2 "Done"
}
service-upgrade-cmd "$@"
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/ShiningRay/dokku-mysql.git
git@gitee.com:ShiningRay/dokku-mysql.git
ShiningRay
dokku-mysql
dokku-mysql
master

搜索帮助