Improve path detection

Signed-off-by: baalajimaestro <me@baalajimaestro.me>
This commit is contained in:
baalajimaestro 2022-09-25 16:40:41 +05:30
parent f9e2b2e53d
commit 7af098a4fd
Signed by: baalajimaestro
GPG key ID: F93C394FE9BBAFD5
2 changed files with 8 additions and 2 deletions

View file

@ -8,6 +8,7 @@
from git import Repo
import os
from shutil import copytree
from pathlib import Path
from glob import glob
import subprocess
from time import time
@ -30,7 +31,9 @@ enc_repo_pass = os.environ.get("ENCRYPTED_REPO_PASSWORD")
enc_key = os.environ.get("ENCRYPTION_KEY")
# Create our encrypted directory base
base_dir = os.getcwd()
cwd = os.getcwd()
path = Path(cwd)
base_dir = str(path.parent.absolute())
current_time = str(int(time()))
os.mkdir(enc_path)
os.chdir(enc_path)

View file

@ -19,8 +19,11 @@ content_repo_id = os.environ.get("CONTENT_REPO_ID")
gitlab_token = os.environ.get("GITLAB_TOKEN")
# Get the time and create a tag of epoch
cwd = os.getcwd()
path = Path(cwd)
base_dir = str(path.parent.absolute())
current_time = str(int(time()))
repo = Repo(os.getcwd())
repo = Repo(base_dir)
repo.create_tag(current_time)
# Nuke the remote if it existed