+ All Categories
Home > Technology > Continuous Integration on my work

Continuous Integration on my work

Date post: 27-Jan-2015
Category:
Upload: mu-chun-wang
View: 106 times
Download: 2 times
Share this document with a friend
Description:
 
Popular Tags:
61
Continuous Integration on my work Kewang
Transcript
Page 1: Continuous Integration on my work

Continuous Integration on my work

Kewang

Page 2: Continuous Integration on my work

2

Agenda

● What is Continuous Integration ?● CI software● CI integrate 3rd-party software● How to apply CI to my work ?● Live DEMO● CI Principles● TODO list

Page 3: Continuous Integration on my work

What is Continuous Integration ?

Page 4: Continuous Integration on my work

4

Continuous Integration is ...

● CI● An important role at Agile & TDD

Page 5: Continuous Integration on my work

5

Continuous Integration should have

● Split source code to small & easy-maintain snippets● Test snippets● Commit source code to VCS frequently● Auto checkout latest source code & run all tests

Page 6: Continuous Integration on my work

Case Study

Page 7: Continuous Integration on my work

7

Case Study 1

Page 8: Continuous Integration on my work

8

Case Study 2

Page 9: Continuous Integration on my work

9

Case Study 3

Page 10: Continuous Integration on my work

CI software

Page 11: Continuous Integration on my work

11

Travis CI

Page 12: Continuous Integration on my work

12

Hudson / Jenkins

Page 13: Continuous Integration on my work

CI integrate 3rd-party software

Page 14: Continuous Integration on my work

14

3rd-party software includes ...

● Version Control System (i.e. Git / SVN / others)● Redmine● Maven● Pandoc● more & more ......

Page 15: Continuous Integration on my work

15

Git

● git clone● git add● git rm● git commit● git pull

● git push● git branch● git checkout● git merge

Page 16: Continuous Integration on my work

16

Redmine

● Project management● Issue tracking● Wiki● Forum● File management

Page 17: Continuous Integration on my work

17

Maven

● Making the build process easy● Providing a uniform build system● Convention over Configuration (CoC)● Dependency management

Page 18: Continuous Integration on my work

18

Pandoc

● It can convert markup file to many format documents.

● Markup file, like Markdown, HTML, LaTeX, Wiki, or other markup language.

● Artifact has more format, like Markdown, HTML, docx, EPUB, PDF, ......etc.

Page 19: Continuous Integration on my work

How to apply CI to my work ?

Page 20: Continuous Integration on my work

20

Example

● Auto-deploy backend program● Auto-publish API spec

Page 21: Continuous Integration on my work

Auto-deploy backend program

Page 22: Continuous Integration on my work

22

Step by step

1.Check out the latest source code

2.Compile it to jar file

3.Upload to backend

Page 23: Continuous Integration on my work

23

Step by step

1.Check out the latest source code from `dev`

2.Compile it to jar file

3.Merge `dev` to `master`

4.Upload to backend

Page 24: Continuous Integration on my work

24

Step by step

1.Check out the latest source code from `dev`

2.Compile it to jar file

3.Merge `dev` to `master`

4.Upload to backend1. Stop backend

Page 25: Continuous Integration on my work

25

Step by step

1.Check out the latest source code from `dev`

2.Compile it to jar file

3.Merge `dev` to `master`

4.Upload to backend1. Stop backend

2. Copy jar & its dependency files to backend

Page 26: Continuous Integration on my work

26

Step by step

1.Check out the latest source code from `dev`

2.Compile it to jar file

3.Merge `dev` to `master`

4.Upload to backend1. Stop backend

2. Copy jar & its dependency files to backend

3. Start backend

Page 27: Continuous Integration on my work

27

Step by step

1.Check out the latest source code from `dev`

2.Compile it to jar file

3.Merge `dev` to `master`

4.Upload to backend1. Stop backend

2. Copy jar & its dependency files to backend

3. Start backend

5.Send mail to all RD

Page 28: Continuous Integration on my work

28

Step by step

1.Check out the latest source code from `dev`

2.Compile it to jar file

3.Merge `dev` to `master`

4.Upload to backend1. Stop backend

2. Copy jar & its dependency files to backend

3. Start backend

5.Send mail to all RD1. Send mail to backend RD if failure

Page 29: Continuous Integration on my work

Auto-publish API spec

Page 30: Continuous Integration on my work

30

Step by step

1.Check out the latest Markdown

2.Convert Markdown to PDF

3.Upload PDF to Redmine

Page 31: Continuous Integration on my work

31

Step by step

1.Check out the latest Markdown from `dev`

2.Convert Markdown to PDF

3.Upload PDF to Redmine

4.Merge `dev` to `master`

Page 32: Continuous Integration on my work

32

Step by step

1.Check out the latest Markdown from `dev`

2.Convert Markdown to PDF

3.Upload PDF to Redmine1. Call RESTful API to upload PDF file to Redmine

4.Merge `dev` to `master`

Page 33: Continuous Integration on my work

33

Step by step

1.Check out the latest Markdown from `dev`

