-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
31 changed files
with
218 additions
and
96 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
#!/bin/bash | ||
|
||
# Standard boilerplate code for getting the paths and environment variables we need. | ||
script_path="$( cd "$(dirname "$0")" ; pwd -P )" | ||
project_path="$( cd $script_path && cd ..; pwd -P )" | ||
export $(grep -E -v '^#' $project_path/.env | xargs) | ||
sub_path="${PWD//$LOCAL_SRC/}" | ||
remote_path="$REMOTE_SRC/$sub_path" | ||
local_path="$LOCAL_SRC/$sub_path" | ||
|
||
container="$1" | ||
shift | ||
if [[ -z "$container" ]]; then | ||
echo "Container must be specified" | ||
exit 1 | ||
fi | ||
|
||
# If just 'php' is specified, then dynamically work out which one to actually use based upon the site composer.json | ||
if [[ "$container" == "php" ]]; then | ||
if [[ ! -f "$local_path/version.php" ]]; then | ||
echo "This command must be run from a Totara site directory if 'php' is specified for the container" | ||
exit 1 | ||
fi | ||
php_container=($(php "$project_path/bin/helpers/php_container.php" "$local_path")) | ||
container=${php_container[0]} | ||
echo -e "\x1B[2mUsing PHP Container: $container\x1B[0m" | ||
fi | ||
|
||
# If we are bashing into php/apache/nginx, then lets make the shell begin in the remote directory | ||
extra_args="" | ||
if [[ "$container" =~ "php" || "$container" =~ "nginx" || "$container" =~ "apache" ]]; then | ||
extra_args="-w $remote_path" | ||
fi | ||
|
||
# Quote command to be reused as shell input | ||
command_str=$(printf " %q" "$@") | ||
|
||
$script_path/tdocker exec $extra_args "$container" "$command_str" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#!/bin/bash | ||
|
||
# Standard boilerplate code for getting the paths and environment variables we need. | ||
script_path="$( cd "$(dirname "$0")" ; pwd -P )" | ||
project_path="$( cd $script_path && cd ..; pwd -P )" | ||
export $(grep -E -v '^#' $project_path/.env | xargs) | ||
|
||
if [[ -z "$1" ]]; then | ||
$script_path/texec php "${INTERACTIVE_SHELL:-zsh}" | ||
else | ||
# Quote command to be reused as shell input | ||
command_str=$(printf " %q" "$@") | ||
# Handle being called with a php script instead of a command | ||
if [[ $1 == *.php ]]; then | ||
command_str="php $command_str" | ||
fi | ||
$script_path/texec php bash -ic "$command_str" | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,16 @@ | ||
#!/bin/bash | ||
|
||
# Standard boilerplate code for getting the paths and environment variables we need. | ||
script_path="$( cd "$(dirname "$0")" ; pwd -P )" | ||
project_path="$( cd $script_path && cd ..; pwd -P )" | ||
export $(grep -E -v '^#' $project_path/.env | xargs) | ||
sub_path="${PWD//$LOCAL_SRC/}" | ||
remote_path="$REMOTE_SRC/$sub_path" | ||
local_path="$LOCAL_SRC/$sub_path" | ||
|
||
if [ ! -f "$local_path/version.php" ]; then | ||
remote_path="$REMOTE_SRC" | ||
# If the container isn't specified, then we just default to the default php container. | ||
container="$1" | ||
if [[ -z "$container" ]]; then | ||
container="php" | ||
fi | ||
|
||
container="$1" | ||
if [[ ! "$container" =~ "php" ]]; then | ||
echo "tzsh only supports php containers" | ||
exit 1 | ||
fi | ||
|
||
# If just 'php' is specified, then dynamically work out which one to actually use based upon the site composer.json | ||
if [[ "$container" == "php" ]]; then | ||
if [[ ! -f "$local_path/version.php" ]]; then | ||
echo "This command must be run from a Totara site directory if 'php' is specified for the container" | ||
exit 1 | ||
fi | ||
php_container=($(php "$project_path/bin/helpers/php_container.php" "$local_path")) | ||
container=${php_container[0]} | ||
fi | ||
|
||
$script_path/tdocker exec -w $remote_path "$container" /bin/zsh | ||
$script_path/texec "$container" /bin/zsh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
# Add any .yml or .yaml files in this folder to add additional or override existing docker-compose configurations | ||
# Add any .yml or .yaml files in this folder to add additional or override existing docker compose configurations |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,13 @@ | ||
FROM totara/docker-dev-php71:latest | ||
|
||
RUN pecl install -f xdebug-2.9.6 && docker-php-ext-enable xdebug.so | ||
RUN pecl install -f xdebug-2.9.8 && docker-php-ext-enable xdebug.so | ||
RUN pecl install -f pcov && docker-php-ext-enable pcov.so | ||
|
||
RUN echo "xdebug.remote_enable=1" >> /usr/local/etc/php/conf.d/xdebug.ini \ | ||
&& echo "xdebug.remote_autostart=0" >> /usr/local/etc/php/conf.d/xdebug.ini | ||
&& echo "xdebug.remote_autostart=0" >> /usr/local/etc/php/conf.d/xdebug.ini | ||
|
||
# Set some sensible defaults | ||
RUN echo "pcov.enabled=1" >> /usr/local/etc/php/conf.d/docker-php-ext-pcov.ini \ | ||
&& echo "pcov.exclude='~(vendor|tests|node_modules|.git|client|.scannerwork)~'" >> /usr/local/etc/php/conf.d/docker-php-ext-pcov.ini \ | ||
&& echo "pcov.initial.memory=1073741824" >> /usr/local/etc/php/conf.d/docker-php-ext-pcov.ini \ | ||
&& echo "pcov.initial.files=30000" >> /usr/local/etc/php/conf.d/docker-php-ext-pcov.ini |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,13 @@ | ||
FROM totara/docker-dev-php72:latest | ||
|
||
RUN pecl install -f xdebug-3.1.1 && docker-php-ext-enable xdebug.so | ||
RUN pecl install -f xdebug-3.1.6 && docker-php-ext-enable xdebug.so | ||
RUN pecl install -f pcov && docker-php-ext-enable pcov.so | ||
|
||
RUN echo "xdebug.mode=debug" >> /usr/local/etc/php/conf.d/xdebug.ini \ | ||
&& echo "xdebug.start_with_request=trigger" >> /usr/local/etc/php/conf.d/xdebug.ini | ||
|
||
# Set some sensible defaults | ||
RUN echo "pcov.enabled=1" >> /usr/local/etc/php/conf.d/docker-php-ext-pcov.ini \ | ||
&& echo "pcov.exclude='~(vendor|tests|node_modules|.git|client|.scannerwork)~'" >> /usr/local/etc/php/conf.d/docker-php-ext-pcov.ini \ | ||
&& echo "pcov.initial.memory=1073741824" >> /usr/local/etc/php/conf.d/docker-php-ext-pcov.ini \ | ||
&& echo "pcov.initial.files=30000" >> /usr/local/etc/php/conf.d/docker-php-ext-pcov.ini |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,13 @@ | ||
FROM totara/docker-dev-php73:latest | ||
|
||
RUN pecl install -f xdebug-3.1.1 && docker-php-ext-enable xdebug.so | ||
RUN pecl install -f xdebug-3.1.6 && docker-php-ext-enable xdebug.so | ||
RUN pecl install -f pcov && docker-php-ext-enable pcov.so | ||
|
||
RUN echo "xdebug.mode=debug" >> /usr/local/etc/php/conf.d/xdebug.ini \ | ||
&& echo "xdebug.start_with_request=trigger" >> /usr/local/etc/php/conf.d/xdebug.ini | ||
|
||
# Set some sensible defaults | ||
RUN echo "pcov.enabled=1" >> /usr/local/etc/php/conf.d/docker-php-ext-pcov.ini \ | ||
&& echo "pcov.exclude='~(vendor|tests|node_modules|.git|client|.scannerwork)~'" >> /usr/local/etc/php/conf.d/docker-php-ext-pcov.ini \ | ||
&& echo "pcov.initial.memory=1073741824" >> /usr/local/etc/php/conf.d/docker-php-ext-pcov.ini \ | ||
&& echo "pcov.initial.files=30000" >> /usr/local/etc/php/conf.d/docker-php-ext-pcov.ini |
Oops, something went wrong.