File size: 872 Bytes
f77447e
 
 
1bfaeb7
f77447e
 
 
92d8c0c
1bfaeb7
 
 
 
8ec67ed
f77447e
1bfaeb7
 
f77447e
 
1bfaeb7
f77447e
 
1bfaeb7
f77447e
 
8ec67ed
1bfaeb7
8ec67ed
f77447e
1bfaeb7
f77447e
3caf14d
 
f77447e
 
 
 
1bfaeb7
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#!/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