Skip to content

Commit

Permalink
Merge pull request #18 from falko189/master
Browse files Browse the repository at this point in the history
Added few helpers to the plan.sh
  • Loading branch information
richdynamix authored May 16, 2019
2 parents dfd6f46 + 05bd94e commit abe678f
Show file tree
Hide file tree
Showing 3 changed files with 60 additions and 46 deletions.
12 changes: 12 additions & 0 deletions tools/docker/usr/local/share/container/plan.sh
Original file line number Diff line number Diff line change
Expand Up @@ -53,4 +53,16 @@ do_phpmd() {

do_phpstan() {
as_code_owner "vendor/bin/phpstan analyse app --level=0"
}

do_supervisor() {
supervisorctl -c /etc/supervisor/supervisord.conf -u supervisor -p supervisor $1
}

do_clear_cache_cloudflare() {
curl -X POST "https://api.cloudflare.com/client/v4/zones/${CLOUD_FLARE_ZONE}/purge_cache" \
-H "X-Auth-Email: ${CLOUD_FLARE_EMAIL}" \
-H "X-Auth-Key: ${CLOUD_FLARE_API_KEY}" \
-H "Content-Type: application/json" \
--data '{"purge_everything":true}'
}
47 changes: 47 additions & 0 deletions tools/docker/usr/local/share/env/20-docker-env
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
#!/bin/bash

DEVELOPMENT_MODE=${DEVELOPMENT_MODE:-true}
DEVELOPMENT_MODE="$(convert_to_boolean_string "$DEVELOPMENT_MODE")"
export DEVELOPMENT_MODE

COMPOSER_INSTALL_FLAGS="--no-interaction --optimize-autoloader --ignore-platform-reqs"

if [ -z "$DEVELOPMENT_MODE" ] || [ "$DEVELOPMENT_MODE" != 'true' ]; then
DEFAULT_COMPOSER_FLAGS="${DEFAULT_COMPOSER_FLAGS} --no-dev "
fi

export COMPOSER_INSTALL_FLAGS=${COMPOSER_INSTALL_FLAGS:-$COMPOSER_INSTALL_FLAGS}

START_MODE_CRON=${START_MODE_CRON:-true}
START_MODE_CRON="$(convert_to_boolean_string "$START_MODE_CRON")"
export START_MODE_CRON

START_MODE_WEB=${START_MODE_WEB:-true}
START_MODE_WEB="$(convert_to_boolean_string "$START_MODE_WEB")"
export START_MODE_WEB

WEB_HTTPS_ONLY=${WEB_HTTPS_ONLY:-true}
WEB_HTTPS_ONLY="$(convert_to_boolean_string "$WEB_HTTPS_ONLY")"
export WEB_HTTPS_ONLY

START_HORIZON=${START_HORIZON:-false}
START_HORIZON="$(convert_to_boolean_string "$START_HORIZON")"
export START_HORIZON

START_QUEUE=${START_QUEUE:-true}
START_QUEUE="$(convert_to_boolean_string "$START_QUEUE")"
export START_QUEUE

RUN_LARAVEL_CRON=${RUN_LARAVEL_CRON:-false}
RUN_LARAVEL_CRON="$(convert_to_boolean_string "$RUN_LARAVEL_CRON")"
export RUN_LARAVEL_CRON

AUTH_HTTP_ENABLED=${AUTH_HTTP_ENABLED:-false}
AUTH_HTTP_ENABLED="$(convert_to_boolean_string "$AUTH_HTTP_ENABLED")"
export AUTH_HTTP_ENABLED

export AUTH_HTTP_REALM=${AUTH_HTTP_REALM:-"Protected System"}
export AUTH_HTTP_FILE=/etc/nginx/custom-htpasswd-path

export WORK_DIRECTORY=${WORK_DIRECTORY:-/app}
export WEB_DIRECTORY=${WEB_DIRECTORY:-${WORK_DIRECTORY}/public}
Original file line number Diff line number Diff line change
@@ -1,50 +1,5 @@
#!/bin/bash

DEVELOPMENT_MODE=${DEVELOPMENT_MODE:-true}
DEVELOPMENT_MODE="$(convert_to_boolean_string "$DEVELOPMENT_MODE")"
export DEVELOPMENT_MODE

COMPOSER_INSTALL_FLAGS="--no-interaction --optimize-autoloader --ignore-platform-reqs"

if [ -z "$DEVELOPMENT_MODE" ] || [ "$DEVELOPMENT_MODE" != 'true' ]; then
DEFAULT_COMPOSER_FLAGS="${DEFAULT_COMPOSER_FLAGS} --no-dev "
fi

export COMPOSER_INSTALL_FLAGS=${COMPOSER_INSTALL_FLAGS:-$COMPOSER_INSTALL_FLAGS}

START_MODE_CRON=${START_MODE_CRON:-true}
START_MODE_CRON="$(convert_to_boolean_string "$START_MODE_CRON")"
export START_MODE_CRON

START_MODE_WEB=${START_MODE_WEB:-true}
START_MODE_WEB="$(convert_to_boolean_string "$START_MODE_WEB")"
export START_MODE_WEB

WEB_HTTPS_ONLY=${WEB_HTTPS_ONLY:-true}
WEB_HTTPS_ONLY="$(convert_to_boolean_string "$WEB_HTTPS_ONLY")"
export WEB_HTTPS_ONLY

START_HORIZON=${START_HORIZON:-false}
START_HORIZON="$(convert_to_boolean_string "$START_HORIZON")"
export START_HORIZON

START_QUEUE=${START_QUEUE:-true}
START_QUEUE="$(convert_to_boolean_string "$START_QUEUE")"
export START_QUEUE

RUN_LARAVEL_CRON=${RUN_LARAVEL_CRON:-false}
RUN_LARAVEL_CRON="$(convert_to_boolean_string "$RUN_LARAVEL_CRON")"
export RUN_LARAVEL_CRON

AUTH_HTTP_ENABLED=${AUTH_HTTP_ENABLED:-false}
AUTH_HTTP_ENABLED="$(convert_to_boolean_string "$AUTH_HTTP_ENABLED")"
export AUTH_HTTP_ENABLED

export AUTH_HTTP_REALM=${AUTH_HTTP_REALM:-"Protected System"}
export AUTH_HTTP_FILE=/etc/nginx/custom-htpasswd-path

export WORK_DIRECTORY=${WORK_DIRECTORY:-/app}
export WEB_DIRECTORY=${WEB_DIRECTORY:-${WORK_DIRECTORY}/public}

export APP_NAME=${APP_NAME:-Arc}
export APP_ENV=${APP_ENV:-local}
Expand Down Expand Up @@ -107,4 +62,4 @@ export LOGGLY_TOKEN=${LOGGLY_TOKEN:-null}
export AWS_ACCESS_KEY_ID=${AWS_ACCESS_KEY_ID:-}
export AWS_SECRET_ACCESS_KEY=${AWS_SECRET_ACCESS_KEY:-}
export AWS_DEFAULT_REGION=${AWS_DEFAULT_REGION:-eu-central-1}
export AWS_BUCKET=${AWS_BUCKET:-arc-dev}
export AWS_BUCKET=${AWS_BUCKET:-arc-dev}

0 comments on commit abe678f

Please sign in to comment.