Skip to content

Commit 94af7ce

Browse files
Merge pull request #2336 from RitvikSardana/ci-installation
ci: dynamic branch setup
2 parents 3d0bf48 + 18dedac commit 94af7ce

File tree

2 files changed

+18
-3
lines changed

2 files changed

+18
-3
lines changed

.github/helpers/install.sh

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,18 @@ sudo apt remove mysql-server mysql-client
99
sudo apt install libcups2-dev redis-server mariadb-client libmariadb-dev
1010

1111
pip install frappe-bench
12-
13-
git clone "https://github.com/frappe/frappe" --branch "develop" --depth 1
12+
HD_BRANCH=${HD_BRANCH:-"develop"}
13+
FRAPPE_BRANCH=${FRAPPE_BRANCH:-"develop"}
14+
# if HD BRANCH IS Develop, then FRAPPE_BRANCH should also be develop
15+
if [ "${HD_BRANCH}" = "develop" ]; then
16+
FRAPPE_BRANCH="develop"
17+
# if HD BRANCH is Main, then FRAPPE_BRANCH should also be main
18+
elif [ "${HD_BRANCH}" = "main" ]; then
19+
FRAPPE_BRANCH="version-15"
20+
fi
21+
echo "Installing Frappe Framework"
22+
echo "Branch: ${FRAPPE_BRANCH}"
23+
git clone "https://github.com/frappe/frappe" --branch ${FRAPPE_BRANCH} --depth 1
1424
bench init --skip-assets --frappe-path ~/frappe --python "$(which python)" frappe-bench
1525

1626
mkdir ~/frappe-bench/sites/test_site
@@ -41,7 +51,11 @@ sed -i 's/schedule:/# schedule:/g' Procfile
4151
sed -i 's/socketio:/# socketio:/g' Procfile
4252
sed -i 's/redis_socketio:/# redis_socketio:/g' Procfile
4353

44-
bench get-app helpdesk "${GITHUB_WORKSPACE}"
54+
echo "Installing Helpdesk App"
55+
echo "Branch: ${HD_BRANCH}"
56+
echo "Installing from ${GITHUB_WORKSPACE}"
57+
58+
bench get-app helpdesk --branch "${HD_BRANCH}"
4559
bench setup requirements --dev
4660

4761

.github/workflows/server-tests.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,7 @@ jobs:
115115
TYPE: server
116116
FRAPPE_USER: ${{ github.event.inputs.user }}
117117
FRAPPE_BRANCH: ${{ github.event.inputs.branch }}
118+
HD_BRANCH: ${{ github.base_ref || github.ref_name }}
118119

119120
# - name: Run Tests
120121
# run: 'cd ~/frappe-bench/ && bench --site test_site run-tests --app helpdesk'

0 commit comments

Comments
 (0)