-
-
Save Magnus167/0b6b83b36b268cf8d71fa15e70fb9cfa to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import glob, os, shutil, datetime as dt | |
fname = f'deployment-{dt.datetime.now().strftime('%Y-%m-%d_%H-%M-%S')}' | |
fname = r'C:/' + fname | |
os.makedirs(fname, exist_ok=True) | |
curr_path = os.path.abspath(os.getcwd()) | |
files = glob.glob('*.py') + glob.glob('*.yml') + glob.glob('*.yaml') | |
# copy virtual environment | |
shutil.copytree('.venv', os.path.join(fname, '.venv')) | |
# copy the entire directory structure | |
for file in files: | |
shutil.copy(file, fname) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment