You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
37 lines
1.1 KiB
Batchfile
37 lines
1.1 KiB
Batchfile
4 years ago
|
rem Create and initialize a Python Virtual Environment
|
||
|
echo "Creating virtual env - .venv"
|
||
|
python3 -m venv .venv
|
||
|
|
||
|
echo "starting virtualenv - .venv"
|
||
|
call .venv\Scripts\activate.bat
|
||
|
|
||
|
rem Create a directory to put things in
|
||
|
echo "Creating 'setup' directory"
|
||
|
mkdir setup
|
||
|
|
||
|
rem Move the relevant files into setup directory
|
||
|
echo "Moving function file(s) to setup dir"
|
||
|
xcopy .\twitter\* setup\ /s /i
|
||
|
cd .\setup
|
||
|
|
||
|
rem Install requirements
|
||
|
echo "pip installing requirements from requirements file in target directory"
|
||
|
pip install -r ..\requirements.txt -t .
|
||
|
|
||
|
rem Prepares the deployment package
|
||
|
echo "Setting up your 7zip PATH - This assumes the installation location of 7zip is in C:\Program Files\7-Zip\"
|
||
|
set PATH=%PATH%;C:\Program Files\7-Zip\
|
||
|
|
||
|
echo "Zipping package"
|
||
|
7z a -r ..\winston_bot.zip .\*
|
||
|
|
||
|
rem Remove the setup directory used
|
||
|
echo "Removing setup directory and virtual environment"
|
||
|
cd ..
|
||
|
rd /Q /S .\setup
|
||
|
call .venv\Scripts\deactivate.bat
|
||
|
rd /Q /S .\.venv
|
||
|
|
||
|
rem changing dirs back to dir from before
|
||
|
echo "Opening folder containing function package - 'package.zip'"
|
||
|
explorer .
|