Move all files to decoupling-drupal-vuejs/demo/

This commit is contained in:
Oliver Davies 2025-10-02 12:23:37 +01:00
parent a5f598deff
commit 92cba01aa5
296 changed files with 0 additions and 0 deletions

View 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 --------------------------------

View 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 --------------------------------