1K Views
May 22, 17
スライド概要
2017/05/21 Frontiers' Conference 2017発表資料
Claris FileMaker 認定デベロッパ、kintone認定 アプリデザインスペシャリスト(2020年2月)、kintone認定 カスタマイズスペシャリスト(2020年3月)。
FileMaker ServerཧऀͷͨΊͷ Serverspecೖʢ2017൛ʣ 2017/05/21 Frontiers' Conference 2017ൃදࢿྉ দඌ ಞʢࣜגձࣾΤϛοΫʣ
ࣗݾհ • দඌɹಞʢ·͓ͭɹ͋ͭ͠ʣ ‣ ࣜגձࣾΤϛοΫɹදऔక ‣ FileMaker ServerରԠWebϑϨʔϜϫʔΫ ʮINTER-Mediatorʯίϛολʔ ‣ Blog: http://www.famlog.jp/ ‣ Twitter: @matsuo_atsushi
ࠓճͷ • FileMaker Cloudͷొ • Infrastructure as Codeͱ͍͏ํ๏ • αʔόʔςετπʔϧʮServerspecʯͷ հ
ࠓΫϥυશͷ࣌ • ͍ͭʹFileMaker͔ࣾΒ७ਖ਼Ϋϥυ αʔϏε͕ొ
FileMaker Cloud • FileMaker, Inc.ͷ७ਖ਼ΫϥυαʔϏε • AWSʢAmazon Web Servicesʣ্Ͱಈ࡞ • ࡢ9݄ʹൃද • 20175݄ࡏݱɺຊͰར༻ෆՄ
OSCentOS Linux • ΦϯϓϨϛε͚ͷFileMaker ServerͰ ରԠOSWindows ServerͱmacOS • ҰํɺFileMaker CloudͷOSLinuxͷΈ
Ϋϥυʹର͢Δෆ҆ • αʔόʔཧख๏ͷҧ͍ • ΦϖϨʔςΟϯάγεςϜͷҧ͍ • ྉۚମܥͷҧ͍ʢAWSैྔ੍ྉۚʣ etc.
Infrastructure as Code
Infrastructure as Code • ιϑτΣΞ։ൃͰ༗ޮͰ͋Δͱ͔ͬ ͍ͯΔϓϥΫςΟεΛγεςϜཧʹ Ԡ༻͢ΔͨΊͷํ๏ • ͜Εͳ͠ͰΫϥυͷαʔόʔཧ ͍͠
ιϑτΣΞ։ൃͷ ϓϥΫςΟε • όʔδϣϯཧ • ςετ • ࣗಈԽ • ܧଓతΠϯςάϨʔγϣϯʢCIʣ etc.
Infrastructure as CodeͰ • όʔδϣϯཧ • ܁Γฦ͠ՄೳͳϏϧυ • ςετ • ܧଓతΠϯςάϨʔγϣϯʢCIʣ • ܧଓతσϓϩΠ
Infrastructure as Code • ͞·͟·ͳπʔϧαʔϏε͕ଘࡏ • ΦϯϓϨϛεͷཧαʔόʔཧʹ ཱͭ • ࠓճαʔόʔςετπʔϧΛհ • ΤϛοΫͰServerspecΛར༻
Serverspec
201010݄ • FM-TokyoͷϥΠτχϯάτʔΫൃද ʮςεςΟϯάϑϨʔϜϫʔΫͱαʔ όʔӡ༻ʯ
ςεςΟϯάϑϨʔϜϫʔΫ αʔόʔͷӡ༻ʹ͑Δ
αʔόʔͷӡ༻ཧͰ ඞཁʹͳΔ͜ͱ • ҆ఆͨ͠ܧଓతͳαʔόʔӡ༻ • มԽͷରԠ • ηΩϡϦςΟΞοϓσʔτ • γεςϜͷߋ৽อकཧʢιϑτ ΣΞͷόʔδϣϯΞοϓͷରԠʣ
҆ఆͨ͠ӡ༻ͷͨΊʹ • ਖ਼ৗͳঢ়ͱگԿ͔ΛΔ • ճආ͍ͨ͠ঢ়ͱگԿ͔ΛΔ • ͦͷ্Ͱݱঢ়ͷঢ়ଶΛΔ
ࣗಈԽͷඞཁੑ • खಈͰ͞·͟·ͳ߲ΛνΣοΫ͢Δ ͷ࣌ؒͱख͕͔͔ؒͬͯ͠·͏ • νΣοΫ߲ରαʔόʔ͕૿Ճɺ ରόʔδϣϯ͕͕͍ͬͯ͘ͱ……
RSpec • ςεςΟϯάϑϨʔϜϫʔΫ RSpec is testing tool for the Ruby programming language.
RSpecͰαʔόʔͷςετ • ΤϛοΫͰ2008͔ΒRSpecΛ༻׆ • ͨͩ͠ɺॏෳ͓ΑͼͳՕॴ͕ग़ͯ ͘Δ͜ͱ͕গ͍ͨͯͬ͠ͳʹؾ • ΑΓ؆ܿʹαʔόʔͷςετΛهड़Ͱ ͖ͳ͍ͩΖ͏͔ʁ
20133݄ Serverspec͕ެ։
Serverspec “With serverspec, you can write RSpec tests for checking your servers are configured correctly.” http://serverspec.org/
Serverspec “Serverspec tests your servers' actual state by executing command locally, via SSH, via WinRM, via Docker API and so on. So you don't need to install any agent softwares on your servers and can use any configuration management tools, Puppet, Ansible, CFEngine, Itamae and so on.” http://serverspec.org/
Serverspec • ٶԼ߶ีࢯ͕20133݄ʹެ։ • ߏஙࡁΈͷαʔόʔ͕ҙਤ௨Γઃఆ͞ Ε͍ͯΔ͔֬ೝ͢Δπʔϧ • RSpecΛͬͯςετΛ؆ܿʹॻ͚Δ • MIT License
Serverspecͱ “γεςϜͷ͋Δ͖ঢ়ଶΛ؆ܿʹهड़͠ ܧଓతʹςετ͢ΔͨΊͷͷ” http://www.slideshare.net/mizzy/serverspec-hbstudy45
Supported OS AIX, Arch Linux, Darwin (macOS), Debian, Fedora/Red Hat/CentOS, FreeBSD, Gentoo Linux, NixOS, OpenBSD, openSUSE, Plamo Linux, SmartOS, Solaris, SUSE, Ubuntu, Windows
Serverspecͷ࢝Ίํ $ gem install serverspec rake (sudo gem install serverspec rake) $ serverspec-init $ rake spec
ServerspecͰͷهड़ྫ
require 'spec_helper'
describe service('fmserverd') do
it { should be_running }
end
describe service('httpd'), :if => os[:family] == 'darwin' do
it { should be_running }
end
describe file('/Library/FileMaker Server/HTTPServer/conf/extra/httpd-ssl.conf') do
its(:content) { should match /SSLProtocol TLSv1.2/ }
end
describe cron do
it { should have_entry '2 4 * * * /usr/local/bin/fmsadmin restart -y adminserver' }
end
Serverspecͷ֓ཁ • γΣϧίϚϯυ࣮ߦʹΑΔαʔόʔͷ ςετΛεϚʔτʹ࣮ݱ • ςετରͷαʔόʔʹSSHͰଓ͠ ͯίϚϯυΛ࣮ߦ • ϩʔΧϧͰ࣮ߦՄ
ServerspecRSpecϕʔε • RSpecͷςετͱซ༻Մೳ • ΤϛοΫͰطଘͷRSpecʹΑΔςε τΛঃʑʹServerspecϕʔεʹมߋ͠ ͍ͯͬͨ
σϞ
Serverspecͷྫࣄ༻׆ • INTER-Mediator-Server VM • όʔδϣϯ5.6ͰϕʔεOSΛUbuntu Server 14.04͔ΒAlpine Linux 3.5ʹมߋ ༧ఆ • ϦϑΝΫλϦϯάʹServerspecΛ༻׆
Serverspec “But the true aim of Serverspec is to help refactoring infrastructure code.” http://serverspec.org/
·ͱΊ • Infrastructure as Codeͷํ๏Λֶͼ FileMaker Cloudʹඋ͑·͠ΐ͏ • αʔόʔςετπʔϧ͔Β͍࢝Ίͯ ΈΔͱணख͍͢͠ͷͰ
ؔ࿈URL • http://serverspec.org/ • https://github.com/mizzy/serverspec • http://www.slideshare.net/mizzy/ serverspec-hbstudy45 • http://www.slideshare.net/mizzy/ serverspec-at-testing-framework-meeting
ࢀߟॻ੶ • ServerspecʢΦϥΠϦʔɾδϟύϯʣ • Infrastructure as CodeʢΦϥΠϦʔɾ δϟύϯʣ