Automated commit
Signed-off-by: Oliver Davies <oliver@oliverdavies.uk>
This commit is contained in:
parent
0ccc967ca8
commit
1d401246d2
296 changed files with 0 additions and 0 deletions
1
decoupling-drupal-vuejs/demo/blue-conf/drupal/.docksal/.gitignore
vendored
Normal file
1
decoupling-drupal-vuejs/demo/blue-conf/drupal/.docksal/.gitignore
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
/docksal-local.*
|
|
@ -0,0 +1,37 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
#: exec_target = cli
|
||||
|
||||
## Creates a phpunit.xml file and runs PHPUnit tests in Drupal 8
|
||||
##
|
||||
## Usage: fin phpunit <args>
|
||||
##
|
||||
## This first ensures that a `core/phpunit.xml` file exists, either by copying a
|
||||
## stub from `.docksal/drupal/core/phpunit.xml` if that exists, or copying and
|
||||
## renaming `core/phpunit.xml.dist`.
|
||||
##
|
||||
## If `core/phpunit.xml` exists, the phpunit command with then be run, appending
|
||||
## any optional arguments such as the directory path (run `fin phpunit -h`) to
|
||||
## see a full list of options.
|
||||
|
||||
DOCROOT_PATH="${PROJECT_ROOT}/${DOCROOT}"
|
||||
DRUPAL_CORE_PATH="${DOCROOT_PATH}/core"
|
||||
|
||||
run_tests() {
|
||||
${PROJECT_ROOT}/vendor/bin/phpunit -c ${DRUPAL_CORE_PATH} "$@"
|
||||
}
|
||||
|
||||
if [ ! -e ${DRUPAL_CORE_PATH}/phpunit.xml ]; then
|
||||
if [ -e "${PROJECT_ROOT}/.docksal/drupal/core/phpunit.xml" ]; then
|
||||
echo "Copying ${PROJECT_ROOT}/.docksal/drupal/core/phpunit.xml to ${DRUPAL_CORE_PATH}/phpunit.xml"
|
||||
cp "${PROJECT_ROOT}/.docksal/drupal/core/phpunit.xml" ${DRUPAL_CORE_PATH}/phpunit.xml
|
||||
run_tests "$@"
|
||||
else
|
||||
echo "Copying phpunit.xml.dist to phpunit.xml."
|
||||
echo "Please edit it's values as needed and re-run 'fin phpunit'."
|
||||
cp ${DRUPAL_CORE_PATH}/phpunit.xml.dist ${DRUPAL_CORE_PATH}/phpunit.xml
|
||||
exit 1;
|
||||
fi
|
||||
else
|
||||
run_tests "$@"
|
||||
fi
|
|
@ -0,0 +1,67 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
## Opens SequelPro
|
||||
##
|
||||
## Usage: fin sequelpro
|
||||
|
||||
# Abort if anything fails
|
||||
set -e
|
||||
|
||||
container_port=$(docker ps --all --filter 'label=com.docker.compose.service=db' --filter "label=com.docker.compose.project=${COMPOSE_PROJECT_NAME}" --format '{{.Ports}}' | sed 's/.*0.0.0.0://g'|sed 's/->.*//g')
|
||||
HOST=${VIRTUAL_HOST}
|
||||
DB=${MYSQL_DATABASE:-default}
|
||||
USER=${MYSQL_USER:-user}
|
||||
PASS=${MYSQL_PASSWORD:-user}
|
||||
NAME=${COMPOSE_PROJECT_NAME}
|
||||
|
||||
PORT=${PORT:-$container_port}
|
||||
|
||||
FILENAME=/tmp/docksal-sequelpro-${RANDOM}.spf
|
||||
cat <<EOT >> $FILENAME
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>ContentFilters</key>
|
||||
<dict/>
|
||||
<key>auto_connect</key>
|
||||
<true/>
|
||||
<key>data</key>
|
||||
<dict>
|
||||
<key>connection</key>
|
||||
<dict>
|
||||
<key>database</key>
|
||||
<string>${DB}</string>
|
||||
<key>host</key>
|
||||
<string>${HOST}</string>
|
||||
<key>name</key>
|
||||
<string>${NAME}</string>
|
||||
<key>user</key>
|
||||
<string>${USER}</string>
|
||||
<key>password</key>
|
||||
<string>${PASS}</string>
|
||||
<key>port</key>
|
||||
<integer>${PORT}</integer>
|
||||
<key>rdbms_type</key>
|
||||
<string>mysql</string>
|
||||
</dict>
|
||||
<key>session</key>
|
||||
<dict/>
|
||||
</dict>
|
||||
<key>encrypted</key>
|
||||
<false/>
|
||||
<key>format</key>
|
||||
<string>connection</string>
|
||||
<key>queryFavorites</key>
|
||||
<array/>
|
||||
<key>queryHistory</key>
|
||||
<array/>
|
||||
<key>rdbms_type</key>
|
||||
<string>mysql</string>
|
||||
<key>version</key>
|
||||
<integer>1</integer>
|
||||
</dict>
|
||||
</plist>
|
||||
EOT
|
||||
|
||||
open $FILENAME
|
49
decoupling-drupal-vuejs/demo/blue-conf/drupal/.docksal/addons/uli/uli
Executable file
49
decoupling-drupal-vuejs/demo/blue-conf/drupal/.docksal/addons/uli/uli
Executable file
|
@ -0,0 +1,49 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
die ()
|
||||
{
|
||||
echo "$1"
|
||||
exit 1
|
||||
}
|
||||
|
||||
## Generate one time user login link. Add -s to use https in url.
|
||||
## Usage fin uli @drushalias -s
|
||||
## The drush alias and -s flags are optional.
|
||||
|
||||
cd "$PROJECT_ROOT/$DOCROOT" || die "Could not change dir to $PROJECT_ROOT/$DOCROOT"
|
||||
|
||||
https=0 # Default to not use https
|
||||
|
||||
# Check the first two options / arguments given on the the command line for
|
||||
# what looks like a Drush site alias or the -s option to use https in the url.
|
||||
count=2
|
||||
while [ $count -ne 0 ]; do
|
||||
if [[ $1 == @* ]]; then
|
||||
drushalias=$1
|
||||
shift 1
|
||||
elif [[ $1 == "-s" ]]; then
|
||||
https=1
|
||||
shift 1
|
||||
fi
|
||||
count=$[$count-1]
|
||||
done
|
||||
|
||||
if [ $https -eq 0 ]; then
|
||||
uli=$(fin drush $drushalias uli "$@" 2>&1 | sed "s/default/$VIRTUAL_HOST/")
|
||||
elif [ $https -eq 1 ]; then
|
||||
uli=$(fin drush $drushalias uli "$@" 2>&1 | sed "s/default/$VIRTUAL_HOST/" | sed "s/http\:/https:/")
|
||||
else
|
||||
exit 2
|
||||
fi
|
||||
echo "$uli"
|
||||
[[ "$uli" == *"Error"* ]] && exit 1
|
||||
|
||||
# Mac OSX copy uli to clipboard with pbcopy
|
||||
( which pbcopy >/dev/null 2>&1 ) &&
|
||||
echo "$uli" | pbcopy &&
|
||||
echo "[+] Copied to clipboard"
|
||||
|
||||
# Linux copy uli to both the selection buffer and clipboard with xclip.
|
||||
( which xclip >/dev/null 2>&1 ) &&
|
||||
echo "$uli" | xclip -i -sel c -f |xclip -i -sel p &&
|
||||
echo "[+] Copied to clipboard and selection buffer"
|
37
decoupling-drupal-vuejs/demo/blue-conf/drupal/.docksal/commands/init
Executable file
37
decoupling-drupal-vuejs/demo/blue-conf/drupal/.docksal/commands/init
Executable file
|
@ -0,0 +1,37 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
## Initialize stack and site (full reset)
|
||||
##
|
||||
## Usage: fin init
|
||||
|
||||
# Abort if anything fails
|
||||
set -e
|
||||
|
||||
#-------------------------- Helper functions --------------------------------
|
||||
|
||||
# Console colors
|
||||
red='\033[0;31m'
|
||||
green='\033[0;32m'
|
||||
green_bg='\033[1;97;42m'
|
||||
yellow='\033[1;33m'
|
||||
NC='\033[0m'
|
||||
|
||||
echo-red () { echo -e "${red}$1${NC}"; }
|
||||
echo-green () { echo -e "${green}$1${NC}"; }
|
||||
echo-green-bg () { echo -e "${green_bg}$1${NC}"; }
|
||||
echo-yellow () { echo -e "${yellow}$1${NC}"; }
|
||||
|
||||
#-------------------------- Execution --------------------------------
|
||||
|
||||
# Stack initialization
|
||||
echo -e "${green_bg} Step 1 ${NC}${green} Initializing stack...${NC}"
|
||||
fin project reset -f
|
||||
|
||||
# Site initialization
|
||||
echo -e "${green_bg} Step 2 ${NC}${green} Initializing site...${NC}"
|
||||
# This runs inside cli using http://docs.docksal.io/en/v1.4.0/fin/custom-commands/#executing-commands-inside-cli
|
||||
fin init-site
|
||||
|
||||
echo -e "${green_bg} DONE! ${NC}${green} Completed all initialization steps.${NC}"
|
||||
|
||||
#-------------------------- END: Execution --------------------------------
|
85
decoupling-drupal-vuejs/demo/blue-conf/drupal/.docksal/commands/init-site
Executable file
85
decoupling-drupal-vuejs/demo/blue-conf/drupal/.docksal/commands/init-site
Executable file
|
@ -0,0 +1,85 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
#: exec_target = cli
|
||||
|
||||
## Initialize/reinstall site
|
||||
##
|
||||
## Usage: fin init-site
|
||||
|
||||
# Abort if anything fails
|
||||
set -e
|
||||
|
||||
#-------------------------- Helper functions --------------------------------
|
||||
|
||||
copy_settings_file() {
|
||||
local source="$1"
|
||||
local dest="$2"
|
||||
|
||||
echo "Copying ${dest}..."
|
||||
cp $source $dest
|
||||
}
|
||||
|
||||
composer_install() {
|
||||
echo "Installing Composer dependencies..."
|
||||
composer install
|
||||
}
|
||||
|
||||
#-------------------------- END: Helper functions --------------------------------
|
||||
|
||||
#-------------------------- END: Functions --------------------------------
|
||||
|
||||
init_settings() {
|
||||
copy_settings_file ../files/settings.php ../../web/sites/default
|
||||
}
|
||||
|
||||
site_install() {
|
||||
composer_install
|
||||
|
||||
echo "Installing Drupal..."
|
||||
drush site:install -y
|
||||
}
|
||||
|
||||
import_config() {
|
||||
drush config:set -y system.site uuid de7ba5dc-5795-4cb5-9d38-1edcc27be491
|
||||
|
||||
drush config:delete -y shortcut.set.default uuid
|
||||
|
||||
echo "Importing configuration..."
|
||||
drush config:import -y --source=../config/sync
|
||||
}
|
||||
|
||||
import_content() {
|
||||
echo "Importing speakers from CSV..."
|
||||
drush php:eval '\Drupal::service("Drupal\dtc_import\Service\Importer\CsvSpeakerImporter")->import()'
|
||||
|
||||
echo "Importing sessions from CSV..."
|
||||
drush php:eval '\Drupal::service("Drupal\dtc_import\Service\Importer\CsvSessionImporter")->import()'
|
||||
}
|
||||
|
||||
setup_users() {
|
||||
echo "Creating the API user..."
|
||||
drush user:create api --password=api
|
||||
drush user:role:add api_user api
|
||||
|
||||
echo "Resetting uuid for the admin user..."
|
||||
drush sql:query "UPDATE users SET uuid = '11dad4c2-baa8-4fb2-97c6-12e1ce925806' WHERE uid = 1"
|
||||
|
||||
echo "Resetting uuid for the API user..."
|
||||
drush sql:query "UPDATE users SET uuid = '63936126-87cd-4166-9cb4-63b61a210632' WHERE uid = 7"
|
||||
|
||||
echo "Rebuilding cache..."
|
||||
drush cache:rebuild
|
||||
}
|
||||
|
||||
#-------------------------- END: Functions --------------------------------
|
||||
|
||||
#-------------------------- Execution --------------------------------
|
||||
|
||||
site_install
|
||||
import_config
|
||||
import_content
|
||||
setup_users
|
||||
|
||||
echo -e "Open ${yellow}http://${VIRTUAL_HOST}${NC} in your browser to verify the setup."
|
||||
|
||||
#-------------------------- END: Execution --------------------------------
|
|
@ -0,0 +1,6 @@
|
|||
COMPOSE_PROJECT_NAME="blueconf"
|
||||
DOCKSAL_STACK=default
|
||||
DOCROOT="web"
|
||||
MYSQL_DATABASE=default
|
||||
MYSQL_PASSWORD=user
|
||||
MYSQL_USER=user
|
|
@ -0,0 +1,8 @@
|
|||
version: "2.1"
|
||||
services:
|
||||
cli:
|
||||
environment:
|
||||
- MYSQL_DATABASE
|
||||
- MYSQL_PASSWORD
|
||||
- MYSQL_USER
|
||||
|
File diff suppressed because it is too large
Load diff
Loading…
Add table
Add a link
Reference in a new issue