diff --git a/dist/bump-version.sh b/dist/bump-version.sh index 7c4b7b3..5d57040 100755 --- a/dist/bump-version.sh +++ b/dist/bump-version.sh @@ -6,7 +6,8 @@ this_dir="$(dirname "${this}")" git_branch="$(git rev-parse --abbrev-ref HEAD)" git_tag="$(git describe --abbrev=0)" version_str="${git_branch##*/}" +version_str="0.2.0" -echo "${version_str}" > "${this_dir}/kiwi_scp/data/etc/version_tag" -sed -ri "s/(version\s*:).*$/\1 '${version_str}'/" "${this_dir}/example/kiwi.yml" -sed -ri "s/(version\s*=\s*).*$/\1\"${version_str}\"/" "${this_dir}/pyproject.toml" +sed -ri "s/(version\s*:).*$/\1 '${version_str}'/" "${this_dir}/../example/kiwi.yml" +sed -ri "s/(version\s*=\s*).*$/\1\"${version_str}\"/" "${this_dir}/../pyproject.toml" +sed -ri "s/(version.*=\s*).*$/\1\"${version_str}\"/" "${this_dir}/../kiwi_scp/config.py" diff --git a/kiwi_scp/_constants.py b/kiwi_scp/_constants.py index 54b9607..e0f23c2 100644 --- a/kiwi_scp/_constants.py +++ b/kiwi_scp/_constants.py @@ -10,7 +10,7 @@ _RE_NUMBER: str = r"[0-9]|[1-9][0-9]*" # regex for a semantic version string RE_SEMVER = rf"^{_RE_NUMBER}(?:\.{_RE_NUMBER}(?:\.{_RE_NUMBER})?)?$" -# regex for a lowercase variable name +# regex for a variable name RE_VARNAME = r"^[A-Za-z](?:[A-Za-z0-9\._-]*[A-Za-z0-9])$" ############# diff --git a/kiwi_scp/config.py b/kiwi_scp/config.py index 792fd4c..37a020b 100644 --- a/kiwi_scp/config.py +++ b/kiwi_scp/config.py @@ -58,22 +58,22 @@ class Config(BaseModel): version: constr(regex=RE_SEMVER) = "0.2.0" - shells: Optional[List[str]] = [ - "/bin/bash", + shells: Optional[List[Path]] = [ + Path("/bin/bash"), ] environment: Dict[str, Optional[str]] = {} projects: Optional[List[_Project]] - storage: _Storage = _Storage.parse_obj({ - "directory": "/var/local/kiwi", - }) + storage: _Storage = _Storage( + directory="/var/local/kiwi", + ) - network: _Network = _Network.parse_obj({ - "name": "kiwi_hub", - "cidr": "10.22.46.0/24", - }) + network: _Network = _Network( + name="kiwi_hub", + cidr="10.22.46.0/24", + ) @validator("environment", pre=True) @classmethod diff --git a/pyproject.toml b/pyproject.toml index c7fe7ea..e1ab88b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "kiwi-scp" -version = "0.1.7" +version = "0.2.0" description = "kiwi is the simple tool for managing container servers." authors = ["ldericher <40151420+ldericher@users.noreply.github.com>"]