當 Java 遇上 DevOps 黃忠成
Java In Azure Storage Table Storage Services NoSQL base storage Fast and Easy to use Blob Storage Services File Storage (photo, temp files) CDN Database SQL Database (PaaS) MySQL (PaaS/IaaS) Oracle(IaaS) Document DB(JSON base database) Web Hosting (PaaS) Azure App Services(Web App) Tomcat, Jetty, ie…. Services HockeyApp Notification Hub Application insights
Visual Studio Team Services & Java Source Control Build System Maven Gradle Ant Can link from other Source Control(GitHub, Subversion) Test System Integrated JUnit Deploy System Dropbox FTP HockeyApp
VSTS and DevOps Source CodeBuild Testing Deploy
Let’s start
You need? A Azure Account a IDE Eclipse IntelliJ IDEA
環境的準備 Creating a SQL Database
環境的準備 Creating Storage Services
以 Eclipse/Maven 建置 Web App The TodoListApp 以 Spring MVC 為基礎 透過 Hibernate 連接資料庫 使用 JUnit 進行單元測試 資料庫 Use SQL Database Use jTDS JDBC Driver 圖形的儲存 Use Blob Services to store photo
幾個重點 How To Connect to SQL Database How to store picture into blob
環境的準備 在 Azure 中建立一個 Web App 服務 關於 App Services plan 的概念
設定 Web App 服務的 Java 環境
Azure App Service 的優點 PaaS Staging/Production Deployment slot Monitoring Easy to Scale
Deploy to Azure App Services Modify Maven to deploy WebApp via FTP Test
Use Plug-In to help us Azure Toolkit for Eclipse Team Explorer Everywhere
How easy deploy with Tool? Demo
Source Control Create VSTS Account Create VSTS Site Create Project Push your code
Continuous integration Create a Build Definition Build when code is commit. Test when Build is Success
豐富的 Tasks 支援
Continuous Deployment Add Deploy Steps See how Build System working
Build&Test&Deploy when code is commit
除此之外,還有更多有用的雲端服務 Table Storage What’s Table Storage? Benefits Redis Cache What’s Redis Cache Benefits
Mobile Development
VSTS and Android VSTS Source Control can push any code, include Android. VSTS support Gradle, it’s Android Studio Build System. VSTS support JUnit, so can run Tests when build is done. VSTS support HockeyApp, can deploy to users when build and test is done.
Let’s start with Simple App
A Simple Android APP A Simple Calculator Add JUnit Test. Build & Test
Continuous integration Push into VSTS Create Build Definition
The Deploy? Introducing HockeyApp Platform Creating HockeyApp Account
Integrated to VSTS Install from Marketplace.
Integrated to VSTS Setup HockeyApp connection Add task into build definition
Let’s see it’s work or not.
Using Application Insights
What’s Application Insights Monitor Application Status Monitor Application Performances Detect Error and Diagnose
Creating
Setup Web App Enable Application Insights in Web App
Setup Web App Remove Azure Library, we are use Maven
Add interceptor to Spring MVC
The Result