Skip to content

Instantly share code, notes, and snippets.

@shimakyohsuke
Last active March 3, 2017 07:44
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save shimakyohsuke/d862fb2b760d28a32259 to your computer and use it in GitHub Desktop.
Save shimakyohsuke/d862fb2b760d28a32259 to your computer and use it in GitHub Desktop.
Wocker でコンテナ立ち上げ後に実効するやつ
#!/bin/bash
#shopt -s expand_aliases
#source ~/.bash_profile
## 日本語化する?
echo "日本語化する? [Y/N]"
read ANSWER
case $ANSWER in
"" | "Y" | "y" | "yes" | "Yes" | "YES" )
wocker wp core language install ja
wocker wp core language activate ja
wocker wp option update timezone_string 'Asia/Tokyo'
wocker wp option update date_format 'Y年n月j日'
wocker wp option update time_format 'H:i'
wocker wp plugin install wp-multibyte-patch --activate
;;
* ) echo "日本語化 Done!";;
esac
## プラグインをインストール
echo "プラグインをインストールしますか? [Y/N]"
read ANSWER1
case $ANSWER1 in
"" | "Y" | "y" | "yes" | "Yes" | "YES" )
wocker wp plugin install theme-check \
debug-bar \
debug-bar-extender \
--activate
;;
* ) echo "plugin Done!";;
esac
## テーマユニットテストデータのインストール
echo "テーマユニットテストデータをインストールしますか? [Y/N]"
read ANSWER2
case $ANSWER2 in
"" | "Y" | "y" | "yes" | "Yes" | "YES" )
wocker theme-test ja && \
echo "Theme Test Data install Done!!"
;;
esac
## 西川さんが作成したテーマユニットテストデータのインストール
## コンテンツエリアのマークアップで必要なHTMLの要素。コピペすると使える。- Shinichi Nishikawa's
## http://nskw-style.com/content-area-markup
echo "西川さんが作成したテーマユニットテストデータをインストールしますか? [Y/N]"
read ANSWER3
case $ANSWER3 in
"" | "Y" | "y" | "yes" | "Yes" | "YES" )
cid=$(docker ps -q)
url='https://raw.githubusercontent.com/shimakyohsuke/wp_post_create/master/content-area-markup.txt'
docker exec -u wocker $cid curl -OL $url && \
wocker wp post create ${url##*/} --post_title='西川さんが作成したテーマユニットテストデータ' --post_status=publish && \
wocker wp plugin install responsive-slide --activate && \
echo "西川さんが作成したテーマユニットテストデータ install Done!!"
;;
esac
## Jetpack インストールして wp-config.php に "define( 'JETPACK_DEV_DEBUG', true);" 追加
echo "Jetpack のインストール [Y/N]"
read ANSWER4
case $ANSWER4 in
"" | "Y" | "y" | "yes" | "Yes" | "YES" )
cid=$(docker ps -q)
dir=$(docker inspect --format="{{ .Name }}" $cid)
cd data$dir && \
sed -i -e "s/define( 'WP_DEBUG_LOG', true );/define( 'WP_DEBUG_LOG', true );\ndefine( 'JETPACK_DEV_DEBUG', true);/g" wp-config.php && \
cd ~/ && \
wocker wp plugin install jetpack --activate
echo "Jetpack のインストール Done!!"
;;
esac
## プラグインとテーマのアプデ
wocker wp plugin update-all
wocker wp theme update-all
## 日本語コアファイルのアプデはZIP重いからやめる
# wocker wp core update --locale=ja --force
wocker wp core update
wocker wp core update-db
wocker wp core language update
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment