From 561b3cc04e82196c4a29887509aa58ce2ba06c5b Mon Sep 17 00:00:00 2001 From: "sosuke.iwabuchi" Date: Sat, 23 Mar 2024 09:11:38 +0900 Subject: [PATCH] =?UTF-8?q?=E3=83=87=E3=83=97=E3=83=AD=E3=82=A4=E3=82=B7?= =?UTF-8?q?=E3=82=A7=E3=83=AB=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 4 +++- deploy.sh | 28 ++++++++++++++++++++++++++++ 2 files changed, 31 insertions(+), 1 deletion(-) create mode 100644 deploy.sh diff --git a/.gitignore b/.gitignore index 7bb5210..8a218a9 100644 --- a/.gitignore +++ b/.gitignore @@ -19,4 +19,6 @@ yarn-error.log /.vscode _ide*.php /db_dump -sail \ No newline at end of file +sail +*.pem +_* \ No newline at end of file diff --git a/deploy.sh b/deploy.sh new file mode 100644 index 0000000..86b9345 --- /dev/null +++ b/deploy.sh @@ -0,0 +1,28 @@ +#!/bin/bash + +cd $(dirname $0) + +SAIL="" +COMMANDS=() + +if [ $# -eq 0 ]; then + SAIL="" + COMMANDS+=("composer install --optimize-autoloader --no-dev") +elif [ $# -eq 1 ] && [ $1 == "sail" ]; then + SAIL="./sail" + NO_DEV="--no-dev" +else + echo "引数不正" + exit 1 +fi + +COMMANDS+=("${SAIL} php artisan config:cache") +COMMANDS+=("${SAIL} php artisan route:cache") +COMMANDS+=("${SAIL} php artisan view:cache") +COMMANDS+=("${SAIL} php artisan event:cache") +COMMANDS+=("${SAIL} php artisan queue:restart") + +for COMMAND in "${COMMANDS[@]}"; do + echo ${COMMAND} + ${COMMAND} +done \ No newline at end of file