Slide 1

Slide 1 text

ΦϯϓϨϛεJenkins Λ΍ͬͱ૴Γڈͬͨ࿩ 2016/04/21 PHPBLT#4 Jun Watanabe

Slide 2

Slide 2 text

Jun Watanabe @rela1470 • ΃ͪͺʔ6೥໨ • ORATTA, Inc Chief Engineer • http://rela.red/

Slide 3

Slide 3 text

݁࿦

Slide 4

Slide 4 text

JenkinsΛcircleciʹ͠·ͨ͠!

Slide 5

Slide 5 text

͛͢ʔΑ͘ฉ͘࿩

Slide 6

Slide 6 text

৭ʑͭ·͍ͮͨΓ ؤுͬͨͷͰ ۪ஒΒ͍ͤͯͩ͘͞

Slide 7

Slide 7 text

෩࿊෦(ࣾ಺੍౓) िʹ3࣌ؒձٞࣨʹ࿜ͬͯ ͻͨ͢Βۀ຿վળɾٕज़ௐࠪ ORATTA Frontier TechͷଏশΒ͍͠

Slide 8

Slide 8 text

ࠓ೥2݄͔Β CIվળΛ ΍ͬͯ·ͨ͠

Slide 9

Slide 9 text

͍··Ͱͷվળ

Slide 10

Slide 10 text

͓ͬ͞Μͷإ͕ݏ

Slide 11

Slide 11 text

ঁମԽͰ ղܾ ࣗࣾͷσβΠφʔ͞Μʹॻ͍ͯ΋Β͍·ͨ͠ʘ(^o^)ʗ

Slide 12

Slide 12 text

σβΠϯ͕ ݹष͍

Slide 13

Slide 13 text

http://aarjithn.github.io/jenkins-neo-theme/

Slide 14

Slide 14 text

ͦΕͰ΋ཷ·Δ Jenkinsͷ໰୊఺

Slide 15

Slide 15 text

ҡ࣋͢ΔͨΊͷ ίετ͕ߴ͍

Slide 16

Slide 16 text

खಈͰͷόʔδϣϯΞοϓ

Slide 17

Slide 17 text

ϓϥάΠϯ45ݸ

Slide 18

Slide 18 text

PHP΍PEARͷ ϓϩμΫτࠩ෼

Slide 19

Slide 19 text

circleciಋೖͰ Ͳ͏΍ͬͯղܾ͔ͨ͠

Slide 20

Slide 20 text

PEAR໰୊

Slide 21

Slide 21 text

Composerಋೖ

Slide 22

Slide 22 text

άάΔͱग़ͯ͘Δ΍ͭ { "require": { "pear-pear.php.net/PEAR" : "*", "pear-pear.php.net/log" : "*", "pear-pear.php.net/http_request2" : "*" }, "repositories": [ { "type": "pear", "url": "http://pear.php.net" } ] }

Slide 23

Slide 23 text

2016/03/03

Slide 24

Slide 24 text

2016/03/10

Slide 25

Slide 25 text

ಈ͔ͳ͘ ͳͬͯͨ…

Slide 26

Slide 26 text

2016/3/4 ϦϦʔε composer 1.0.0-beta1 ࢓༷มߋ http௨৴NG͕ σϑΥϧτઃఆʹ

Slide 27

Slide 27 text

Composerා͍

Slide 28

Slide 28 text

౰࣌͸ղܾࡦ͕ Θ͔Βͳ͔ͬͨ

Slide 29

Slide 29 text

͖ͬ͞QiitaͰݟ͚ͭ·ͨ͠ http://qiita.com/shinkuFencer/items/00c6cdbc0d0e0e081e38

Slide 30

Slide 30 text

httpΛڐͯ͠΋Β͏ { "config": { "secure-http": false }, "require": { "pear-pear.php.net/PEAR" : "*", "pear-pear.php.net/log" : "*", "pear-pear.php.net/http_request2" : "*" }, "repositories": [ { "type": "pear", "url": "http://pear.php.net" } ] }

