Update download_and_push.sh
Browse files- download_and_push.sh +12 -12
download_and_push.sh
CHANGED
@@ -1,32 +1,32 @@
|
|
1 |
#!/bin/sh
|
2 |
|
3 |
# Set variables
|
4 |
-
REPO_URL="https://github.com/
|
5 |
BRANCH="main"
|
6 |
COMMIT_MESSAGE="Add downloaded dependencies"
|
7 |
|
8 |
# Ensure directories exist and have correct permissions
|
9 |
-
mkdir -p /
|
10 |
-
mkdir -p /
|
11 |
-
chown -R root:root /
|
12 |
-
chown -R root:root /
|
13 |
|
14 |
# Clone the repository
|
15 |
-
git clone $REPO_URL /
|
16 |
-
cd /
|
17 |
|
18 |
# Download dependencies
|
19 |
-
pip download -r /usr/src/app/requirements.txt -d /
|
20 |
|
21 |
# Zip the dependencies
|
22 |
-
cd /
|
23 |
zip -r dependencies.zip dependencies
|
24 |
|
25 |
# Move the zip file to the repo directory
|
26 |
-
mv dependencies.zip /
|
27 |
|
28 |
# Add, commit, and push the zip file
|
29 |
-
cd /
|
30 |
git add dependencies.zip
|
31 |
git config --global user.email "[email protected]"
|
32 |
git config --global user.name "Your Name"
|
@@ -34,4 +34,4 @@ git commit -m "$COMMIT_MESSAGE"
|
|
34 |
git push origin $BRANCH
|
35 |
|
36 |
# Clean up
|
37 |
-
rm -rf /
|
|
|
1 |
#!/bin/sh
|
2 |
|
3 |
# Set variables
|
4 |
+
REPO_URL="https://github.com/Mekhlafi98/onthego.git"
|
5 |
BRANCH="main"
|
6 |
COMMIT_MESSAGE="Add downloaded dependencies"
|
7 |
|
8 |
# Ensure directories exist and have correct permissions
|
9 |
+
mkdir -p /tmp/repo
|
10 |
+
mkdir -p /tmp/dependencies
|
11 |
+
chown -R root:root /tmp/repo
|
12 |
+
chown -R root:root /tmp/dependencies
|
13 |
|
14 |
# Clone the repository
|
15 |
+
git clone $REPO_URL /tmp/repo
|
16 |
+
cd /tmp/repo
|
17 |
|
18 |
# Download dependencies
|
19 |
+
pip download -r /usr/src/app/requirements.txt -d /tmp/dependencies
|
20 |
|
21 |
# Zip the dependencies
|
22 |
+
cd /tmp
|
23 |
zip -r dependencies.zip dependencies
|
24 |
|
25 |
# Move the zip file to the repo directory
|
26 |
+
mv dependencies.zip /tmp/repo
|
27 |
|
28 |
# Add, commit, and push the zip file
|
29 |
+
cd /tmp/repo
|
30 |
git add dependencies.zip
|
31 |
git config --global user.email "[email protected]"
|
32 |
git config --global user.name "Your Name"
|
|
|
34 |
git push origin $BRANCH
|
35 |
|
36 |
# Clean up
|
37 |
+
rm -rf /tmp/repo
|