-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathsync_option_private_2_dev.sh.example
53 lines (51 loc) · 3.13 KB
/
sync_option_private_2_dev.sh.example
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
####################################################
### 環境構築-Linux用(外部プラグイン → Connect-CMS)
####################################################
# 外部プラグインをConnect-CMSとは別ディレクトリでGit管理したい場合などに使用する、コピーshellです。
# 外部プラグインディレクトリから、Connect-CMSディレクトリにコピーします。
# コピー不要のディレクトリは、コメントアウトしてください。
#
# bashで実行
# bash .\sync_option_private_2_dev.sh
# 外部プラグインのあるディレクトリ
src_root_dir='/path_to_option_private_dir/'
# Connect-CMSのあるディレクトリ
dist_root_dir='/path_to_dev_connect-cms/'
# プラグイン名
option_plugin="pluginname"
option_plugin_controller_dir="${option_plugin}"
# ${変数,,}はbashの機能で、全小文字に変換する
option_plugin_resources_dir="${option_plugin,,}"
option_plugin_model_dir=$option_plugin_controller_dir
option_plugin_command_dir=$option_plugin_controller_dir
# コントローラー
rsync -arvz --delete "${src_root_dir}${option_plugin}/app/PluginsOption/User/${option_plugin_controller_dir}" "${dist_root_dir}app/PluginsOption/User/"
# モデル
if [ ! -d "${dist_root_dir}app/ModelsOption/User/" ]; then
mkdir -p "${dist_root_dir}app/ModelsOption/User/"
fi
rsync -arvz --delete "${src_root_dir}${option_plugin}/app/ModelsOption/User/${option_plugin_model_dir}" "${dist_root_dir}app/ModelsOption/User/"
# ビュー
if [ ! -d "${dist_root_dir}resources/views/plugins_option/user/" ]; then
mkdir -p "${dist_root_dir}resources/views/plugins_option/user/"
fi
rsync -arvz --delete "${src_root_dir}${option_plugin}/resources/views/plugins_option/user/${option_plugin_resources_dir}" "${dist_root_dir}resources/views/plugins_option/user/"
# バッチ
rsync -arvz --delete "${src_root_dir}${option_plugin}/app/Console/CommandsOption/${option_plugin_command_dir}" "${dist_root_dir}app/Console/CommandsOption/"
# マイグレーション
rsync -arvz --delete --exclude '_readme.txt' "${src_root_dir}${option_plugin}/database/migrations_option" "${dist_root_dir}database/"
# シーダー
rsync -arvz "${src_root_dir}${option_plugin}/database/seeders/Options/${option_plugin}" "${dist_root_dir}database/seeders/Options/"
# Enum
rsync -arvz --delete "${src_root_dir}${option_plugin}/app/EnumsOption" "${dist_root_dir}app/"
# 画像
rsync -arvz --delete "${src_root_dir}${option_plugin}/public/images/plugins/${option_plugin_resources_dir}" "${dist_root_dir}public/images/plugins/"
# メールテンプレート
rsync -arvz --delete "${src_root_dir}${option_plugin}/resources/views/mail_option/${option_plugin_resources_dir}" "${dist_root_dir}resources/views/mail_option/"
# バリデーション
rsync -arvz --delete "${src_root_dir}${option_plugin}/app/RulesOption/${option_plugin}" "${dist_root_dir}${option_plugin}/app/RulesOption/"
# Composer Option
cp -f "${src_root_dir}composer-option.json" "${dist_root_dir}"
cp -f "${src_root_dir}composer-option.lock" "${dist_root_dir}"
cp -f "${src_root_dir}composer-option-dev.json" "${dist_root_dir}"
cp -f "${src_root_dir}composer-option-dev.lock" "${dist_root_dir}"