$30 off During Our Annual Pro Sale. View Details »

Jenkins環境運用に関するSWETとしての取り組み

 Jenkins環境運用に関するSWETとしての取り組み

Hisashi.Iguchi

January 31, 2020
Tweet

More Decks by Hisashi.Iguchi

Other Decks in Technology

Transcript

  1. Jenkins 2'06:3<
    SWET #7

    GDM vol.40 %")! Jenkins 0,:3@DeNA Fri. Jan. 31, 2020
    $ +*
    .; &98-; &951; SWET
    /(!4

    View Slide

  2. *)
    • $
    • 1Hisashi Iguchi2@hisa9chi

    • #( SWET Gr.

    • *
    /'

    • CI/CD %&.0-!+,"
    • %
    • CircleCI Japan User Group Community Leaders
    2

    View Slide


  3. 3
    SWET
    Jenkins
    SWET
    1
    4

    2
    3

    View Slide


  4. 4
    SWET
    Jenkins
    SWET
    1
    4

    2
    3

    View Slide

  5. SoftWare Engineer in Test
    c.f.> Google SET

    5
    4
    3
    2
    1

    View Slide

  6. 6
    MISSION
    1)

    • DeNA#/%0$
    • DeNA2-+,&$
    !"*.('
    VISION
    MAKE TESTING FUN, SMART,
    AND DELIGHTING END-USERS
    4
    3
    2
    1

    View Slide

  7. Make Testing Fun, Smart, and Delighting End-Users
    • Fun
    • '2&#
    • Smart
    • .-9* 15/7
    • "( !)148
    • Delighting End-Users
    • ' $(% 3,:60'
    +)

    7
    4
    3
    2
    1

    View Slide

  8. 8
    !
    !
    https://swet.dena.com/about
    4
    3
    2
    1

    View Slide


  9. 9
    SWET
    Jenkins
    SWET
    1
    4

    2
    3

    View Slide




  10. • iOS
    • Android
    • OS
    • Linux (Ubuntu)
    • macOS


    • Unity
    10
    1 4
    3
    2

    View Slide

  11. Jenkins *4

    • :! "%51+/6
    • -8(3
    • $7.'3
    • *4&$
    • Xcode 4 $
    • iOS,0)3 macOS "%/6
    • %%
    Unity *4
    • Unity Cloud Build 7.962%"
    11
    1 4
    3
    2

    View Slide

  12. Jenkins ',
    • &',

    +&
    • '$
    • & master '$!
    • macOS ()
    12
    1 4
    3
    2
    Jenkins master
    -*"%
    .#

    View Slide

  13. Jenkins
    37
    • .>
    • & 1.)37
    • 45!&.=
    • ,:'%&'%
    • Jenkins / Xcode / Unity / Android NDK
    • %#(-)(6;
    • /+9
    %
    • Jenkins 378?9 or 18?9
    13
    1 4
    3
    2
    "3-8?9 $& or
    <2*0

    View Slide

  14. Jenkins E<
    • $!,2#''
    • 1A"'
    F0,2
    • &*>/8
    • C
    ,2
    • . plugin ')&
    • slave #''
    • 6 1A)&3-')&
    • $! %)=;7 SSH4? D9(B:
    • slave @+5G
    14
    1 4
    3
    2

    View Slide

  15. Jenkins !
    • slave
    • "
    • "

    #
    • !
    • "
    15
    1 4
    3
    2
    Jenkins master
    macOS agent
    Jenkins master

    macOS agent
    Jenkins master
    macOS agent
    macOS agent
    !

    View Slide

  16. 16




    1 4
    3
    2

    View Slide

  17. U:Z
    • +"/Q2WK!$'D
    • master / slave /*.

    • MT9KAN5KB @S
    • Jenkins plugin OJ
    • #,)OJ;Y
    • Jenkinsfile G$&- WebUI#,)3C
    • Plugin =6 >HOJ9P?7
    • 4#,)I 8K1F
    • XL(0%VR #,)E< OJ;Y
    17
    1 4
    3
    2

    View Slide

  18. D
    ,G
    • slave 9=.3>
    • " 5F#&C: slave 7B&$%&$
    • " 7BE*8<1 slave +(
    18
    1 4
    3
    2
    Jenkins master
    macOS agent
    macOS agent
    !%%
    !%%;
    ?'4/
    <1 slave +(" A60-2@)

    View Slide

  19. D1H
    • slave E.9"
    • $#'0 ,47/"2G
    • 8F= slave <3?)65@(&;-
    5@
    • *A
    19
    1 4
    3
    2
    Jenkins master
    macOS agent
    macOS agent
    ① C:
    macOS agent
    ② "
    ③ %!/+>B

    View Slide

  20. B 'G
    • 04'G
    • Jenkins ,/7!( 78
    E;
    • Jenkins master / slave "2.D<9
    • =$
    -3)61 "F
    • =$:
    %B&
    • A?'G
    • 'G
    • F5*C'G
    • *C
    >8# +@
    20
    1 4
    3
    2

    View Slide

  21. 21
    SWET

    !



    1 4
    3
    2

    View Slide


  22. 22
    SWET
    Jenkins
    SWET
    1
    4

    2
    3

    View Slide

  23. !.
    1. Jenkins )%
    • master / slave )%$/
    • master / slave(Linux) cloud *+
    2.
    1
    • Jenkins master 1

    • slave 1)-4Linux / macOS5
    • ,3#(

    3. &
    • Unity + iOS / Android
    &
    23
    1 2 4
    3
    2'
    *+"0

    View Slide

  24. 24
    1. Jenkins
    1 2 4
    3

    View Slide

  25. Jenkins

    • master - slave slave
    25
    1 2 4
    3
    macOS agent
    Linux agent
    Jenkins master
    macOS agent
    Persistent Disk
    GCP
    JNLP


    View Slide

  26. Jenkins "

    • master - slave 'slave#(
    26
    1 2 4
    3
    !
    JNLP
    macOS agent
    macOS agent
    !

    %&$
    Jenkins master
    Persistent Disk

    Linux agent
    GCP

    View Slide

  27. Jenkins

    • master - slave slave
    27
    1 2 4
    3
    Linux agent
    Jenkins master
    Persistent Disk
    GCP
    JNLP

    macOS agent
    macOS agent


    OS update

    View Slide

  28. Jenkins

    • master - slave slave
    28
    1 2 4
    3
    macOS agent
    Linux agent
    Jenkins master
    macOS agent
    Persistent Disk
    GCP
    JNLP


    View Slide

  29. Jenkins

    • master - slave #slave $
    29
    1 2 4
    3
    macOS agent
    Linux agent
    Jenkins master
    macOS agent
    Persistent Disk
    GCP
    JNL
    P

    "
    !

    View Slide

  30. 30
    "
    #

    !

    1 2 4
    3

    View Slide

  31. 31
    2.
    1 2 4
    3

    View Slide

  32. master ' %


    • ubuntu: GCP Terraform #
    • Jenkins
    • Ansible
    • #
    • https://github.com/Kuniwak/jenkins-plugin-fixator "#
    • $(# influxDB / Telegraf / Chronograf / Kapacitor
    • /
    • GCP
    !&"#
    32
    1 2 4
    3

    View Slide

  33. slave /!%-
    • #
    • macOS: &' mac mini *3.
    • ubuntu: GCP Terraform (#


    • Ansible

    • +"1
    • Unity / Xcode / Android NDK 0$
    • slave ,'
    • )2( Telegraf

    33
    1 2 4
    3

    View Slide

  34. slave /!%-
    • #
    • macOS: &' mac mini *3.
    • ubuntu: GCP Terraform (#


    • Ansible

    • +"1
    • Unity / Xcode / Android NDK 0$
    • slave ,'
    • )2( Telegraf

    34
    1 2 4
    3
    # for rbenv role
    install_ruby_versions:
    - 2.4.5
    - 2.5.1
    - 2.6.1
    global_ruby_version: 2.5.1
    # for xcode role
    xcode_clean: true
    xcode_versions:
    - '10.1'
    default_xcode_version: '10.1'
    # for android role
    android_versions:
    - 25
    - 26
    - 27
    - 28
    build_tools_versions:
    - 25.0.3
    - 26.0.2
    - 27.0.3
    - 28.0.3
    # for unity role
    unity_versions:
    - 2018.3.3f1
    # for jenkins_slave
    jenkins_slave_name: 'o-12778-mac'
    jenkins_slave_secret: !vault |
    $ANSIBLE_VAULT;1.1;AES256
    3932356633663834333631663634353731656

    View Slide

  35. slave #'
    • )
    • +!
    ,
    )
    • *"%
    *(
    • https://plugins.jenkins.io/app-detector
    $&
    35
    1 2 4
    3

    View Slide

  36. slave IA
    • $" 9G#$"$
    • ?C;*A Ansible 2F
    • slave B@#$"!<9(2F
    • #$"!<946%/E10
    • 8,#$" -> &>'3 #-
    • 5
    Ansible .:
    • D746=) Ansible H+
    36
    1 2 4
    3

    View Slide

  37. 37
    3.

    1 2 4
    3

    View Slide

  38. Jenkins pipeline % #!/'
    • "#% #!
    • % #*9 3-2)56
    • +8 0
    .172)56
    • (;4: Jenkins Shared Library /'
    • "<,& $&
    38
    1 2 4
    3

    View Slide

  39. 39
    Jenkins



    1 2 4
    3

    View Slide

  40. 40



    1 2 4
    3

    View Slide

  41. 41

    1 2 4
    3

    View Slide

  42. 42
    TASK [xcode : Install Xcode (NOTE: This task take a long time. And, it doesn‘t work
    when Two-Factor Authentication is enable. If you want to check progress, do `sudo tail
    -f /private/var/root/Library/Caches/XcodeInstall/progress.*`)] ***
    failed: [unity-macos-1014] (item=11.1) => changed=true
    cmd:
    - /var/root/.gem/ruby/2.5.0/bin/xcversion
    - install
    - ’11.1’
    delta: ‘0:14:18.084891’
    end: ‘2019-12-15 20:05:30.908344’
    item: ‘11.1’
    msg: non-zero return code

    1 2 4
    3



    View Slide

  43. Ansible Playbook !/'
    • Xcode
    Unity ! !
    • Xcode
    • !$, xcode-install 0'
    • !.#)*
    • Unity
    • !(+
    • !1 Unity Hub (+
    • !!
    • brew java8
    % ruby !"&-
    43
    1 2 4
    3

    View Slide

  44. 44
    CI


    1 2 4
    3

    View Slide

  45. Ansible Playbook &"
    • OS Vagrant Box(
    )

    '$
    • Test Kitchen !
    • -> Ansible Playbook $ -> % # $
    45
    1 2 4
    3

    View Slide


  46. 46
    SWET
    Jenkins
    SWET
    1
    4


    2
    3

    View Slide


  47. )
    1. (
    1. %&
    2. Jenkins CI*"
    2. +' $ !#
    47
    1 2 3 4

    View Slide

  48. 48
    1.

    1 2 3 4

    View Slide

  49. 1 2 3
    #47
    • # ,<
    30
    • macOS?56"
    #47
    • MacStadium

    • CI#47
    • Jenkins
    %# 47
    • Bitirse
    • !# Unity #=8
    +;@ https://blog.bitrise.io/bitrise-in-2019-a-roadmap-preview
    .: /-1&
    *($
    • CircleCI
    • #'>92)47,<
    49
    4

    View Slide

  50. Jenkins

    50
    macOS agent
    Linux agent
    Jenkins master
    macOS agent
    GCS
    GCP

    MacStadium
    macOS agent
    1 2 3 4
    macOS agent
    macOS agent
    Linux agent
    Cloud CI
    Bitrise CircleCI

    View Slide

  51. Jenkins
    51
    Linux agent
    Jenkins master
    GCS
    GCP

    MacStadium
    macOS agent
    1 2 3 4
    macOS agent
    macOS agent
    Linux agent
    Cloud CI
    Bitrise CircleCI
    macOS agent
    macOS agent



    PR

    View Slide

  52. Jenkins
    52
    macOS agent
    Linux agent
    Jenkins master
    macOS agent
    GCS
    GCP

    1 2 3 4
    Linux agent
    Cloud CI
    Bitrise CircleCI
    MacStadium
    macOS agent
    macOS agent
    macOS agent


    cron

    View Slide

  53. Jenkins
    53
    macOS agent
    Linux agent
    Jenkins master
    macOS agent
    GCS
    GCP

    MacStadium
    macOS agent
    1 2 3 4
    macOS agent
    macOS agent
    Linux agent
    Cloud CI
    Bitrise CircleCI

    View Slide

  54. Jenkins

    54
    macOS agent
    Linux agent
    Jenkins master
    macOS agent
    GCS
    GCP

    MacStadium
    macOS agent
    1 2 3 4
    macOS agent
    macOS agent
    Linux agent
    Cloud CI
    Bitrise CircleCI

    View Slide

  55. 55
    2.

    1 2 3 4

    View Slide

  56. 1 2 3
    CI>/C9JE67D,K
    • #'"):C95G-
    • #'#H@")
    • Unity Cloud Build Bitrise
    % )!,182
    • !& 4I)
    0

    • αβH@")
    • % )!<=>/*3;?82
    • F?")
    • % )!<=>/*3;?82
    • $([email protected]
    56
    4

    View Slide

  57. 57

    View Slide



  58. • .(OHP0Jenkins B<K7BJ
    • Terraform / Ansible DG
    • macOS 28 GCP/BJ
    • Jenkins B< ?6DG4
    -&,)% =5
    • BJG +&"*.>@AI
    • CI73AM
    • 1:*#.$ DG .*$+!Q
    • N9;L -> EF'-
    • N9 C -> *#.$
    58

    View Slide

  59. 59
    End.

    View Slide