Slide 31

Slide 31 text

ࠓճ͸Ͳ͏͔ͨ͠

Slide 32

Slide 32 text

Packagist

Slide 33

Slide 33 text

Packagistʹ͋Δ΍ͭΛ࢖͏ { "require": { "pear/pear": "dev-master", "pear/log": "*@stable", "pear/http_request2": "v2.3.0" }, "require-dev": { "phpunit/phpunit": "4.8.23", } }

Slide 34

Slide 34 text

Θ͟Θ͟ΦϓγϣϯͰηΩϡ ϦςΟऑΊͳͯ͘ྑ͍ ΠϚυΩͬΆ͍

Slide 35

Slide 35 text

PackagistͰ ࣮૷ͯ͠ ྑ͔ͬͨ

Slide 36

Slide 36 text

ྑ͔ͬͨ…

Slide 37

Slide 37 text

PHPͷόʔδϣϯ

Slide 38

Slide 38 text

7.0.4 / 7.0.0RC7 / 5.6.14 / 5.6.5 / 5.6.2 / 5.5.21 / 5.5.16 / 5.5.15 / 5.5.11 / 5.5.9 / 5.5.8 / 5.5.7 / 5.5.3 / 5.5.2 / 5.5.0 / 5.4.37 / 5.4.21 / 5.4.19 / 5.4.18 / 5.4.15 / 5.4.14 / 5.4.13 / 5.4.12 / 5.4.11 / 5.4.10 / 5.4.9 / 5.4.8 / 5.4.7 / 5.4.6 / 5.4.5 / 5.4.4 / 5.3.25 / 5.3.20 / 5.3.10 / 5.3.3

Slide 39

Slide 39 text

circle.ymlͰόʔδϣϯࢦఆ machine: php: version: 5.5.21

Slide 40

Slide 40 text

gitͷ഑ஔ

Slide 41

Slide 41 text

1ϓϩδΣΫτ 5ͭ͘Β͍ͷgitʹ ෼͔Ε͍ͯΔ

Slide 42

Slide 42 text

ϓϩδΣΫτͷgit഑ஔྫ multi [multi.git] //ࣗࣾϑϨʔϜϫʔΫ !system ɹ"addon ɹ#ɹ!asuka [asuka.git] //ϓϩδΣΫτຖͷಠ࣮ࣗ૷ιʔε ɹ#ɹɹ"master [asuka-master.git]ɹ//ΞΠςϜ౳ͷϚελʔઃఆ ɹ#ɹɹ!web [asuka-web.git]ɹ//ը૾΍Ի੠౳ ɹ!lib[lib.git] //ࣗࣾϥΠϒϥϦ

Slide 43

Slide 43 text

αϒϞδϡʔϧԽ ͨ͠

Slide 44

Slide 44 text

αϒϞδϡʔϧԽ ͔ͨͬͨ͠

Slide 45

Slide 45 text

෺ཧͰԥͬͨ (circle.yml)

Slide 46

Slide 46 text

git cloneͯ͠ ࣗ෼Ͱ഑ஔ͠ͳ͓͢ checkout: post: - "mkdir -p /tmp/yaml" - "git clone -b ${CIRCLE_BRANCH} [email protected]:oratta-inc/multi.git / home/ubuntu/multi" - "git clone -b ${CIRCLE_BRANCH} [email protected]:oratta-inc/lib.git /home/ ubuntu/multi/system/lib" - "mkdir /home/ubuntu/multi/system/addon" test: pre: - "cp -a /home/ubuntu/${CIRCLE_PROJECT_REPONAME}/ /home/ubuntu/multi/ system/addon/${CIRCLE_PROJECT_REPONAME}” - "git clone -b ${CIRCLE_BRANCH} [email protected]:oratta-inc/asuka- master.git /home/ubuntu/multi/system/addon/asuka/master” override: - "phpunit -c /home/ubuntu/multi/system/addon/${CIRCLE_PROJECT_REPONAME}/ phpunit.xml -d memory_limit=512M"

