Files
simple-laravel/build/start-container
vista aaf97839f8
All checks were successful
ci/woodpecker/push/build-dev Pipeline was successful
Update 'build/start-container'
2023-03-16 13:27:20 +01:00

31 lines
1.5 KiB
Bash

#!/usr/bin/env bash
# exit when any command fails
set -e
# init nvm
\. $NVM_DIR/nvm.sh
if [ ! -f /var/www/html/artisan ]; then
echo "No existing Laravel project found"
composer create-project laravel/laravel /var/www/html "$LARAVEL_VERSION"
npm install -D tailwindcss postcss autoprefixer --prefix /var/www/html
sed -i "/export default defineConfig({/a\ server: {host: '0.0.0.0'}," /var/www/html/vite.config.js
echo -e "@tailwind base;\n@tailwind components;\n@tailwind utilities;" >> /var/www/html/resources/css/app.css
echo -e '/** @type {import('tailwindcss').Config} */\nmodule.exports = {\n content: [\n "./resources/**/*.blade.php",\n "./resources/**/*.js",\n "./resources/**/*.vue",\n ],\n theme: {\n extend: {},\n },\n plugins: [],\n}' > /var/www/html/tailwind.config.js
npx tailwindcss init -p
if [[ "$WEBHOOK" = true ]]; then
composer --working-dir=/var/www/html require spatie/laravel-webhook-client
php /var/www/html/artisan vendor:publish --provider="Spatie\WebhookClient\WebhookClientServiceProvider" --tag="webhook-client-config"
php /var/www/html/artisan vendor:publish --provider="Spatie\WebhookClient\WebhookClientServiceProvider" --tag="webhook-client-migrations"
fi
fi
if [[ "$AUTO_START_NPM_DEV" = true ]]; then
echo "Staring npm dev"
npm run dev --prefix /var/www/html &
fi
echo "Staring Laravel"
php /var/www/html/artisan serve --host=0.0.0.0 --port=8080