+++ /dev/null
-<?php
-
-namespace App\Models;
-
-use Illuminate\Database\Eloquent\Collection;
-use Illuminate\Support\Facades\DB;
-use Hamatoma\Laraknife\ViewHelpers;
-use Illuminate\Database\Eloquent\Model;
-use Illuminate\Database\Eloquent\Factories\HasFactory;
-
-class Word extends Model
-{
- use HasFactory;
- protected $table = 'words';
- protected $fillable = [
- 'name',
- 'usage',
- 'wordtype_scope',
- 'verifiedby_id'
- ];
-}
#! /bin/bash
function Wait(){
- read answer "OK? Break with Ctrl-C"
+ echo "OK? Break with Ctrl-C"
+ read answer
}
function SeedIt(){
for class in DatabaseSeeder ModuleSeeder SPropertySeeder RoleSeeder UserSeeder \
MenuitemSeeder RoleWorxerSeeder FileSeeder NoteSeeder \
WordSeeder NounSeeder; do
- sudo -u www-data ./artisan db:seed --class=$class
+ sudo -u $DEV_USER ./artisan db:seed --class=$class
done
}
+function CreateStorage(){
+ mkdir -p storage/log
+ if [ ! -d storage/framework/cache ]; then
+ mkdir -p storage/framework/cache storage/framework/views storage/framework/sessions
+ fi
+}
+function LinkLaraknife(){
+ if [ ! -L vendor/hamatoma/laraknife ]; then
+ mkdir -p vendor/hamatoma
+ ln -sv ../../../laraknife vendor/hamatoma
+ fi
+}
function DoIt(){
- sudo composer update
- Wait
- ./artisan migrate
- Wait
- SeedIt
- Wait
- npm run build
+ # get DEV_USER
+ . .dev.user
+ apt update && apt install composer
+ LinkLaraknife
+ CreateStorage
+ Wait
+ chown -R $DEV_USER:www-data bootstrap/cache
+ sudo -u $DEV_USER composer update
+ Wait
+ sudo -u $DEV_USER ./artisan migrate
+ Wait
+ SeedIt
+ Wait
+ sudo -u $DEV_USER npm run build
}
-if [ "$(id -u)" != 0 ]; then
- echo "+++ Be root"
+if [ ! -d ../laraknife ]; then
+ echo "+++ missing ../laraknife"
+ echo "cd .. ; git clone git@github.com:hamatoma/laraknife.git"
elif [ ! -e .dev.user ]; then
echo "+++ call './Own all' before!"
-elif [ ! -d ../laraknife ]; then
- echo "+++ missing ../laraknife"
- echo "git clone git@github.com:hamatoma/laraknife.git"
elif [ ! -f .env ]; then
echo "+++ missing .env"
echo "cp -a env.example .env"
elif [ ! -d /var/lib/mysql/lrvworxer ]; then
echo "+++ missing db lrvworxer"
echo "sudo mysqladmin create lrvworxer"
+ echo "echo \"grant all on lrvworxer.* to 'worxer'@'localhost' identified by 'topsecret';\" | sudo mysql mysql"
+elif [ "$(id -u)" != 0 ]; then
+ echo "+++ Be root"
else
DoIt
-fi
\ No newline at end of file
+fi