diff --git a/kdb-bot/cpl-workspace.json b/kdb-bot/cpl-workspace.json index 89d67f88..81b9c97b 100644 --- a/kdb-bot/cpl-workspace.json +++ b/kdb-bot/cpl-workspace.json @@ -19,7 +19,7 @@ "set-version": "tools/set_version/set-version.json" }, "Scripts": { - "sv": "cpl set-version", + "sv": "cpl set-version $ARGS", "set-version": "cpl run set-version $ARGS; echo '';", "gv": "cpl get-version", @@ -37,9 +37,10 @@ "pre-dev": "cpl build", "dev": "export KDB_ENVIRONMENT=development; export KDB_NAME=KDB-Dev; cpl start;", - "docker-build": "cpl b; docker-compose down; docker build -t kdb-bot/kdb-bot:$(cpl gv) .", - "docker-compose": "docker-compose up -d", - "docker": "cpl docker-build; cpl docker-compose;" + "docker-build": "cpl build $ARGS; cd docker; echo docker build -t kdb-bot/kdb-bot:$(cd ../; cpl gv; cd docker;) .; cd ..;", + "dc-up": "docker-compose up -d", + "dc-down": "docker-compose down", + "docker": "cpl dc-down; cpl docker-build; cpl dc-up;" } } } \ No newline at end of file diff --git a/kdb-bot/tools/set_version/application.py b/kdb-bot/tools/set_version/application.py index e722a272..f9b1e711 100644 --- a/kdb-bot/tools/set_version/application.py +++ b/kdb-bot/tools/set_version/application.py @@ -46,7 +46,7 @@ class Application(ApplicationABC): return if len(args) == 1: - suffix = f'.{args[0]}' + suffix = args[0] try: branch = self._git_service.get_active_branch_name() @@ -67,8 +67,12 @@ class Application(ApplicationABC): version[VersionSettingsNameEnum.major.value] = branch.split('.')[0] version[VersionSettingsNameEnum.minor.value] = branch.split('.')[1] if len(branch.split('.')) == 2: - version[VersionSettingsNameEnum.micro.value] = f'0{suffix}' + if suffix == '': + suffix = '0' + version[VersionSettingsNameEnum.micro.value] = f'{suffix}' else: + if not suffix.startswith('.') and suffix != '': + suffix = f'.{suffix}' version[VersionSettingsNameEnum.micro.value] = f'{branch.split(".")[2]}{suffix}' except Exception as e: Console.error(f'Branch {branch} does not contain valid version')