Skip to content

Instantly share code, notes, and snippets.

@Magnus167
Created June 2, 2024 17:01
Show Gist options
  • Save Magnus167/0b6b83b36b268cf8d71fa15e70fb9cfa to your computer and use it in GitHub Desktop.
Save Magnus167/0b6b83b36b268cf8d71fa15e70fb9cfa to your computer and use it in GitHub Desktop.
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