2.Convert Markdown to PDF

3.Upload PDF to Redmine1. Call RESTful API to upload PDF file to Redmine

2. Send file id to Redmine

4.Merge `dev` to `master`

Page 34: Continuous Integration on my work

34

Step by step

1.Check out the latest Markdown from `dev`

2.Convert Markdown to PDF

3.Upload PDF to Redmine1. Call RESTful API to upload PDF file to Redmine

2. Send file id to Redmine

3. Place the file into Files at Redmine

4.Merge `dev` to `master`

Page 35: Continuous Integration on my work

35

Step by step

1.Check out the latest Markdown from `dev`

2.Convert Markdown to PDF

3.Upload PDF to Redmine1. Call RESTful API to upload PDF file to Redmine

2. Send file id to Redmine

3. Place the file into Files at Redmine

4.Merge `dev` to `master`

5.Send file link at Redmine to all RD

Page 36: Continuous Integration on my work

Live DEMO

Page 37: Continuous Integration on my work

CI Principles

Page 38: Continuous Integration on my work

38

Principles for Developers

1.Commit code frequently

Page 39: Continuous Integration on my work

39

Principles for Developers

1.Commit code frequently

2.Don't commit broken code

Page 40: Continuous Integration on my work

40

Principles for Developers

1.Commit code frequently

2.Don't commit broken code

3.Fix broken builds immediately

Page 41: Continuous Integration on my work

41

Principles for Developers

1.Commit code frequently

2.Don't commit broken code

3.Fix broken builds immediately

4.Write automated developers tests

Page 42: Continuous Integration on my work

42

Principles for Developers

1.Commit code frequently

2.Don't commit broken code

3.Fix broken builds immediately

4.Write automated developers tests

5.All tests and inspections must pass

Page 43: Continuous Integration on my work

43

Principles for Developers

1.Commit code frequently

2.Don't commit broken code

3.Fix broken builds immediately

4.Write automated developers tests

5.All tests and inspections must pass

6.Run private builds

Page 44: Continuous Integration on my work

44

Principles for Developers

1.Commit code frequently

2.Don't commit broken code

3.Fix broken builds immediately

4.Write automated developers tests

5.All tests and inspections must pass

6.Run private builds

7.Avoid getting broken code

Page 45: Continuous Integration on my work

45

Principles for CI Engineers

1.Automate builds

Page 46: Continuous Integration on my work

46

Principles for CI Engineers

1.Automate builds

2.Perform single command builds

Page 47: Continuous Integration on my work

47

Principles for CI Engineers

1.Automate builds

2.Perform single command builds

3.Separate build scripts from your IDE

Page 48: Continuous Integration on my work

48

Principles for CI Engineers

1.Automate builds

2.Perform single command builds

3.Separate build scripts from your IDE

4.Centralize software assets

Page 49: Continuous Integration on my work

49

Principles for CI Engineers

1.Automate builds

2.Perform single command builds

3.Separate build scripts from your IDE

4.Centralize software assets

5.Create a consistent directory structure

Page 50: Continuous Integration on my work

50

Principles for CI Engineers

1.Automate builds

2.Perform single command builds

3.Separate build scripts from your IDE

4.Centralize software assets

5.Create a consistent directory structure

6.Fail builds fast

Page 51: Continuous Integration on my work

51

Principles for CI Engineers

1.Automate builds

2.Perform single command builds

3.Separate build scripts from your IDE

4.Centralize software assets

5.Create a consistent directory structure

6.Fail builds fast

7.Build for any environment

Page 52: Continuous Integration on my work

52

Principles for CI Engineers

1.Automate builds

2.Perform single command builds

3.Separate build scripts from your IDE

4.Centralize software assets

5.Create a consistent directory structure

6.Fail builds fast

7.Build for any environment

8.Use a dedicated CI machine and a CI server

Page 53: Continuous Integration on my work

53

Principles for CI Engineers

1.Automate builds

2.Perform single command builds

3.Separate build scripts from your IDE

4.Centralize software assets

5.Create a consistent directory structure

6.Fail builds fast

7.Build for any environment

8.Use a dedicated CI machine and a CI server

9.Run fast builds

Page 54: Continuous Integration on my work

54

Principles for CI Engineers

1.Automate builds

2.Perform single command builds

3.Separate build scripts from your IDE

4.Centralize software assets

5.Create a consistent directory structure

6.Fail builds fast

7.Build for any environment

8.Use a dedicated CI machine and a CI server

9.Run fast builds

10.State builds

Page 55: Continuous Integration on my work

TODO list

Page 56: Continuous Integration on my work

56

TODO list

1.Run unit tests

Page 57: Continuous Integration on my work

57

TODO list

1.Run unit tests

2.Every commit build

Page 58: Continuous Integration on my work

58

TODO list

1.Run unit tests

2.Every commit build

3.Static code analysis

Page 59: Continuous Integration on my work

59

TODO list

1.Run unit tests

2.Every commit build

3.Static code analysis

4.Multi-environment deployment

Page 61: Continuous Integration on my work

Recommended