Skip to content

Commit

Permalink
fixes to deploy branch versions (such as b1.2.x) automatically
Browse files Browse the repository at this point in the history
  • Loading branch information
o-smirnov committed May 27, 2021
1 parent d13f58a commit e102b44
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 9 deletions.
17 changes: 10 additions & 7 deletions radiopadre_client/default_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,15 @@
# change this to a proper patch release number for a real release
__version__ = "1.2.pre1"

# set this to True to have auto-installs use git rather than pip, suitable dor dev branches etc.
# default convention is to use b1.2.x branch for version 1.2.preN
__install_from_branch__ = "b" + re.sub("pre.*", "x", __version__) if "pre" in __version__ else None

__tag_prefix__ = "b" if __install_from_branch__ else ""

# if True, this is a stable release e.g. 1.1.0. If False, this is an dev version e.g. 1.1.x
__release__ = re.match("^(\d+)\.(\d+)\.(\d+)$", __version__)

# git tag or branch to use: vXXX for releases and bXXX for devs
__tag_prefix__ = "b" # "v" if __release__ else "b"

# release x.y.z pulls x.y.latest image
if __release__:
__image_version__ = ".".join([__release__.group(1), __release__.group(2), "latest"])
Expand All @@ -43,12 +46,12 @@
GRIM_REAPER=True,
REMOTE_RADIOPADRE_DIR="~/.radiopadre",
CLIENT_INSTALL_PATH="~/radiopadre-client",
CLIENT_INSTALL_REPO="", #"https://github.com/ratt-ru/radiopadre-client.git", # empty for pip release
CLIENT_INSTALL_BRANCH=__tag_prefix__ + __version__, # change for each release
CLIENT_INSTALL_REPO="https://github.com/ratt-ru/radiopadre-client.git" if __install_from_branch__ else "",
CLIENT_INSTALL_BRANCH=__install_from_branch__,
CLIENT_INSTALL_PIP="radiopadre-client",
SERVER_INSTALL_PATH="~/radiopadre",
SERVER_INSTALL_REPO="", #"https://github.com/ratt-ru/radiopadre.git", # empty for pip release
SERVER_INSTALL_BRANCH=__tag_prefix__ + __version__, # change for each release
SERVER_INSTALL_REPO="https://github.com/ratt-ru/radiopadre.git" if __install_from_branch__ else "",
SERVER_INSTALL_BRANCH=__install_from_branch__,
SERVER_INSTALL_PIP="radiopadre",
SINGULARITY_IMAGE_DIR="",
SINGULARITY_AUTO_BUILD=True,
Expand Down
4 changes: 2 additions & 2 deletions radiopadre_client/remote.py
Original file line number Diff line number Diff line change
Expand Up @@ -265,8 +265,8 @@ def check_remote_command(command):
install_path = f"git+{config.CLIENT_INSTALL_REPO}@{branch}"

# now pip install
message(f"Doing pip install -e {install_path} in {config.RADIOPADRE_VENV}")
ssh_remote_v(f"source {config.RADIOPADRE_VENV}/bin/activate && {pip_install} -e {install_path}")
# message(f"Doing pip install -e {install_path} in {config.RADIOPADRE_VENV}")
# ssh_remote_v(f"source {config.RADIOPADRE_VENV}/bin/activate && {pip_install} -e {install_path}")
# else, installing directly from pip
elif config.CLIENT_INSTALL_PIP:
message(f"--client-install-pip {config.CLIENT_INSTALL_PIP} is configured.")
Expand Down

0 comments on commit e102b44

Please sign in to comment.