Skip to content

Commit

Permalink
Fix release tag for docker
Browse files Browse the repository at this point in the history
  • Loading branch information
WhoisDonlee committed Apr 19, 2024
1 parent 2e82e53 commit b80e01c
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions util.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import os
import sys
import subprocess
import requests
# https://molbiol-tools.ca/Amino_acid_abbreviations.htm
protein_conversion = {
"Ala": "A",
Expand Down Expand Up @@ -59,6 +60,13 @@ def relative_path(path: str) -> str:

def get_release_tag() -> str:
tag = ""
result = subprocess.run(['git', 'describe', '--tags'], stdout=subprocess.PIPE)
tag = result.stdout.decode().strip()
try:
result = subprocess.run(['git', 'describe', '--tags'], stdout=subprocess.PIPE)
tag = result.stdout.decode().strip()
except FileNotFoundError:
url = "https://api.github.com/repos/ErasmusMC-Bioinformatics/molclass/releases/latest"
resp = requests.get(url)
resp.raise_for_status()
json = resp.json()
tag = json["tag_name"]
return tag

0 comments on commit b80e01c

Please sign in to comment.