Slide 47

Slide 47 text

ຖճ1͔Β git clone

Slide 48

Slide 48 text

No content

Slide 49

Slide 49 text

13ඵ͘Β͍

Slide 50

Slide 50 text

GitHub͸ҙ֎ͱૣ͍

Slide 51

Slide 51 text

ΩϟογϡʹೖΕͯ ϦετΞΛࢼͨ͠Β ٯʹ஗͘ͳͬͨ

Slide 52

Slide 52 text

ϏϧυνΣΠϯ

Slide 53

Slide 53 text

ϓϩδΣΫτͷgit഑ஔྫ multi [multi.git] //ࣗࣾϑϨʔϜϫʔΫ !system ɹ"addon ɹ#ɹ!asuka [asuka.git] //ϓϩδΣΫτຖͷಠ࣮ࣗ૷ιʔε ɹ#ɹɹ"master [asuka-master.git]ɹ//ΞΠςϜ౳ͷϚελʔઃఆ ɹ#ɹɹ!web [asuka-web.git]ɹ//ը૾΍Ի੠౳ ɹ!lib[lib.git] //ࣗࣾϥΠϒϥϦ

Slide 54

Slide 54 text

্ҐͷGit͕ߋ৽͞Εͨ৔߹ શϓϩδΣΫτͷςετΛ ૸Β͍ͤͨ

Slide 55

Slide 55 text

෺ཧͰԥͬͨ (circle.yml)

Slide 56

Slide 56 text

ςετʹ੒ޭͨ͠Β ؔ࿈͢ΔϓϩδΣΫτΛAPIܦ༝Ͱ࣮ߦ deployment: develop: branch: develop commands: - curl -X POST https://circleci.com/api/v1/project/oratta-inc/rave/ tree/develop?circle-token=$CHAIN_PROJECT_TOKEN - curl -X POST https://circleci.com/api/v1/project/oratta-inc/chloris/ tree/develop?circle-token=$CHAIN_PROJECT_TOKEN - curl -X POST https://circleci.com/api/v1/project/oratta-inc/dark/ tree/develop?circle-token=$CHAIN_PROJECT_TOKEN - curl -X POST https://circleci.com/api/v1/project/oratta-inc/bleach/ tree/develop?circle-token=$CHAIN_PROJECT_TOKEN - curl -X POST https://circleci.com/api/v1/project/oratta-inc/asuka/ tree/develop?circle-token=$CHAIN_PROJECT_TOKEN - curl -X POST https://circleci.com/api/v1/project/oratta-inc/sengoku/ tree/develop?circle-token=$CHAIN_PROJECT_TOKEN - curl -X POST https://circleci.com/api/v1/project/oratta-inc/aqua/ tree/develop?circle-token=$CHAIN_PROJECT_TOKEN

Slide 57

Slide 57 text

No content

Slide 58

Slide 58 text

ແྉϓϥϯͩͱ 1ίϯςφͷΈ

Slide 59

Slide 59 text

஗͍

Slide 60

Slide 60 text

ۚͰԥΔ?

Slide 61

Slide 61 text

Slack࿈ܞ

Slide 62

Slide 62 text

PHPͰಠ࣮ࣗ૷

Slide 63

Slide 63 text

σϑΥϧτͰ࿈ܞػೳ͋Γ

Slide 64

Slide 64 text

෭࢈෺

Slide 65

Slide 65 text

composerಋೖͰ ϩʔΧϧ؀ڥ͕౷Ұग़དྷͨ

Slide 66

Slide 66 text

PhpStormͰΧόϨοδͱ͔

Slide 67

Slide 67 text

·ͱΊ

Slide 68

Slide 68 text

ϨΨγʔγεςϜͰ΋ ෺ཧ(circle.yml)Ͱ ͳΜͱ͔ͳΔ

Slide 69

Slide 69 text

Composerා͍