Skip to content

Commit 8522956

Browse files
committed
add usage
1 parent 73d8af7 commit 8522956

1 file changed

Lines changed: 90 additions & 2 deletions

File tree

README.md

Lines changed: 90 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,18 @@
1-
# Usage
1+
# Introduction
2+
3+
This is a devops for docker image and its deployment (using docker compose) for armv6 and x86. It contains:
4+
- Dockerfile template for image.
5+
- Docker compose file template for deployment.
6+
- gitbook template for github page.
7+
- travis file template for CI.
8+
9+
You can use this project to quick start your docker image project with the following outcome,
10+
11+
* It sets up local build process
12+
* It sets up travis build process
13+
14+
15+
# Usage
216

317
### Go to your project
418
```
@@ -16,8 +30,82 @@ unzip proj-0.2.2.zip
1630
```
1731
You will see the `proj` folder.
1832

19-
### Replacement
33+
### Set project
2034
```
2135
mv proj/* proj/.[!.]* ./
2236
rm -rf proj*
2337
```
38+
39+
### Set the `OWNER` and `REPO` with your github user and project
40+
```bash
41+
./set_owner_repo [OWNER] [REPO]
42+
```
43+
44+
### Specify develop local build usage
45+
46+
Till now, you can validate by
47+
48+
* Local build process
49+
- Create docker image by `make mk-image ARCH=x86` or `make mk-image ARCH=armv6`. Test result with `docker images`.
50+
51+
- Create gitbook by `make mk-book`, a docs folder will be generated
52+
- Create deployment by `make mk-deployment VERSION=0.1.0`, 2 zip packages will be generated according to your repository name and version.
53+
54+
* Local clean process
55+
- Delete docker image by `make clean-image ARCH=x86` or `make clean-image ARCH=armv6`
56+
- Delete gitbook result by `make clean-book`
57+
- Delete deployment result by `make clean-deployment VERSION=0.1.0`
58+
59+
### Write the image dockerfile and the image deployment
60+
- Modify `images/Dockerfile-armv6(x86)` which defines how to build images
61+
- Go to `deployment/imageAPI-armv6 (x86)`
62+
* Update `docker-compose.yml` which defines how to run images
63+
* Update `temp.env` which defines environment variable used by `docker-compose.yml`
64+
65+
### Valid dockerfile and image deployment as before
66+
67+
### Travis build
68+
69+
- specify the docker hub account info
70+
* `travis login`
71+
* `travis enable`
72+
* Change `.env` by setting `DOCKER_USER` and `DOCKER_PASS`
73+
* `./set_docker_account`
74+
75+
- Set github release api key
76+
77+
Go to [github and get a token](https://github.com/settings/tokens).
78+
```bash
79+
./set_release_api_key [token]
80+
```
81+
- Modify the indentation like below:
82+
```yaml
83+
deploy:
84+
- provider: script
85+
script: make pushtohub USER=$DOCKER_USER PASS=$DOCKER_PASS ARCH=$ARCH TAG=$TRAVIS_BRANCH
86+
on:
87+
all_branches: true
88+
condition: "$TRAVIS_BRANCH =~ ^master|develop$"
89+
- provider: script
90+
script: make pushtohub USER=$DOCKER_USER PASS=$DOCKER_PASS ARCH=$ARCH TAG=$TRAVIS_TAG
91+
on:
92+
tags: true
93+
all_branches: true
94+
- provider: releases
95+
prerelease: true
96+
skip_cleanup: true
97+
file_glob: true
98+
file: "./*.zip"
99+
api_key:
100+
secure: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
101+
on:
102+
tags: true
103+
```
104+
- Test whether .travis.yml is ok
105+
```bash
106+
travis lint .travis.yml
107+
```
108+
109+
- Now you can push a branch or tag to check whether travis does its job as expected
110+
111+

0 commit comments

Comments
 (0)