利用AWS Codebuild 從bitbucket獲取代碼構建並輸出到S3上,再經過CodeDeploy 自動部署到測試或者生產環境ubuntu
CodeBuildbash
支持分支app
支持maven私服maven
自定義構建規範文件ide
CodeBuild的運行,須要向代碼根目錄中添加構建規範文件buildspec.yml測試
phases: install: commands: - cp ./deploy/settings.xml /root/.m2/settings.xml pre_build: commands: - cd src build: commands: - mvn clean && mvn install artifacts: files: - src/target/*.zip discard-paths: yes cache: paths: - '/root/m2/**/*'
build結果ui
CodeDeployspa
支持回滾3d
客戶端安裝代理代理
支持ELB
支持自定義規範文件
CodeDeploy的運行,須要向代碼根目錄中添加構建規範文件deployspec.yml
files: - source: / destination: /home/ubuntu/app/cart permissions: - object: /home/ubuntu/epiclouds owner: ubuntu group: ubuntu hooks: BeforeInstall: - location: deploy/DeleteLib.sh timeout: 300 runas: ubuntu AfterInstall: - location: deploy/ChangePermission.sh timeout: 300 runas: ubuntu ApplicationStart: - location: deploy/start.sh timeout: 300 runas: ubuntu ApplicationStop: - location: deploy/stop.sh timeout: 300 runas: ubuntu
部署結果
訂價
CodeBuild:根據計算類型訂價,每個月免費100分
CodeDeploy:免費