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.

35 lines
883 B
Bash

#!/bin/bash
# Create and initialize a Python Virtual Environment
echo "Creating virtual environment - .venv"
python3 -m venv .venv
echo "sourcing virtual environment - .venv"
source .venv/bin/activate
# Create a directory to put things in
echo "Creating 'setup' directory"
mkdir setup
# Move the relevant files into setup directory
echo "Moving function file(s) to setup dir"
cp cuckoo.py setup/
cd ./setup
# Install requirements
echo "pip installing requirements from requirements file in target directory"
pip install -r ../requirements.txt -t .
# Prepares the deployment package
echo "Zipping package"
zip -r ../package.zip ./*
# Remove the setup directory used
echo "Removing setup directory and virtual environment"
cd ..
rm -r ./setup
deactivate
rm -r .venv
# changing dirs back to dir from before
echo "Opening folder containg function package - 'package.zip'"
open .