Show More
@@ -0,0 +1,1 b'' | |||||
|
1 | scripts/dev-tools/dev-tools No newline at end of file |
@@ -190,6 +190,11 b' rcstack_init_usage() {' | |||||
190 | echo |
|
190 | echo | |
191 |
|
191 | |||
192 | # :flag.usage |
|
192 | # :flag.usage | |
|
193 | printf " %s\n" "--stage STAGE (repeatable)" | |||
|
194 | printf " specify one or more stages to run\n" | |||
|
195 | echo | |||
|
196 | ||||
|
197 | # :flag.usage | |||
193 | printf " %s\n" "--auth-token AUTH_TOKEN" |
|
198 | printf " %s\n" "--auth-token AUTH_TOKEN" | |
194 | printf " Optionally specify AUTH TOKEN to obtain sources\n" |
|
199 | printf " Optionally specify AUTH TOKEN to obtain sources\n" | |
195 | echo |
|
200 | echo | |
@@ -1468,16 +1473,13 b' inspect_args() {' | |||||
1468 |
|
1473 | |||
1469 | check_bootstrap() { |
|
1474 | check_bootstrap() { | |
1470 | # Avoid destroying bootstrapping by simple start/stop |
|
1475 | # Avoid destroying bootstrapping by simple start/stop | |
1471 | for stage in $BOOTSTRAP_STAGES; do |
|
1476 | for stage_name in $BOOTSTRAP_STAGES; do | |
1472 |
|
1477 | if ! config_has_key $stage_name ; then | ||
1473 | stage_name=$(echo $stage | cut -d ":" -f 1) |
|
1478 | echo "$(yellow WARNING:) bootstrap key $stage_name not found in config file $CONFIG_FILE!" | |
1474 | stage_func=$(echo $stage | cut -d ":" -f 2) |
|
1479 | echo "$(yellow NOTICE:) Please run ./$RC_SCRIPT_NAME init first" | |
1475 | if ! config_has_key $stage_name ; then |
|
1480 | exit | |
1476 | echo "$(yellow WARNING:) bootstrap key $stage_name not found in config file $CONFIG_FILE!" |
|
1481 | fi | |
1477 | echo "$(yellow NOTICE:) Please run ./$RC_SCRIPT_NAME init first" |
|
1482 | done | |
1478 | exit |
|
|||
1479 | fi |
|
|||
1480 | done |
|
|||
1481 |
|
1483 | |||
1482 | } |
|
1484 | } | |
1483 |
|
1485 | |||
@@ -1954,6 +1956,8 b' rcstack_init_command() {' | |||||
1954 | install_docker=${args[--install-docker]} |
|
1956 | install_docker=${args[--install-docker]} | |
1955 | no_prompt=${args[--no-prompt]} |
|
1957 | no_prompt=${args[--no-prompt]} | |
1956 |
|
1958 | |||
|
1959 | eval "stages_from_cli=(${args[--stage]})" | |||
|
1960 | ||||
1957 | # CLI passed args |
|
1961 | # CLI passed args | |
1958 | #TODO: allow passing all defaults from CLI together with --no-prompt would allow auto-config |
|
1962 | #TODO: allow passing all defaults from CLI together with --no-prompt would allow auto-config | |
1959 |
|
1963 | |||
@@ -2322,10 +2326,16 b' rcstack_init_command() {' | |||||
2322 | echo "config: re-using present config at: $CONFIG_FILE" |
|
2326 | echo "config: re-using present config at: $CONFIG_FILE" | |
2323 | fi |
|
2327 | fi | |
2324 |
|
2328 | |||
2325 |
|
|
2329 | run_stages=$BOOTSTRAP_STAGES | |
|
2330 | ||||
|
2331 | if [ ! ${#stages_from_cli[@]} -eq 0 ]; then | |||
|
2332 | echo "Using custom stages to run init command..." | |||
|
2333 | run_stages=${stages_from_cli[@]} | |||
|
2334 | fi | |||
2326 |
|
2335 | |||
2327 | stage_name=$(echo $stage | cut -d ":" -f 1) |
|
2336 | for stage_name in $run_stages; do | |
2328 | stage_func=$(echo $stage | cut -d ":" -f 2) |
|
2337 | ||
|
2338 | stage_func=$(get_stage_function $stage_name) | |||
2329 |
|
2339 | |||
2330 | if ! config_has_key $stage_name ; then |
|
2340 | if ! config_has_key $stage_name ; then | |
2331 | echo "$(green \* bootstrap: \'$stage_name\' stage not found\; running now... )" |
|
2341 | echo "$(green \* bootstrap: \'$stage_name\' stage not found\; running now... )" | |
@@ -2337,7 +2347,7 b' rcstack_init_command() {' | |||||
2337 | $stage_func $force |
|
2347 | $stage_func $force | |
2338 | config_set "$stage_name" $cur_date |
|
2348 | config_set "$stage_name" $cur_date | |
2339 | else |
|
2349 | else | |
2340 | echo "$(yellow \* bootstrap: \'$stage_name\' already present, use --force to run it again)" |
|
2350 | echo "$(yellow \* bootstrap: \'$stage_name\' stage already present, use --force to run it again)" | |
2341 | fi |
|
2351 | fi | |
2342 | fi |
|
2352 | fi | |
2343 |
|
2353 | |||
@@ -3763,6 +3773,25 b' rcstack_init_parse_requirements() {' | |||||
3763 | ;; |
|
3773 | ;; | |
3764 |
|
3774 | |||
3765 | # :flag.case |
|
3775 | # :flag.case | |
|
3776 | --stage) | |||
|
3777 | ||||
|
3778 | # :flag.case_arg | |||
|
3779 | if [[ -n ${2+x} ]]; then | |||
|
3780 | ||||
|
3781 | if [[ -z ${args['--stage']+x} ]]; then | |||
|
3782 | args['--stage']="\"$2\"" | |||
|
3783 | else | |||
|
3784 | args['--stage']="${args[--stage]} \"$2\"" | |||
|
3785 | fi | |||
|
3786 | shift | |||
|
3787 | shift | |||
|
3788 | else | |||
|
3789 | printf "%s\n" "--stage requires an argument: --stage STAGE" >&2 | |||
|
3790 | exit 1 | |||
|
3791 | fi | |||
|
3792 | ;; | |||
|
3793 | ||||
|
3794 | # :flag.case | |||
3766 | --auth-token) |
|
3795 | --auth-token) | |
3767 |
|
3796 | |||
3768 | # :flag.case_arg |
|
3797 | # :flag.case_arg | |
@@ -5884,7 +5913,7 b' rcstack__completions_parse_requirements() {' | |||||
5884 |
|
5913 | |||
5885 | # :command.initialize |
|
5914 | # :command.initialize | |
5886 | initialize() { |
|
5915 | initialize() { | |
5887 |
version="4.28.0.REL.2023. |
|
5916 | version="4.28.0.REL.2023.60" | |
5888 | long_usage='' |
|
5917 | long_usage='' | |
5889 | set -e |
|
5918 | set -e | |
5890 |
|
5919 | |||
@@ -5916,13 +5945,40 b' initialize() {' | |||||
5916 |
|
5945 | |||
5917 | # stage key, saved in .rcstack.ini : stage func to execute |
|
5946 | # stage key, saved in .rcstack.ini : stage func to execute | |
5918 | BOOTSTRAP_STAGES="\ |
|
5947 | BOOTSTRAP_STAGES="\ | |
5919 |
bootstrap_v1_docker_install |
|
5948 | bootstrap_v1_docker_install \ | |
5920 |
bootstrap_v1_docker_commons |
|
5949 | bootstrap_v1_docker_commons \ | |
5921 |
bootstrap_v1_definitions |
|
5950 | bootstrap_v1_definitions \ | |
5922 |
bootstrap_v1_config |
|
5951 | bootstrap_v1_config \ | |
5923 |
bootstrap_v1_overrides |
|
5952 | bootstrap_v1_overrides \ | |
5924 | " |
|
5953 | " | |
5925 |
|
5954 | |||
|
5955 | get_stage_function() { | |||
|
5956 | stage_name=$1 | |||
|
5957 | ||||
|
5958 | case $stage_name in | |||
|
5959 | bootstrap_v1_docker_install) | |||
|
5960 | stage_func=bootstrap_docker_install | |||
|
5961 | ;; | |||
|
5962 | bootstrap_v1_docker_commons) | |||
|
5963 | stage_func=bootstrap_docker_commons | |||
|
5964 | ;; | |||
|
5965 | bootstrap_v1_definitions) | |||
|
5966 | stage_func=bootstrap_definitions | |||
|
5967 | ;; | |||
|
5968 | bootstrap_v1_config) | |||
|
5969 | stage_func=bootstrap_config | |||
|
5970 | ;; | |||
|
5971 | bootstrap_v1_overrides) | |||
|
5972 | stage_func=bootstrap_overrides | |||
|
5973 | ;; | |||
|
5974 | *) | |||
|
5975 | echo "can't find function for stage $stage_name" | |||
|
5976 | exit 1 | |||
|
5977 | esac | |||
|
5978 | ||||
|
5979 | echo $stage_func | |||
|
5980 | } | |||
|
5981 | ||||
5926 | #echo "1 ----" |
|
5982 | #echo "1 ----" | |
5927 | #echo $RC_STACK_SERVICES_EXT |
|
5983 | #echo $RC_STACK_SERVICES_EXT | |
5928 | #echo $RC_STACK_METRICS_EXT |
|
5984 | #echo $RC_STACK_METRICS_EXT |
General Comments 0
You need to be logged in to leave comments.
Login now