##// END OF EJS Templates
dev(tools): set new version setting logic on top of dev-tools...
marcink -
Show More
@@ -0,0 +1,1 b''
1 5.3.0 No newline at end of file
@@ -7,8 +7,20 b''
7 7 # https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information
8 8 import datetime
9 9
10
11 def _get_version():
12 with open("../../VERSION") as f:
13 return f.read().strip()
14
15
10 16 now = datetime.datetime.today()
11 17
18 # The full project version, used as the replacement for |release| and e.g. in the HTML templates.
19 # For example, for the Python documentation, this may be something like 2.6.0rc1.
20 # If you don’t need the separation provided between version and release, just set them both to the same value.
21 release = _get_version()
22
23
12 24 project = 'RhodeCode rcstack'
13 25 copyright = f'2010-{now.year}, RhodeCode Inc.'
14 26 author = 'RhodeCode Inc.'
@@ -17,7 +29,10 b" author = 'RhodeCode Inc.'"
17 29 # https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration
18 30
19 31 extensions = [
20 'sphinx_rtd_theme'
32 'sphinx.ext.autodoc',
33 'sphinx.ext.intersphinx',
34 'sphinx.ext.todo',
35 'sphinx.ext.imgmath'
21 36 ]
22 37
23 38 templates_path = ['_templates']
@@ -31,9 +46,19 b" pygments_style = 'sphinx'"
31 46
32 47 # https://github.com/pradyunsg/furo/tree/main/src/furo/theme/furo
33 48 html_theme = 'furo'
49
50 # Add any paths that contain custom static files (such as style sheets) here,
51 # relative to this directory. They are copied after the builtin static files,
52 # so a file named "default.css" will overwrite the builtin "default.css".
34 53 html_static_path = ['_static']
54
55 # If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
56 # using the given strftime format.
35 57 html_last_updated_fmt = ' %H:%m %b %d, %Y'
58
59 # If true, "Created using Sphinx" is shown in the HTML footer. Default is True.
36 60 html_show_sphinx = False
61
37 62 html_extra_path = ['extra']
38 63
39 64
@@ -44,6 +44,7 b' dev_tools_usage() {'
44 44 printf " %s clears docker images and system cache, full cleanup. Be cautious !\n" "prune-all "
45 45 printf " %s pull latest image of bashly\n" "cli-generate-pull "
46 46 printf " %s print out help about bashly\n" "cli-generate-help "
47 printf " %s set the version for rcstack\n" "stack-cli-version "
47 48 printf " %s run a ./rcstack generation script\n" "stack-cli-generate"
48 49 printf " %s run a ./dev-tools generation script\n" "dev-cli-generate "
49 50 echo
@@ -370,6 +371,43 b' dev_tools_cli_generate_help_usage() {'
370 371 }
371 372
372 373 # :command.usage
374 dev_tools_stack_cli_version_usage() {
375 if [[ -n $long_usage ]]; then
376 printf "dev-tools stack-cli-version - set the version for rcstack\n"
377 echo
378
379 else
380 printf "dev-tools stack-cli-version - set the version for rcstack\n"
381 echo
382
383 fi
384
385 printf "%s\n" "Usage:"
386 printf " dev-tools stack-cli-version VERSION\n"
387 printf " dev-tools stack-cli-version --help | -h\n"
388 echo
389
390 # :command.long_usage
391 if [[ -n $long_usage ]]; then
392 printf "%s\n" "Options:"
393
394 # :command.usage_fixed_flags
395 printf " %s\n" "--help, -h"
396 printf " Show this help\n"
397 echo
398
399 # :command.usage_args
400 printf "%s\n" "Arguments:"
401
402 # :argument.usage
403 printf " %s\n" "VERSION"
404 printf " Version to set e.g '5.0.0'\n"
405 echo
406
407 fi
408 }
409
410 # :command.usage
373 411 dev_tools_stack_cli_generate_usage() {
374 412 if [[ -n $long_usage ]]; then
375 413 printf "dev-tools stack-cli-generate - run a ./rcstack generation script\n"
@@ -664,6 +702,21 b' dev_tools_cli_generate_help_command() {'
664 702 }
665 703
666 704 # :command.function
705 dev_tools_stack_cli_version_command() {
706 # src/stack_cli_version_command.sh
707 version=${args[version]}
708 version_file=$(pwd)/VERSION
709 yaml_file=$(pwd)/scripts/rcstack/src/bashly.yml
710
711 echo "Setting $version to $version_file"
712 echo -n $version > $version_file
713
714 echo "Setting $version to $yaml_file"
715 sed -i -E "s/version:.+/version: $version/" $yaml_file
716
717 }
718
719 # :command.function
667 720 dev_tools_stack_cli_generate_command() {
668 721 # src/stack_cli_generate_command.sh
669 722 one_time=${args[--one-time]}
@@ -796,6 +849,13 b' parse_requirements() {'
796 849 shift $#
797 850 ;;
798 851
852 stack-cli-version)
853 action="stack-cli-version"
854 shift
855 dev_tools_stack_cli_version_parse_requirements "$@"
856 shift $#
857 ;;
858
799 859 stack-cli-generate)
800 860 action="stack-cli-generate"
801 861 shift
@@ -1287,6 +1347,62 b' dev_tools_cli_generate_help_parse_requirements() {'
1287 1347 }
1288 1348
1289 1349 # :command.parse_requirements
1350 dev_tools_stack_cli_version_parse_requirements() {
1351 # :command.fixed_flags_filter
1352 while [[ $# -gt 0 ]]; do
1353 case "${1:-}" in
1354 --help | -h)
1355 long_usage=yes
1356 dev_tools_stack_cli_version_usage
1357 exit
1358 ;;
1359
1360 *)
1361 break
1362 ;;
1363
1364 esac
1365 done
1366
1367 # :command.command_filter
1368 action="stack-cli-version"
1369
1370 # :command.parse_requirements_while
1371 while [[ $# -gt 0 ]]; do
1372 key="$1"
1373 case "$key" in
1374
1375 -?*)
1376 printf "invalid option: %s\n" "$key" >&2
1377 exit 1
1378 ;;
1379
1380 *)
1381 # :command.parse_requirements_case
1382 # :command.parse_requirements_case_simple
1383 if [[ -z ${args['version']+x} ]]; then
1384
1385 args['version']=$1
1386 shift
1387 else
1388 printf "invalid argument: %s\n" "$key" >&2
1389 exit 1
1390 fi
1391
1392 ;;
1393
1394 esac
1395 done
1396
1397 # :command.required_args_filter
1398 if [[ -z ${args['version']+x} ]]; then
1399 printf "missing required argument: VERSION\nusage: dev-tools stack-cli-version VERSION\n" >&2
1400 exit 1
1401 fi
1402
1403 }
1404
1405 # :command.parse_requirements
1290 1406 dev_tools_stack_cli_generate_parse_requirements() {
1291 1407 # :command.fixed_flags_filter
1292 1408 while [[ $# -gt 0 ]]; do
@@ -1419,6 +1535,7 b' run() {'
1419 1535 "prune-all") dev_tools_prune_all_command ;;
1420 1536 "cli-generate-pull") dev_tools_cli_generate_pull_command ;;
1421 1537 "cli-generate-help") dev_tools_cli_generate_help_command ;;
1538 "stack-cli-version") dev_tools_stack_cli_version_command ;;
1422 1539 "stack-cli-generate") dev_tools_stack_cli_generate_command ;;
1423 1540 "dev-cli-generate") dev_tools_dev_cli_generate_command ;;
1424 1541 esac
General Comments 0
You need to be logged in to leave comments. Login now