Skip to content

Commit

Permalink
CI : add .env
Browse files Browse the repository at this point in the history
  • Loading branch information
juliecoust committed Dec 14, 2023
1 parent b624a3b commit ec27a3b
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 17 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ jobs:
matrix:
python-version: ["3.8"]
runs-on: ubuntu-latest
env:
DASH_ENV: TEST
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
Expand Down
3 changes: 3 additions & 0 deletions empty.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
DASH_ENV = "" #TST, DEV, PROD, DOCKER
ROOT_FOLDER = ""

21 changes: 4 additions & 17 deletions localData.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,28 +8,15 @@
import logging
from datetime import datetime
from fpdf import FPDF
from dotenv import dotenv_values

config = dotenv_values('.env')

now = datetime.now()
logging.basicConfig(filename="logs/"+str(now.year)+"-"+str(now.month)+".log",
level=logging.INFO, format="%(asctime)s | %(levelname)s | %(threadName)s |%(message)s")


def get_path_from_env(env):
if env == "PROD":
return os.path.expanduser("/piqv/plankton/")
elif env == "DEV":
return os.path.expanduser("../local_plankton/zooscan/")
else:
return os.path.expanduser("./dash_test/data/")


try:
env = os.environ['DASH_ENV']
except:
env = "err"

base_path = get_path_from_env(env)

base_path = os.path.expanduser(config["ROOT_FOLDER"])

def get_newest_zip(zips):
""" Return the newest object based on the "zip" property of the array of object "zips" """
Expand Down

0 comments on commit ec27a3b

Please sign in to comment.