erynwells.me/scripts/website
Eryn Wells 2688e4e339 Add a deployment command group to the website script
This group has one command so far: next-tag. It looks at the git tag list and
figured out the next deployment tag. For the most part tags are named like so:

    deploy-%Y-%m-%d-NN

The middle segments are year-month-day, and the last segment is an incrementing
counter. For the most part this number will be 01. On days when I deploy more than
once, it will increment.
2025-08-29 08:59:03 -06:00

40 lines
967 B
Python
Executable file

#!/usr/bin/env python3
# Eryn Wells <eryn@erynwells.me>
'''
A Python interface to my personal website, Erynwells.me.
'''
import argparse
from typing import List
from erynwells_me.scripting import Command
from erynwells_me.weeknotes import WeeknotesCommand
from erynwells_me.deployment import DeploymentCommand
COMMANDS: List[Command] = [
WeeknotesCommand(),
DeploymentCommand(),
]
def parse_args(commands: List[Command], argv, *a, **kw):
parser = argparse.ArgumentParser(*a, **kw)
subcommands = parser.add_subparsers(title='Subcommands', required=True)
for command in commands:
subcommand_parser = subcommands.add_parser(command.name, help=command.help)
command.add_arguments(subcommand_parser)
args = parser.parse_args(argv)
return args
def main(argv):
args = parse_args(COMMANDS, argv[1:], prog=argv[0])
return args.handler(args)
if __name__ == '__main__':
import sys
sys.exit(main(sys.argv))