Skip to content

Commit f4b69b9

Browse files
Add macOS support for installation scripts and update DAppNode core start function
1 parent bb6bdff commit f4b69b9

2 files changed

Lines changed: 26 additions & 13 deletions

File tree

.github/workflows/test.yml

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,26 @@ jobs:
3131
run: |
3232
sudo /bin/bash ./scripts/dappnode_uninstall.sh y
3333
34+
scripts-macos:
35+
name: test scripts (macOS)
36+
runs-on: macos-latest
37+
38+
steps:
39+
- name: Checkout
40+
uses: actions/checkout@v6
41+
- name: Install Docker
42+
uses: docker-practice/actions-setup-docker@master # TODO: use pre-install script instead
43+
- name: Install DAppNode
44+
run: |
45+
/bin/bash ./scripts/dappnode_install.sh
46+
3447
iso:
3548
name: test Debian and Ubuntu ISO
3649
runs-on: ubuntu-latest
3750

3851
steps:
3952
- name: Checkout
40-
uses: actions/checkout@v4
53+
uses: actions/checkout@v6
4154

4255
# Create Debian ISO
4356
- name: create Debian ISO

scripts/dappnode_install.sh

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,7 @@ patch_compose_paths() {
122122
sed_inplace "s|/usr/src/dappnode|${DAPPNODE_DIR}|g" "$file"
123123
}
124124

125+
# TODO: remove once profile macos-compatibility published
125126
# Patch .dappnode_profile for macOS compatibility
126127
patch_profile_for_macos() {
127128
local profile="$1"
@@ -238,6 +239,7 @@ fi
238239
[ -f "$DAPPNODE_PROFILE" ] || download_file "${DAPPNODE_PROFILE}" "${PROFILE_URL}"
239240

240241
# Patch profile for macOS compatibility (replace GNU-isms and hardcoded Linux paths)
242+
# TODO: remove once profile macos-compatibility published
241243
if $IS_MACOS; then
242244
patch_profile_for_macos "$DAPPNODE_PROFILE"
243245
fi
@@ -447,17 +449,11 @@ add_profile_to_shell() {
447449
done
448450
}
449451

450-
dappnode_start() {
452+
dappnode_core_start() {
451453
echo -e "\e[32mDAppNode starting...\e[0m" 2>&1 | tee -a $LOGFILE
452-
# shellcheck disable=SC1090
453-
source "${DAPPNODE_PROFILE}" >/dev/null 2>&1
454-
455-
# Execute `compose-up` independently
456-
# To execute `compose-up` against more than 1 compose, composes files must share compose file version (e.g 3.5)
457-
for comp in "${DNCORE_YMLS_ARRAY[@]}"; do
458-
docker compose -f "$comp" up -d 2>&1 | tee -a $LOGFILE
459-
echo "${comp} started" 2>&1 | tee -a $LOGFILE
460-
done
454+
455+
# Use DNCORE_YMLS from the profile (populated after re-sourcing post-download)
456+
docker compose $DNCORE_YMLS up -d 2>&1 | tee -a $LOGFILE
461457
echo -e "\e[32mDAppNode started\e[0m" 2>&1 | tee -a $LOGFILE
462458

463459
# Add profile sourcing to user's shell configuration
@@ -584,14 +580,18 @@ dappnode_core_build
584580
echo -e "\e[32mDownloading DAppNode Core...\e[0m" 2>&1 | tee -a $LOGFILE
585581
dappnode_core_download
586582

583+
# Re-source profile now that compose files exist, so DNCORE_YMLS is populated
584+
# shellcheck disable=SC1090
585+
source "${DAPPNODE_PROFILE}"
586+
587587
echo -e "\e[32mLoading DAppNode Core...\e[0m" 2>&1 | tee -a $LOGFILE
588588
dappnode_core_load
589589

590590
# --- Start DAppNode ---
591591
if $IS_LINUX; then
592592
if [ ! -f "${DAPPNODE_DIR}/.firstboot" ]; then
593593
echo -e "\e[32mDAppNode installed\e[0m" 2>&1 | tee -a $LOGFILE
594-
dappnode_start
594+
dappnode_core_start
595595
fi
596596

597597
# Run test in interactive terminal (first boot only)
@@ -605,7 +605,7 @@ fi
605605

606606
if $IS_MACOS; then
607607
echo -e "\e[32mDAppNode installed\e[0m" 2>&1 | tee -a $LOGFILE
608-
dappnode_start
608+
dappnode_core_start
609609

610610
echo -e "\n\e[33mWaiting for VPN initialization...\e[0m"
611611
sleep 10

0 commit comments

Comments
 (0)