mirror of
https://github.com/frappe/frappe_docker.git
synced 2026-06-22 15:55:09 +00:00
fix(easy-docker): align app branch defaults with catalog
This commit is contained in:
parent
8e56cbb1f9
commit
cbe5c7042c
3 changed files with 22 additions and 17 deletions
|
|
@ -1,7 +1,7 @@
|
||||||
# id label repo default_branch branches_csv
|
# id label repo default_branch branches_csv
|
||||||
erpnext ERPNext https://github.com/frappe/erpnext develop version-15,version-16,develop
|
erpnext ERPNext https://github.com/frappe/erpnext develop develop,version-15,version-16
|
||||||
crm CRM https://github.com/frappe/crm develop develop,version-16,version-15
|
crm CRM https://github.com/frappe/crm develop develop,main
|
||||||
hrms HRMS https://github.com/frappe/hrms develop develop,version-16,version-15
|
hrms HRMS https://github.com/frappe/hrms develop develop,version-16,version-15
|
||||||
lms LMS https://github.com/frappe/lms develop develop,version-16,version-15
|
lms LMS https://github.com/frappe/lms develop develop,main
|
||||||
helpdesk Helpdesk https://github.com/frappe/helpdesk develop develop,version-16,version-15
|
helpdesk Helpdesk https://github.com/frappe/helpdesk develop develop,main
|
||||||
drive Drive https://github.com/frappe/drive develop develop,version-16,version-15
|
drive Drive https://github.com/frappe/drive develop develop
|
||||||
|
|
|
||||||
|
|
|
@ -689,6 +689,7 @@ build_stack_apps_json_content_from_metadata_apps() {
|
||||||
local custom_apps_lines=""
|
local custom_apps_lines=""
|
||||||
local predefined_branch=""
|
local predefined_branch=""
|
||||||
local preset_branch=""
|
local preset_branch=""
|
||||||
|
local catalog_default_branch=""
|
||||||
local app=""
|
local app=""
|
||||||
local line=""
|
local line=""
|
||||||
local repo=""
|
local repo=""
|
||||||
|
|
@ -721,9 +722,15 @@ build_stack_apps_json_content_from_metadata_apps() {
|
||||||
fi
|
fi
|
||||||
|
|
||||||
predefined_branch="$(get_metadata_apps_predefined_branch_for_id "${metadata_path}" "${app}" || true)"
|
predefined_branch="$(get_metadata_apps_predefined_branch_for_id "${metadata_path}" "${app}" || true)"
|
||||||
|
|
||||||
if [ -z "${predefined_branch}" ]; then
|
if [ -z "${predefined_branch}" ]; then
|
||||||
|
catalog_default_branch="$(get_predefined_app_default_branch_by_id "${app}" || true)"
|
||||||
|
if [ -n "${catalog_default_branch}" ]; then
|
||||||
|
predefined_branch="${catalog_default_branch}"
|
||||||
|
else
|
||||||
predefined_branch="${preset_branch}"
|
predefined_branch="${preset_branch}"
|
||||||
fi
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
escaped_url="$(json_escape_string "${url}")"
|
escaped_url="$(json_escape_string "${url}")"
|
||||||
escaped_branch="$(json_escape_string "${predefined_branch}")"
|
escaped_branch="$(json_escape_string "${predefined_branch}")"
|
||||||
|
|
|
||||||
18
scripts/easy-docker/lib/app/wizard/env/apps.sh
vendored
18
scripts/easy-docker/lib/app/wizard/env/apps.sh
vendored
|
|
@ -174,7 +174,6 @@ choose_predefined_app_branch() {
|
||||||
local status_text=""
|
local status_text=""
|
||||||
local selection=""
|
local selection=""
|
||||||
local default_hint=""
|
local default_hint=""
|
||||||
local preferred_found=0
|
|
||||||
local -a branch_options=()
|
local -a branch_options=()
|
||||||
|
|
||||||
if ! get_predefined_app_branch_lines_by_id branches_lines "${app_id}"; then
|
if ! get_predefined_app_branch_lines_by_id branches_lines "${app_id}"; then
|
||||||
|
|
@ -186,20 +185,11 @@ choose_predefined_app_branch() {
|
||||||
if [ -z "${branch}" ]; then
|
if [ -z "${branch}" ]; then
|
||||||
continue
|
continue
|
||||||
fi
|
fi
|
||||||
if [ "${branch}" = "${preferred_branch}" ]; then
|
|
||||||
branch_options=("${branch}" "${branch_options[@]}")
|
|
||||||
preferred_found=1
|
|
||||||
else
|
|
||||||
branch_options+=("${branch}")
|
branch_options+=("${branch}")
|
||||||
fi
|
|
||||||
done <<EOF
|
done <<EOF
|
||||||
${branches_lines}
|
${branches_lines}
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
if [ -n "${preferred_branch}" ] && [ "${preferred_found}" -eq 0 ]; then
|
|
||||||
branch_options=("${preferred_branch}" "${branch_options[@]}")
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ "${#branch_options[@]}" -eq 0 ]; then
|
if [ "${#branch_options[@]}" -eq 0 ]; then
|
||||||
show_warning_and_wait "No branches available for ${app_label} (${repo_url})." 3
|
show_warning_and_wait "No branches available for ${app_label} (${repo_url})." 3
|
||||||
return 1
|
return 1
|
||||||
|
|
@ -254,6 +244,7 @@ prompt_custom_modular_apps_data() {
|
||||||
local predefined_repo_url=""
|
local predefined_repo_url=""
|
||||||
local selected_branch=""
|
local selected_branch=""
|
||||||
local preferred_branch=""
|
local preferred_branch=""
|
||||||
|
local available_branch_lines=""
|
||||||
local existing_branch_lines=""
|
local existing_branch_lines=""
|
||||||
local selected_branch_lines=""
|
local selected_branch_lines=""
|
||||||
local selected_app_count=0
|
local selected_app_count=0
|
||||||
|
|
@ -371,6 +362,13 @@ EOF
|
||||||
preferred_branch="$(get_default_frappe_branch)"
|
preferred_branch="$(get_default_frappe_branch)"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
available_branch_lines=""
|
||||||
|
if get_predefined_app_branch_lines_by_id available_branch_lines "${predefined_app_id}"; then
|
||||||
|
if [ -n "${preferred_branch}" ] && ! lines_contains_line "${available_branch_lines}" "${preferred_branch}"; then
|
||||||
|
preferred_branch="$(get_predefined_app_default_branch_by_id "${predefined_app_id}" || true)"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
if choose_predefined_app_branch selected_branch "${stack_dir}" "${predefined_app_id}" "${predefined_app_label}" "${predefined_repo_url}" "${preferred_branch}"; then
|
if choose_predefined_app_branch selected_branch "${stack_dir}" "${predefined_app_id}" "${predefined_app_label}" "${predefined_repo_url}" "${preferred_branch}"; then
|
||||||
:
|
:
|
||||||
else
|
else
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue