onthego / download_and_push.sh
Azeez98's picture
Update download_and_push.sh
3caf14d verified
raw
history blame contribute delete
872 Bytes
#!/bin/sh
# Set variables
REPO_URL="https://github.com/Mekhlafi98/onthego.git"
BRANCH="main"
COMMIT_MESSAGE="Add downloaded dependencies"
# Ensure directories exist and have correct permissions
mkdir -p /tmp/repo
mkdir -p /tmp/dependencies
chown -R root:root /tmp/repo
chown -R root:root /tmp/dependencies
# Clone the repository
git clone $REPO_URL /tmp/repo
cd /tmp/repo
# Download dependencies
pip download -r /usr/src/app/requirements.txt -d /tmp/dependencies
# Zip the dependencies
cd /tmp
zip -r dependencies.zip dependencies
# Move the zip file to the repo directory
mv dependencies.zip /tmp/repo
# Add, commit, and push the zip file
cd /tmp/repo
git add dependencies.zip
git config --global user.email "[email protected]"
git config --global user.name "Mekhlafi98"
git commit -m "$COMMIT_MESSAGE"
git push origin $BRANCH
# Clean up
rm -rf /tmp/repo