From e791991ef87c66f8cf020ca797e6043fb6528c49 Mon Sep 17 00:00:00 2001 From: Bernhard Landauer Date: Tue, 7 Feb 2017 20:22:02 +0100 Subject: [PATCH 1/6] [deployiso] reflect established sourceforge structure --- README.md | 4 ++++ bin/deployiso.in | 3 +++ data/manjaro-tools.conf | 4 ++++ lib/util-publish.sh | 25 +++++++++++++++++++------ lib/util.sh | 11 ++++++++++- 5 files changed, 40 insertions(+), 7 deletions(-) mode change 100644 => 100755 bin/deployiso.in diff --git a/README.md b/README.md index b394f3a5..22d789c0 100644 --- a/README.md +++ b/README.md @@ -127,6 +127,10 @@ overriding # the server user # account=[SetUser] +# the development cycle; possible values: development,candidates,release +# default: development +# dev_cycle=development + # set upload bandwidth limit in kB/s # limit=100 ~~~ diff --git a/bin/deployiso.in b/bin/deployiso.in old mode 100644 new mode 100755 index 52b0fbaa..518f858e --- a/bin/deployiso.in +++ b/bin/deployiso.in @@ -50,6 +50,7 @@ display_settings(){ msg "REMOTE:" msg2 "account: %s" "${account}" msg2 "host: %s" "${host}" + msg2 "development cycle: %s" "${dev_cycle}" msg "UPLOAD QUEUE:" run show_profile "${build_list_iso}" @@ -104,6 +105,8 @@ timer_start=$(get_timer) eval_build_list "${list_dir_iso}" "${build_list_iso}" +check_dev_cycle + rsync_args+=(--bwlimit=${limit}) ${pretend} && display_settings && exit 1 diff --git a/data/manjaro-tools.conf b/data/manjaro-tools.conf index b1e48f57..7111a0e2 100644 --- a/data/manjaro-tools.conf +++ b/data/manjaro-tools.conf @@ -76,6 +76,10 @@ # the server user # account=[SetUser] +# the development cycle; possible values: development,candidates,release +# default: development +# dev_cycle=development + # set upload bandwidth limit in kB/s # limit=100 diff --git a/lib/util-publish.sh b/lib/util-publish.sh index 13b841df..4a91ab5e 100644 --- a/lib/util-publish.sh +++ b/lib/util-publish.sh @@ -9,11 +9,18 @@ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. + +get_rel_dir(){ + [[ ${project} == 'manjarotest' ]] && rel_dir="${dist_release}" || rel_dir="${dev_cycle}/${dist_release}" + echo "${rel_dir}" +} + create_release(){ - msg "Create release (%s) ..." "${dist_release}" - rsync ${rsync_args[*]} /dev/null ${url}/${dist_release}/ + rel_dir=$(get_rel_dir) + msg "Create release (%s) ..." "${rel_dir}" + rsync ${rsync_args[*]} /dev/null ${url}/${rel_dir}/ show_elapsed_time "${FUNCNAME}" "${timer_start}" - msg "Done (%s)" "${dist_release}" + msg "Done (%s)" "${rel_dir}" } get_edition(){ @@ -24,6 +31,12 @@ get_edition(){ echo ${path##*/} } +check_dev_cycle(){ + if ! $(is_valid_dev_cycle ${dev_cycle}); then + die "%s is not a valid development cycle!" "${dev_cycle}" + fi +} + connect(){ local home="/home/frs/project" echo "${account},$1@frs.${host}:${home}/$1" @@ -33,8 +46,8 @@ prepare_transfer(){ local edition=$(get_edition $1) project=$(get_project "${edition}") url=$(connect "${project}") - target_dir="${dist_release}/$1" - src_dir="${run_dir}/${edition}/${target_dir}" + src_dir="${run_dir}/${edition}/${dist_release}/$1" + target_dir=$(get_rel_dir)/$1 } sync_dir(){ @@ -43,7 +56,7 @@ sync_dir(){ create_release exists=true fi - msg "Start upload [%s] ..." "$1" + msg "Start upload [%s] --> [${project}] ..." "$1" rsync ${rsync_args[*]} ${src_dir}/ ${url}/${target_dir}/ msg "Done upload [%s]" "$1" show_elapsed_time "${FUNCNAME}" "${timer_start}" diff --git a/lib/util.sh b/lib/util.sh index cef13f4c..b3b66a20 100644 --- a/lib/util.sh +++ b/lib/util.sh @@ -137,7 +137,7 @@ get_project(){ local project case "$1" in 'community') project='manjarolinux-community' ;; - 'manjaro') project='manjarolinux' ;; + 'manjaro') [[ ${dev_cycle} == 'development' ]] && project='manjarotest' || project='manjarolinux' ;; 'sonar') project='sonargnulinux' ;; esac echo ${project} @@ -315,6 +315,8 @@ init_buildiso(){ init_deployiso(){ [[ -z ${account} ]] && account="[SetUser]" + + [[ -z ${dev_cycle} ]] && dev_cycle='development' [[ -z ${limit} ]] && limit=100 } @@ -788,6 +790,13 @@ is_valid_branch(){ esac } +is_valid_dev_cycle(){ + case $1 in + 'development'|'candidates'|'release') return 0 ;; + *) return 1 ;; + esac +} + run(){ if ${is_build_list};then for item in ${build_list[@]};do -- GitLab From f20c61cd71db633c9f1f90f8e561a2c6eec4924e Mon Sep 17 00:00:00 2001 From: Bernhard Landauer Date: Thu, 9 Feb 2017 02:39:53 +0100 Subject: [PATCH 2/6] adjust to reviewed projects structure --- README.md | 4 ---- bin/buildiso.in | 0 bin/deployiso.in | 3 --- bin/testiso.in | 0 data/manjaro-tools.conf | 4 ---- lib/util-publish.sh | 23 +++++------------------ lib/util.sh | 13 ++----------- 7 files changed, 7 insertions(+), 40 deletions(-) mode change 100755 => 100644 bin/buildiso.in mode change 100755 => 100644 bin/deployiso.in mode change 100755 => 100644 bin/testiso.in diff --git a/README.md b/README.md index 22d789c0..b394f3a5 100644 --- a/README.md +++ b/README.md @@ -127,10 +127,6 @@ overriding # the server user # account=[SetUser] -# the development cycle; possible values: development,candidates,release -# default: development -# dev_cycle=development - # set upload bandwidth limit in kB/s # limit=100 ~~~ diff --git a/bin/buildiso.in b/bin/buildiso.in old mode 100755 new mode 100644 diff --git a/bin/deployiso.in b/bin/deployiso.in old mode 100755 new mode 100644 index 518f858e..52b0fbaa --- a/bin/deployiso.in +++ b/bin/deployiso.in @@ -50,7 +50,6 @@ display_settings(){ msg "REMOTE:" msg2 "account: %s" "${account}" msg2 "host: %s" "${host}" - msg2 "development cycle: %s" "${dev_cycle}" msg "UPLOAD QUEUE:" run show_profile "${build_list_iso}" @@ -105,8 +104,6 @@ timer_start=$(get_timer) eval_build_list "${list_dir_iso}" "${build_list_iso}" -check_dev_cycle - rsync_args+=(--bwlimit=${limit}) ${pretend} && display_settings && exit 1 diff --git a/bin/testiso.in b/bin/testiso.in old mode 100755 new mode 100644 diff --git a/data/manjaro-tools.conf b/data/manjaro-tools.conf index 7111a0e2..b1e48f57 100644 --- a/data/manjaro-tools.conf +++ b/data/manjaro-tools.conf @@ -76,10 +76,6 @@ # the server user # account=[SetUser] -# the development cycle; possible values: development,candidates,release -# default: development -# dev_cycle=development - # set upload bandwidth limit in kB/s # limit=100 diff --git a/lib/util-publish.sh b/lib/util-publish.sh index 4a91ab5e..de17e7ef 100644 --- a/lib/util-publish.sh +++ b/lib/util-publish.sh @@ -9,18 +9,11 @@ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. - -get_rel_dir(){ - [[ ${project} == 'manjarotest' ]] && rel_dir="${dist_release}" || rel_dir="${dev_cycle}/${dist_release}" - echo "${rel_dir}" -} - create_release(){ - rel_dir=$(get_rel_dir) - msg "Create release (%s) ..." "${rel_dir}" - rsync ${rsync_args[*]} /dev/null ${url}/${rel_dir}/ + msg "Create release (%s) ..." "${dist_release}" + rsync ${rsync_args[*]} /dev/null ${url}/${dist_release}/ show_elapsed_time "${FUNCNAME}" "${timer_start}" - msg "Done (%s)" "${rel_dir}" + msg "Done (%s)" "${dist_release}" } get_edition(){ @@ -31,12 +24,6 @@ get_edition(){ echo ${path##*/} } -check_dev_cycle(){ - if ! $(is_valid_dev_cycle ${dev_cycle}); then - die "%s is not a valid development cycle!" "${dev_cycle}" - fi -} - connect(){ local home="/home/frs/project" echo "${account},$1@frs.${host}:${home}/$1" @@ -46,8 +33,8 @@ prepare_transfer(){ local edition=$(get_edition $1) project=$(get_project "${edition}") url=$(connect "${project}") - src_dir="${run_dir}/${edition}/${dist_release}/$1" - target_dir=$(get_rel_dir)/$1 + target_dir="${dist_release}/$1" + src_dir="${run_dir}/${edition}/${target_dir}" } sync_dir(){ diff --git a/lib/util.sh b/lib/util.sh index b3b66a20..065accb0 100644 --- a/lib/util.sh +++ b/lib/util.sh @@ -136,8 +136,8 @@ show_elapsed_time(){ get_project(){ local project case "$1" in - 'community') project='manjarolinux-community' ;; - 'manjaro') [[ ${dev_cycle} == 'development' ]] && project='manjarotest' || project='manjarolinux' ;; + 'community') [[ "${dist_release}" =~ [a-z] ]] && project='manjarotest-community' || project='manjarolinux-community' ;; + 'manjaro') [[ "${dist_release}" =~ [a-z] ]] && project='manjarotest' || project='manjarolinux' ;; 'sonar') project='sonargnulinux' ;; esac echo ${project} @@ -315,8 +315,6 @@ init_buildiso(){ init_deployiso(){ [[ -z ${account} ]] && account="[SetUser]" - - [[ -z ${dev_cycle} ]] && dev_cycle='development' [[ -z ${limit} ]] && limit=100 } @@ -790,13 +788,6 @@ is_valid_branch(){ esac } -is_valid_dev_cycle(){ - case $1 in - 'development'|'candidates'|'release') return 0 ;; - *) return 1 ;; - esac -} - run(){ if ${is_build_list};then for item in ${build_list[@]};do -- GitLab From d12b70d99f378eddc1326dd733921d1ba2060cd9 Mon Sep 17 00:00:00 2001 From: Bernhard Landauer Date: Thu, 9 Feb 2017 03:04:08 +0100 Subject: [PATCH 3/6] [util-publish] fix create_release(), adjust src_dir and target_dir --- lib/util-publish.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/util-publish.sh b/lib/util-publish.sh index de17e7ef..c492142a 100644 --- a/lib/util-publish.sh +++ b/lib/util-publish.sh @@ -10,10 +10,10 @@ # GNU General Public License for more details. create_release(){ - msg "Create release (%s) ..." "${dist_release}" - rsync ${rsync_args[*]} /dev/null ${url}/${dist_release}/ + msg "Create release (%s) ..." "$1/${dist_release}" + rsync ${rsync_args[*]} /dev/null ${url}/$1/${dist_release}/ show_elapsed_time "${FUNCNAME}" "${timer_start}" - msg "Done (%s)" "${dist_release}" + msg "Done (%s)" "$1/${dist_release}" } get_edition(){ @@ -33,8 +33,8 @@ prepare_transfer(){ local edition=$(get_edition $1) project=$(get_project "${edition}") url=$(connect "${project}") - target_dir="${dist_release}/$1" - src_dir="${run_dir}/${edition}/${target_dir}" + src_dir="${run_dir}/${edition}/${dist_release}/$1" + target_dir="$1/${dist_release}" } sync_dir(){ -- GitLab From 357c7e9ed2e130e025f816026397f941c809123d Mon Sep 17 00:00:00 2001 From: Bernhard Landauer Date: Thu, 9 Feb 2017 03:06:41 +0100 Subject: [PATCH 4/6] correction create_release call --- lib/util-publish.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/util-publish.sh b/lib/util-publish.sh index c492142a..b9712f8c 100644 --- a/lib/util-publish.sh +++ b/lib/util-publish.sh @@ -40,7 +40,7 @@ prepare_transfer(){ sync_dir(){ prepare_transfer "$1" if ${release} && ! ${exists};then - create_release + create_release "$1" exists=true fi msg "Start upload [%s] --> [${project}] ..." "$1" -- GitLab From f021171dc8c72f971db0befb82eedda016af8b9c Mon Sep 17 00:00:00 2001 From: Bernhard Landauer Date: Thu, 9 Feb 2017 03:24:41 +0100 Subject: [PATCH 5/6] reflect target_dir in src_dir --- lib/util-iso.sh | 2 +- lib/util-publish.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/util-iso.sh b/lib/util-iso.sh index 8ff5b45e..08c745d9 100644 --- a/lib/util-iso.sh +++ b/lib/util-iso.sh @@ -583,7 +583,7 @@ load_profile(){ mkchroot_args+=(-C ${pacman_conf} -S ${mirrors_conf} -B "${build_mirror}/${target_branch}" -K) work_dir=${chroots_iso}/${profile}/${target_arch} - iso_dir="${cache_dir_iso}/${edition}/${dist_release}/${profile}" + iso_dir="${cache_dir_iso}/${edition}/${profile}/${dist_release}" iso_root=${chroots_iso}/${profile}/iso mnt_dir=${chroots_iso}/${profile}/mnt diff --git a/lib/util-publish.sh b/lib/util-publish.sh index b9712f8c..3a2ea9db 100644 --- a/lib/util-publish.sh +++ b/lib/util-publish.sh @@ -33,8 +33,8 @@ prepare_transfer(){ local edition=$(get_edition $1) project=$(get_project "${edition}") url=$(connect "${project}") - src_dir="${run_dir}/${edition}/${dist_release}/$1" target_dir="$1/${dist_release}" + src_dir="${run_dir}/${edition}/${target_dir}" } sync_dir(){ -- GitLab From cf47596869366b82df8b2b3e7f08c431a6982b28 Mon Sep 17 00:00:00 2001 From: Bernhard Landauer Date: Thu, 9 Feb 2017 05:00:09 +0100 Subject: [PATCH 6/6] [util-publish] adjust get_edition() --- lib/util-publish.sh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/util-publish.sh b/lib/util-publish.sh index 3a2ea9db..721c30d8 100644 --- a/lib/util-publish.sh +++ b/lib/util-publish.sh @@ -17,10 +17,9 @@ create_release(){ } get_edition(){ - local result=$(find ${run_dir} -maxdepth 3 -name "$1") path + local result=$(find ${run_dir} -maxdepth 2 -name "$1") path [[ -z $result ]] && die "%s is not a valid profile or build list!" "$1" path=${result%/*} - path=${path%/*} echo ${path##*/} } -- GitLab