From 2ccbe9121385ed57ac24fdd3a1200b995c80d41d Mon Sep 17 00:00:00 2001 From: Rashmil Panchani Date: Wed, 4 Oct 2023 13:10:54 -0400 Subject: [PATCH 1/3] update fonts submodule --- fonts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fonts b/fonts index 227b68a..cdfda45 160000 --- a/fonts +++ b/fonts @@ -1 +1 @@ -Subproject commit 227b68a9e9fe3190f2486f677761ea546b82cd17 +Subproject commit cdfda45cc84a4d3a0adaedbe74e57c92a0b7945c From 33db2782339f5a5bacf0edaa50fd4f50be4a029a Mon Sep 17 00:00:00 2001 From: Rashmil Panchani Date: Tue, 17 Oct 2023 15:43:07 -0400 Subject: [PATCH 2/3] data update --- data | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/data b/data index a1db232..11789c9 160000 --- a/data +++ b/data @@ -1 +1 @@ -Subproject commit a1db2329362a5a6103631b15a9f6c5e19edb3d34 +Subproject commit 11789c98f1c96767225143cae4074c56b59b2732 From f106420e0a749d03d7d9b9e5082ea4160bf0cdf2 Mon Sep 17 00:00:00 2001 From: Rashmil Panchani <32737711+Rashmil-1999@users.noreply.github.com> Date: Tue, 12 Dec 2023 16:59:39 +0530 Subject: [PATCH 3/3] Add version to workflow (#75) * update fonts submodule * data update * update ci file to use version from .toml file * quick fix for pytest --- .github/workflows/ci.yml | 5 +++-- app/crud/crud_station.py | 3 ++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c7b4c22..a3ec43a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -29,7 +29,7 @@ jobs: fi echo "GITHUB_BRANCH=${BRANCH}" >> $GITHUB_ENV if [ "$BRANCH" == "main" ]; then - version=$(cat package.json | grep \"version\" | head -1 | awk -F= "{ print $2 }" | sed 's/[version:,",]//g' | tr -d '[[:space:]]') + version=$(awk -F= '/^version/ { print $2}' pyproject.toml | sed 's/[ "]//g') tags="latest" oldversion="" while [ "${oldversion}" != "${version}" ]; do @@ -52,6 +52,7 @@ jobs: uses: elgohr/Publish-Docker-Github-Action@3.04 env: BRANCH: ${{ env.GITHUB_BRANCH }} + VERSION: ${{ env.VERSION }} BUILDNUMBER: ${{ github.run_number }} GITSHA1: ${{ github.sha }} with: @@ -60,7 +61,7 @@ jobs: password: ${{ secrets.GITHUB_TOKEN }} registry: ghcr.io tags: "${{ env.TAGS }}" - buildargs: BRANCH,BUILDNUMBER,GITSHA1 + buildargs: BRANCH,VERSION,BUILDNUMBER,GITSHA1 dockerfile: docker/Dockerfile - name: Deploy to prod server diff --git a/app/crud/crud_station.py b/app/crud/crud_station.py index dad1d46..a24a79f 100644 --- a/app/crud/crud_station.py +++ b/app/crud/crud_station.py @@ -15,7 +15,8 @@ def get(self, db: Session, id: Any) -> Optional[Station]: station = cast( Station, db.query(self.model).filter(self.model.name == id).first() ) - station.species = binomial_only(station.species) + if station: + station.species = binomial_only(station.species) return station