Skip to content

Commit

Permalink
Merge branch 'develop' of github.com:2pisoftware/cmfive-boilerplate i…
Browse files Browse the repository at this point in the history
…nto feat/phpunit-10
  • Loading branch information
mattbell87 committed Mar 14, 2024
2 parents cdf3d5f + 4f0244d commit 7feb2c0
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 2 deletions.
34 changes: 33 additions & 1 deletion .codepipeline/docker/setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -38,18 +38,50 @@ chmod ugo=rwX -R cache/ storage/ uploads/
echo "Running cmfive.php actions"
echo

# Ensure system files are installed to /system
function checkSymlink() {
pushd /var/www/html
from_dir="composer/vendor/2pisoftware/cmfive-core/system"
link_name="system"
if [ -L "$link_name" ]; then
echo "✅ System dir is a symlink"
else
# Remove if it's a file or dir
if [ -f "$link_name" ] || [ -d "$link_name" ]; then
echo "❌ Removing existing system dir"
rm -rf "$link_name"
fi
echo "➕ Creating system dir"
ln -s "$from_dir" "$link_name"
if [ $? -eq 0 ]; then
echo "✅ Symlink created from $from_dir to $link_name"
else
echo "❌ Failed to create symlink from $from_dir to $link_name"
fi
fi
popd
}

# If system dir exists but composer doesnt print a warning
if [ -f "/var/www/html/system/web.php" ] && [ ! -f "/var/www/html/composer.json" ]; then
echo "⚠️ Warning: System dir exists but composer packages are missing"
fi

# If CMFIVE_CORE_BRANCH is set print to logs
if [ -n "$CMFIVE_CORE_BRANCH" ]; then
echo "Using CMFIVE_CORE_BRANCH [ $CMFIVE_CORE_BRANCH ]"
fi

# System dir and composer packages must exist
if [ ! -f "/var/www/html/system/web.php" ] || [ ! -f "/var/www/html/composer.json" ] || [ -n "$CMFIVE_CORE_BRANCH" ]; then
CMFIVE_CORE_BRANCH=${CMFIVE_CORE_BRANCH:-master} # Default to master if not set
rm -rf /var/www/html/system # Remove system dir to ensure correct core is installed
echo "➕ Installing core from branch [ $CMFIVE_CORE_BRANCH ]"
php cmfive.php install core $CMFIVE_CORE_BRANCH
echo "✔️ Core installed"
checkSymlink
echo "✔️ New core installed"
else
echo "Using bundled core"
echo "✔️ Core already installed"
fi

Expand Down
2 changes: 1 addition & 1 deletion test/playwright/cmfive.utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ export class CmfiveHelper {
await navbarCategory.hover();
}

await navbarCategory.getByRole('link', {name: option}).click();
await navbarCategory.getByRole('link', {name: option, exact: true}).click();
}

// Call exactly once per test before any dialogs pop up
Expand Down

0 comments on commit 7feb2c0

Please sign in to comment.