用 Docker 用用用用用用用用 Bo-Yi Wu 2016.07.05 1
Docker
Docker Bo-Yi Wu2016.07.05
1
Node.jsPHPGolangDevOps2https://blog.wu-boy.com/
DevOpsCode Review
Github golang
2
DevOps3
3
Embedded SystemBSP(Board Support Package)4
Wifi Router Router Application porting4
5
porting -> build firmware 5
Docker 6
Build Server7
gcc version
8
IC SDK SDK 8
5.x4.x3.x
9
gcc
gcc 9
Ubuntu version
10
OS
build firmware IC OS
Spec 10
12.0414.0415.04
11
server 11
12
14.0415.04
13
() ( Shell Script)24 on call ()14
()
15
Build Server16
14.0415.04
17
.vdi
18
vdi 19
Docker
20
Docker Mac Windows
21
DockerfileDockerfile
22
Dockerfile () ( VirtualBox)23
23
linkit smart 7688 24
25
linkit-smart-7688-golanghttps://github.com/appleboy/linkit-smart-7688-golangdocker build t 7688:v1 .
26
26
27
dockerfile
dockerfile auto build images.
docker hub image
docker pull
27
frontend vs. backendSingle Page Application
28
http://blog.opus.com.pk/2015/09/04/importance-of-backend-developer/29
VS.
30
31
Develop Server(API)
Backend DeveloperBackend DeveloperBackend Developer
Frontend Developer
Frontend Developer
QA Engineer
DeployDeployDeploy
TestingAPIAPI32
QA, PM, server demo32
Develop Server
33
34
Develop Branch
Staging Branch
Production Branch35
QA feature
36
Docker
37
Docker
docker-compose.yml38
docker-compose.yml
39RD
QA
PM
QA, PM, Sales, RD40
Git$ git pull origin master$ git checkout b xx origin/feature-xx41
Docker Service$ docker-compose -p $(PROJECT) up d Service$ docker-compose -p $(PROJECT) stop Service$ docker-compose -p $(PROJECT) down42
Develop DemoQA 43
code develop Staging Production. (Mac, Windows ) Python golang node.jsPM Sale Docker demo demo QA branch bug deploy server 43
localhost 127.0.0.1QARDPM44
Develop
Staging Branch
Production Branch
(Staging, Production)45
docker-compose up -d46
Demo 47
QA
Feature Bugs
SuccessFail git checkout origin/xxxx 48
Docker
49
Docker + JenkinsNode.js
50
API ServerOAuth Server
npm install && npm testNode.js Testing51
Postgres is not startedDocker Container
52
https://blog.wu-boy.com/2016/06/server-monitoring-mysql-postgres-daemon-in-docker/53
54
Node.js Testing 55
npm install 2 min -> 30 sec56
tar xf ../module_cache.tar npm prunenpm installtar cf ../module_cache.tar node_modules57
58
59
Build Time Code Testing 59
60
Docker 60
build testing time
61
Git flow vs Github flow62
Git flow vs Github flow
63
64
Git flow ()
Stagingproduction
65
Github flow (Master + Tag)
MasterTag: v1.0, v2.0
66
Git tips and flowhttp://www.slideshare.net/appleboy/git-flow-61442567
67
Git flow vs Github flow
68
CI Server?69
69
Docker http://www.slideshare.net/appleboy/docker-61214768
70
Any Question?
71