Compare commits

..

No commits in common. "c99be97de70995d5ca5348b266e3d22053b5d8af" and "a7db6ff2c9d7736af47a49827cec7764c7a3e168" have entirely different histories.

6 changed files with 24 additions and 49 deletions

View File

@ -1,11 +0,0 @@
#!/bin/bash
DIR=$1
[ $# -lt 1 ] && echo "Directory argument is missing" && exit
[ $# -gt 1 ] && echo "Too many arguments" && exit
[ ! -d $DIR ] && echo "Directory ${DIR} does not exist" && exit
./db -e ${DIR}
tar -cjpf ${DIR}.tar.bz2 ${DIR} ${DIR}.*
ls -l ${DIR}.tar.bz2 --color=auto

View File

@ -1,15 +1,14 @@
#!/bin/bash #!/bin/bash
df -h | awk 'NR==1 || /\/$/' df -h
rm -rf $1 rm -rf $1
rm -r $1.sql rm -r $1.sql
rm -r $1.info rm -r $1.info
rm -r $1.copy.log rm -r $1.copy.log
rm -r $1.composer.log rm -r $1.composer.log
rm -r $1.settings.php
./db -du $1 ./db -du $1
./db -dd $1 ./db -dd $1
df -h | awk 'NR==1 || /\/$/' df -h

View File

@ -1,7 +1,7 @@
#!/bin/bash #!/bin/bash
cd $1 cd $1
NAME=$(echo $1 | tr -d '^\./')
# cd web/modules # cd web/modules
# COUNT=$(ls -d */ 2> /dev/null | grep -v custom | grep -v contrib | wc -l) # COUNT=$(ls -d */ 2> /dev/null | grep -v custom | grep -v contrib | wc -l)
# echo # echo
@ -56,11 +56,11 @@ else
echo echo
fi fi
COUNT=$(mysql -uroot -p1234 ${NAME} -Nse "SELECT name from ${NAME}.config WHERE name LIKE 'node.type%'" | sed 's/node.type.//g' | sort | uniq | wc -l) COUNT=$(mysql -uroot -p1234 $1 -Nse "SELECT name from $1.config WHERE name LIKE 'node.type%'" | sed 's/node.type.//g' | sort | uniq | wc -l)
echo echo
echo -e "🍓 Content types: ${COUNT}" echo -e "🍓 Content types: ${COUNT}"
echo echo
mysql -uroot -p1234 ${NAME} -Nse "SELECT name from ${NAME}.config WHERE name LIKE 'node.type%'" | sed 's/node.type.//g' | sort | uniq mysql -uroot -p1234 $1 -Nse "SELECT name from $1.config WHERE name LIKE 'node.type%'" | sed 's/node.type.//g' | sort | uniq
echo echo
echo -e "🎃 Available users" echo -e "🎃 Available users"

View File

@ -34,6 +34,7 @@ echo
echo -ne " 💧 Create new drupal in dir ${WHT}$NAME${END} ..." echo -ne " 💧 Create new drupal in dir ${WHT}$NAME${END} ..."
composer --no-interaction create-project drupal/recommended-project $NAME composer --no-interaction create-project drupal/recommended-project $NAME
# composer --no-interaction create-project drupal/recommended-project:9.5.10 $NAME > /dev/null 2>&1 # composer --no-interaction create-project drupal/recommended-project:9.5.10 $NAME > /dev/null 2>&1
#
#CMD="composer --no-interaction create-project drupal/recommended-project:9 $NAME > /dev/null 2>&1" #CMD="composer --no-interaction create-project drupal/recommended-project:9 $NAME > /dev/null 2>&1"
#CMD="composer create-project drupal/recommended-project:9 $NAME" #CMD="composer create-project drupal/recommended-project:9 $NAME"
#sudo su -l apache -s /bin/bash -c "cd $PWD; $CMD" #sudo su -l apache -s /bin/bash -c "cd $PWD; $CMD"
@ -107,6 +108,7 @@ echo
echo echo
echo -e "Finish the installation..." echo -e "Finish the installation..."
echo echo
echo -e "URL : http://192.168.56.101"
echo -e "Database: ${NAME}" echo -e "Database: ${NAME}"
echo -e "Username: ${NAME}" echo -e "Username: ${NAME}"
echo -e "Password: 1234" echo -e "Password: 1234"
@ -117,41 +119,26 @@ exit
echo -e "🍓" echo -e "🍓"
# Headless backend rest api server
drush en serialization
drush en rest
drush en jsonapi
drush cr
composer require 'drupal/rest_views:^2.0'
drush en rest_views
function rest() { composer require 'drupal/restui:^1.21'
drush en serialization drush en restui
drush en rest
composer require 'drupal/restui:^1.21'
drush en restui
composer require 'drupal/rest_views:^2.0'
drush en rest_views
}
echo -en "Enable module ${R}rest${E} (y/n): "
read -n 1 answer
[ $answer = "y" ] && rest
echo
composer require 'drupal/rpb:^1.0@beta'
function rest() {
drush en jsonapi
}
echo -en "Enable module ${R}rest${E} (y/n): "
read -n 1 answer
[ $answer = "y" ] && jsonapi
echo
# composer require 'drupal/rpb:^1.0@beta'
#composer require 'drupal/decoupled_rest_views:^1.0@alpha' #composer require 'drupal/decoupled_rest_views:^1.0@alpha'
#composer require 'drupal/entity_rest_extra:^2.1' #composer require 'drupal/entity_rest_extra:^2.1'
#composer require 'drupal/rest_entity_recursive:^2.0@RC' #composer require 'drupal/rest_entity_recursive:^2.0@RC'
# Devel # Devel
composer require 'drupal/rest_views:^2.0'
composer require 'drupal/devel' composer require 'drupal/devel'
rm -rf vendor/autoload.php vendor/autoload_runtime.php vendor/composer rm -rf vendor/autoload.php vendor/autoload_runtime.php vendor/composer
composer install composer install

View File

@ -12,7 +12,6 @@ END="\e[00m"
BASE_PATH="/var/www" BASE_PATH="/var/www"
SITE="site${2}" SITE="site${2}"
NAME=$(echo $1 | awk -F/ '{print $1}' )
function log() { function log() {
if [ $1 = 0 ]; then if [ $1 = 0 ]; then
@ -55,15 +54,16 @@ echo -ne " 🐬 Drush clear cache "
cd $BASE_PATH/sites/$1 cd $BASE_PATH/sites/$1
# scl enable php82 bash # scl enable php82 bash
if [ -f ../vendor/drush/drush/drush ] if [ -f ./vendor/drush/drush/drush ]
then then
echo "found local drush" echo "found local drush"
../vendor/drush/drush/drush cr ./vendor/drush/drush/drush cr
log $? log $?
echo echo
else else
echo "using global drush" echo "using global drush"
drush cr &> /dev/null # drush cr &> /dev/null
drush cr
log $? log $?
echo echo
fi fi
@ -72,6 +72,6 @@ cd ..
echo echo
cd .. cd ..
tail -n 10 $NAME.copy.log tail -n 10 $1.copy.log
echo echo

View File

@ -1,3 +1,3 @@
#!/bin/bash #!/bin/bash
/root/dev/toolbox/site.sh $1 5 /root/Dev-Enviroment/toolbox/site.sh $1 5