More Related Content Similar to Pro aspnetmvc3framework chap23 Similar to Pro aspnetmvc3framework chap23 (20) More from Hideki Hashizume More from Hideki Hashizume (6) Pro aspnetmvc3framework chap232. 2
目次
1. デプロイが完了するまでの作業
1. プロセス
2. ツール
2. ビルド
1. ビュー以外のビルド
2. ビューのビルド
3. パッケージ作成
1. Web.config変換
2. DBの移行準備
4. デプロイの方法
3. 3
デプロイが完了するまでの作業
1. プロセス
2. ツール
4. 4
デプロイが完了するまでの作業
プロセス
アプリ パッケージ
ビルド テスト デプロイ
保存 作成
ビュー以外のビルド Web.config変換
ビューのビルド ファイルコピーデプロイ
デプロイメントパッケージデプロイ
ワンクリック発行
Binデプロイ
ツール
• Visual Studio (開発)
• MsBuild (ビルドとパッケージ作成)
• MsTest (コンポーネントテスト)
• Web配置ツールとWeb配置エージェント
5. 5
ビルド
1. ビュー以外のビルド → 特に話なし。
2. ビューのビルド
7. 7
デモ
1. Viewを記述間違えする。
1. @name -> @nam
2. ビルドする。
3. 実行時に、間違えに気付く。
1. MvcBuildViewsをtrueに変える
2. Viewを記述間違えする。
1. @name -> @nam
3. ビルド時に、間違えに気付く。
8. 8
パッケージ作成
1. Web.config変換
2. DBの移行準備 → 特に話なし。
10. 10
Web.config変換 -たとえば-
• Web.config本体
<system.web>
・・・
<compilation debug=“true” targetFramework=“4.0”/>
</system.web>
• Web.Release.config
<system.web>
...
<compilation xdt:Transform=“RemoveAttributes(debug)” />
<httpCookies domain=“” requireSSL=“true” xdt:Transform=“Insert”/>
</system.web>
• パッケージ化された後のWeb.config (完成形)
<system.web>
...
<httpCookies domain=“” requireSSL=“true”/>
</system.web>
13. 13
デプロイの種類 その2
3. ワンクリック発行
• 便利だけど、準備が大変な方法。開発用途ならかなり使える。
• サーバー側に「Web配置」機能(エージェント機能!)をインス
トールする必要がある。
4. Binデプロイ
• サーバーにMVC3が
インストールしてなくてもOK。
16. 16
まとめ
1. ビルドに詳しくなるべし!
MsBuildは難しいから、psakeを覚えると良いと思う。
2. 常時デプロイできるように準備すべし!
必要となるときにすぐデプロイできるのは重要
3. CIの勉強をすべし!
17. 17
参考文献
• 「Avoiding MvcBuildViews build time impact in
developers environment by using ASP.NET compiler as
an external tool」
http://www.luisrocha.net/2011/10/avoiding-mvcbuildviews-
build-time.html
• Programming Razor,pp.71-74