Skip to content

Commit 18ca72c

Browse files
Guillaume De Saint MartinGuillaumeDSM
authored andcommitted
[Beta] Add beta tentacles url provider
1 parent 49997c6 commit 18ca72c

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

octobot/configuration_manager.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
import octobot_commons.configuration as configuration
2323
import octobot_commons.constants as common_constants
2424
import octobot_commons.logging as logging
25+
import octobot_commons.errors as common_errors
2526
import octobot_tentacles_manager.constants as tentacles_manager_constants
2627

2728
import octobot_trading.api as trading_api
@@ -144,13 +145,19 @@ def set_default_profile(config, from_default_config_file=constants.DEFAULT_CONFI
144145

145146

146147
def get_default_tentacles_url(version=None):
148+
beta_tentacle_bundle = os.getenv(constants.ENV_BETA_TENTACLES_PACKAGE_NAME, constants.BETA_TENTACLE_PACKAGE_NAME)
149+
# use beta tentacles repository for beta tentacles
150+
tentacles_repository = \
151+
os.getenv(constants.ENV_BETA_TENTACLES_REPOSITORY, constants.BETA_TENTACLES_REPOSITORY) \
152+
if version == beta_tentacle_bundle else \
153+
os.getenv(constants.ENV_TENTACLES_REPOSITORY, constants.TENTACLES_REPOSITORY)
147154
if version is None:
148155
version = constants.TENTACLES_REQUIRED_VERSION \
149156
if constants.TENTACLES_REQUIRED_VERSION else constants.LONG_VERSION
150157
return os.getenv(
151158
constants.ENV_TENTACLES_URL,
152159
f"{constants.OCTOBOT_ONLINE}/"
153-
f"{os.getenv(constants.ENV_TENTACLES_REPOSITORY, constants.TENTACLES_REPOSITORY)}/"
160+
f"{tentacles_repository}/"
154161
f"{os.getenv(constants.ENV_TENTACLES_PACKAGES_SOURCE, constants.OFFICIALS)}/"
155162
f"{os.getenv(constants.ENV_TENTACLES_PACKAGES_TYPE, constants.TENTACLE_PACKAGES)}/"
156163
f"{os.getenv(constants.ENV_TENTACLE_CATEGORY, constants.TENTACLE_CATEGORY)}/"

octobot/constants.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,11 @@
3535
OCTOBOT_ONLINE = os.getenv("TENTACLES_OCTOBOT_ONLINE_URL", "https://static.octobot.online")
3636
OCTOBOT_FEEDBACK = os.getenv("FEEDBACK_OCTOBOT_ONLINE_URL", "https://feedback.octobot.online/")
3737
TENTACLES_REPOSITORY = "tentacles"
38+
BETA_TENTACLES_REPOSITORY = "dev-tentacles"
3839
OFFICIALS = "officials"
3940
TENTACLE_CATEGORY = "full"
4041
TENTACLE_PACKAGE_NAME = "base"
42+
BETA_TENTACLE_PACKAGE_NAME = "beta"
4143
TENTACLE_PACKAGES = "packages"
4244
COMPILED_TENTACLE_CATEGORY = "extra"
4345

@@ -92,8 +94,10 @@
9294
ENV_TENTACLES_URL = "TENTACLES_URL"
9395
ENV_COMPILED_TENTACLES_URL = "COMPILED_TENTACLES_URL"
9496
ENV_TENTACLES_REPOSITORY = "TENTACLES_REPOSITORY"
97+
ENV_BETA_TENTACLES_REPOSITORY = "BETA_TENTACLES_REPOSITORY"
9598
ENV_TENTACLES_URL_TAG = "TENTACLES_URL_TAG"
9699
ENV_TENTACLE_PACKAGE_NAME = "TENTACLE_PACKAGE_NAME"
100+
ENV_BETA_TENTACLES_PACKAGE_NAME = "BETA_TENTACLES_PACKAGE_NAME"
97101
ENV_TENTACLES_PACKAGES_TYPE = "TENTACLES_PACKAGES_TYPE"
98102
ENV_TENTACLES_PACKAGES_SOURCE = "TENTACLES_PACKAGES_SOURCE"
99103
ENV_COMPILED_TENTACLES_CATEGORY = "COMPILED_TENTACLES_CATEGORY"

0 commit comments

Comments
 (0)