diff --git a/.github/workflows/coordinator-image.yml b/.github/workflows/coordinator-image.yml index 9393d003..b3bdbe79 100644 --- a/.github/workflows/coordinator-image.yml +++ b/.github/workflows/coordinator-image.yml @@ -71,7 +71,8 @@ jobs: - name: 'Save Commit Long Hash to TXT File' run: | - echo ${{ steps.commit.outputs.long }}>"commit_sha.txt" + rm commit_sha + echo ${{ steps.commit.outputs.long }}>"commit_sha" - name: 'Build and push Docker image' uses: docker/build-push-action@v4 diff --git a/.gitignore b/.gitignore index ab8e851c..b591492f 100755 --- a/.gitignore +++ b/.gitignore @@ -646,7 +646,6 @@ frontend/src/components/PaymentMethods/Icons/webp* frontend/static/frontend/** docs/.jekyll-cache* docs/_site* -commit_sha.txt node # mobile frontend js diff --git a/api/utils.py b/api/utils.py index 6a1cbb01..a23f52b1 100644 --- a/api/utils.py +++ b/api/utils.py @@ -155,16 +155,12 @@ def get_lnd_version(): robosats_commit_cache = {} -@ring.dict(robosats_commit_cache, expire=3600) +@ring.dict(robosats_commit_cache, expire=99999) def get_robosats_commit(): - commit = os.popen('git log -n 1 --pretty=format:"%H"') - commit_hash = commit.read() - - # .git folder is included in .dockerignore. But automatic build will drop in a commit_sha.txt file on root - if commit_hash is None or commit_hash == "": - with open("commit_sha.txt") as f: - commit_hash = f.read() + # .git folder is included in .dockerignore. The build workflow will drop the commit_sha file in root + with open("commit_sha") as f: + commit_hash = f.read() return commit_hash diff --git a/commit_sha b/commit_sha new file mode 100644 index 00000000..a1b3b555 --- /dev/null +++ b/commit_sha @@ -0,0 +1 @@ +00000000000000000000 dev \ No newline at end of file