-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathsetup.sh
31 lines (23 loc) · 833 Bytes
/
setup.sh
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
#!/bin/bash
# Ensure the GIT_REPO_PATH directory exists
mkdir -p ${GIT_REPO_PATH}
cd ${GIT_REPO_PATH}
# Initialize the repository and configure the remote and branch
( (git init;
git remote add origin ${GIT_REPO_URL};
git fetch;
git checkout -t origin/${GIT_REPO_BRANCH} -f) || true )
# Configure the repository as a safe directory for Git
cd ${GIT_REPO_PATH}
git config --global --add safe.directory ${GIT_REPO_PATH}
# Fetch the latest changes and reset to match the remote branch
git fetch origin
git reset --hard origin/${GIT_REPO_BRANCH}
# Initialize and update Git submodules
git submodule update --init --recursive
# Install Python dependencies
pip install -r requirements.txt
# Install system packages from pkglist
apt -y install $(cat pkglist)
# Run the main script
${GIT_REPO_PATH}/run.sh