Azeez98 commited on
Commit
1bfaeb7
·
verified ·
1 Parent(s): 92d8c0c

Update download_and_push.sh

Browse files
Files changed (1) hide show
  1. 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/yourusername/yourrepository.git"
5
  BRANCH="main"
6
  COMMIT_MESSAGE="Add downloaded dependencies"
7
 
8
  # Ensure directories exist and have correct permissions
9
- mkdir -p /usr/src/app/repo
10
- mkdir -p /usr/src/app/dependencies
11
- chown -R root:root /usr/src/app/repo
12
- chown -R root:root /usr/src/app/dependencies
13
 
14
  # Clone the repository
15
- git clone $REPO_URL /usr/src/app/repo
16
- cd /usr/src/app/repo
17
 
18
  # Download dependencies
19
- pip download -r /usr/src/app/requirements.txt -d /usr/src/app/dependencies
20
 
21
  # Zip the dependencies
22
- cd /usr/src/app
23
  zip -r dependencies.zip dependencies
24
 
25
  # Move the zip file to the repo directory
26
- mv dependencies.zip /usr/src/app/repo
27
 
28
  # Add, commit, and push the zip file
29
- cd /usr/src/app/repo
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 /usr/src/app/repo
 
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