Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@takami228
Last active August 21, 2019 10:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save takami228/568e48920af5d118790b0058788b9346 to your computer and use it in GitHub Desktop.
Save takami228/568e48920af5d118790b0058788b9346 to your computer and use it in GitHub Desktop.
JAWS-UGアーキ支部 20190722

JAWS-UGアーキ支部

https://jawsug-arch.connpass.com/event/136068/

整理回

  • なぜCI/CDやるのか?
  • パイプライン像
    • プロダクトパイプラインと環境パイプラインの2つありそう
    • プロダクトパイプライン:入れるものを作る
    • 環境パイプライン:入れる箱を作る
  • プロダクトパイプライン
    • 開発環境
    • ソースコード管理
    • ビルド&テスト
    • デプロイ
  • 環境パイプライン
    • 開発環境
    • ソースコード(IaaC)
    • ビルド&テスト
    • デプロイ

プロダクトパイプライン(1)

Java、SpringBoot

開発環境

  • Windows10 Pro
  • IntelliJ
  • docker-compose
    • MySQL
    • Redis

ソースコード管理

  • GitBucket
  • Nexus(Maven Repository)
  • S3(APIドキュメント)

ビルド&テスト(Jenkins)

  • Gradle Build
  • SonarQube
  • JUnit

デプロイ(Jenkins)

  • jar + shell -> zip -> aws cli -> S3

プロダクトパイプライン(2)

PHP、Laravel

開発環境

  • Windows10
  • VSCode / IntelliJ
  • WSL
    • PHP
    • Redis
    • Apache

ソースコード管理

  • GitLab

ビルド&テスト&デプロイ(AWS CodeBuild)

  • Composer
  • PHPMD
  • PHPUnit
  • atoum
  • Clouser Complier
  • PHP + php.ini + httpd.conf + shell -> zip -> aws cli -> S3

環境パイプライン

インフラチームがやってた。

開発環境

  • Windows
  • VirtualBox
  • Ansible

ソースコード管理

  • SVN、ファイルサーバ
  • Excelパラメータシート
  • RDS
  • S3

ビルド&テスト

  • なし、手動

デプロイ

  • API呼び出しで内製アプリケーションがRDSのパラメータをAWSリソースに反映

アプリのリリースの流れ

  • AMIのベースイメージを事前に作っておく(カーネルバージョンアップまでやって固めておく)
  • 内製アプリがEC2をkillする
  • AutoScaling GroupのAutoHealing契機で以下が走る。内製アプリが諸々を実行する
    • EC2のHealthyを検知
    • NIC、EBSアタッチ
    • AnsibleでEC2上のミドル設定をやる
    • CloudWatch logs agentインストール
    • ミドルインストール(Java、PHPなど)
    • S3経由でアプリをインストール
    • アプリを起動(jar / apache restart)
  • BlueGreen ReleaseはLBに紐づくAutoScaling Group切り替えをConnection Drainingで実施
  • AWSリソースの変更は内製アプリ経由で実行

おまけ

  • ↑とは別の案件で、もろもろ固めたものをPackerでAMIを作ってリリースしているチームもありました
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment