Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 14 additions & 1 deletion baremetal-bootstrap
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ ${0##*/}
Usage:
From the machine to be provisioned:

curl https://raw.githubusercontent.com/loadsys/CakePHP-Shell-Scripts/master/${0##*/} | bash -s -- <REPO_CLONE_URL> <GIT_BRANCH> <APP_ENV_VALUE>
curl -sS https://raw.githubusercontent.com/loadsys/CakePHP-Shell-Scripts/master/baremetal-bootstrap | bash -s -- <REPO_CLONE_URL> <GIT_BRANCH> <APP_ENV_VALUE>

Should be run as the user the app will run as on the target server.

Expand Down Expand Up @@ -93,6 +93,19 @@ fi
# EOD


if [ -n "$(which git-lfs)" ]; then
echo "## Git-LFS support appears to already be installed."
elif [ -n "$(which brew)" ]; then
echo "## Installing git-lfs support using Homebrew."
brew install git-lfs
git lfs install
elif [ -n "$(which port)" ]; then
echo "## Installing git-lfs support using MacPorts."
sudo port install git-lfs
git lfs install
fi


echo "## Cloning repo."
git clone -b $GIT_BRANCH $REPO_CLONE_URL repo

Expand Down
4 changes: 2 additions & 2 deletions deploy
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ echo "## Current commit is $EXISTINGBRANCH ($EXISTINGCOMMIT)";

# Update repository.
echo "## Pulling changes from remote repo.";
git fetch origin refs/heads/*:refs/remotes/origin/* +refs/tags/*:refs/tags/*
git fetch origin --prune refs/heads/*:refs/remotes/origin/* +refs/tags/*:refs/tags/*


# Apply database updates, one way or another.
Expand All @@ -118,7 +118,7 @@ fi
# forward on the same branch, or switch to the HEAD of a different branch.
# if [ "$ARG_NEWCOMMIT" = "origin/master" ]; then
echo "## Merging upstream changes from: $ARG_NEWCOMMIT";
git merge $ARG_NEWCOMMIT
git merge --ff-only $ARG_NEWCOMMIT
# else
# echo "## Checking out new commit: $ARG_NEWCOMMIT";
# git checkout $ARG_NEWCOMMIT
Expand Down
4 changes: 1 addition & 3 deletions tests-run
Original file line number Diff line number Diff line change
Expand Up @@ -99,15 +99,13 @@ if (isset($argv[1]) && $argv[1] == '-h') {
// Set up variables.
array_shift($argv); // Strip the script name off and throw it away.
$argc--; // Reindex argc so we can use it directly on remaining args.
$args = '';

if ($argc) {
$args = array_map('Loadsys\CakePHPShellScripts\TestsRun\findTestCase', $argv);
$args = array_map('escapeshellarg', $args);
$args = implode(' ', $args);
// $args = '"' . $args . '"';
$args = ' ' . $args;
} else {
$args = '';
}

$testCmd = "bin/vagrant-exec \"bin/phpunit{$args}\"";
Expand Down
12 changes: 12 additions & 0 deletions watch
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/usr/bin/env bash
# Wrapper around `fswatch` to pass changed files into `bin/tests-run`.

#@TODO: Bail if fswatch is not available. (add to readme as a dep.)

echo "## Test watcher running. Save a file to execute the corresponding test in vagrant."

fswatch -0 src/ tests/ | xargs -0 -n 1 -I {} sh -c 'echo " - {}"; bin/tests-run "{}"'

#@TODO: Use a custom phpunit.xml that does not produce TWO coverage reports by default.

#@TODO: Suppress tests/bootstrap.php from clearing caches? (reduce output "noise")