Skip to content

Commit b246d93

Browse files
authored
Merge pull request #600 from Dataman-Cloud/v1.0.6
V1.0.6
2 parents 53e6731 + aa403b0 commit b246d93

11 files changed

Lines changed: 512 additions & 16 deletions

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ Crane, maintained by [dataman-cloud](https://github.com/Dataman-Cloud), is a doc
3939

4040
### Option 1: Stable version in one line
4141

42-
Please read the [release/v1.0.5/README.md](release/v1.0.5/README.md)
42+
Please read the [release/v1.0.6/README.md](release/v1.0.6/README.md)
4343

4444
### Option 2: Latest or development from docker build
4545

bin/build-push-or-up.sh

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
#!/bin/bash
22

3-
set -o errtrace
4-
set -o errexit
3+
set -e
54

65
export REGISTRY_PREFIX=${REGISTRY_PREFIX:-""}
76
export DEFAULT_TAG=`git log --pretty=format:'%h' -n 1`
@@ -21,10 +20,6 @@ if [ ! -f docker/docker ]; then
2120
curl https://get.docker.com/builds/Linux/x86_64/docker-latest.tgz | tar xzv
2221
fi
2322

24-
# setup env_file
25-
echo "Copy default env file to env_file"
26-
cp deploy/env deploy/env_file
27-
sed -i -e "s/CRANE_IP/${CRANE_IP}/" deploy/env_file
2823
# build crane
2924
docker-compose -p crane -f deploy/docker-compose.yml build
3025

@@ -52,5 +47,6 @@ then
5247

5348
docker-compose -p crane -f deploy/docker-compose.yml stop
5449
docker-compose -p crane -f deploy/docker-compose.yml rm -f
55-
docker-compose -p crane -f deploy/docker-compose.yml up -d
50+
51+
CRANE_SWARM_MANAGER_IP=${CRANE_IP} docker-compose -p crane -f deploy/docker-compose.yml up -d
5652
fi

deploy/docker-compose.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,19 +24,22 @@ services:
2424
- CRANE_IP
2525
volumes:
2626
- ./registry_storage:/storage
27+
- /etc/localtime:/etc/localtime
2728
restart: always
2829
crane:
2930
build:
3031
context: ../
3132
dockerfile: ./deploy/Dockerfile
3233
image: ${REGISTRY_PREFIX}crane:${TAG}
3334
env_file:
34-
- ./env_file
35+
- ./env
3536
links:
3637
- crane_registry
3738
- crane_db
3839
ports:
3940
- "5013:5013"
41+
volumes:
42+
- /etc/localtime:/etc/localtime
4043
restart: always
4144
crane_db:
4245
build:
@@ -47,4 +50,5 @@ services:
4750
- MYSQL_ROOT_PASSWORD=111111
4851
volumes:
4952
- ./mysql_storage:/var/lib/mysql
53+
- /etc/localtime:/etc/localtime
5054
restart: always

deploy/env

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
CRANE_ADDR=0.0.0.0:5013
2-
CRANE_SWARM_MANAGER_IP=CRANE_IP
2+
CRANE_SWARM_MANAGER_IP
33
CRANE_DOCKER_TLS_VERIFY=false
44
CRANE_DOCKER_ENTRY_PORT=2375
55
CRANE_DOCKER_API_VERSION=1.24

release/how-to-release.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,6 @@ Suppose we are bumping version v1.0.5
44

55
1. CRANE_IP=192.168.59.105 VERSION=v1.0.5 REGISTRY_PREFIX=catalog.shurenyun.com/library/ ./bin/build-push-or-up.sh push
66
2. cp -r template v1.0.5
7-
3. edit the file v1.0.5/README.md , set the VERSION=v1.0.5
8-
4. edit the script v1.0.5/deploy.sh if needed
7+
3. cp ../deploy/env v1.0.5
8+
4. edit the file v1.0.5/README.md , set the VERSION=v1.0.5
9+
5. edit the script v1.0.5/deploy.sh if needed

release/template/docker-compose.yml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,16 @@ services:
1717
environment:
1818
- CRANE_IP
1919
volumes:
20-
- ./registry_storage:/var/lib/registry
20+
- ./registry_storage:/storage
2121
- /etc/localtime:/etc/localtime
2222
restart: always
2323
crane:
2424
image: ${REGISTRY_PREFIX}crane:${TAG}
25-
environment:
26-
- CRANE_SWARM_MANAGER_IP
27-
- CRANE_DOCKER_ENTRY_PORT
25+
env_file:
26+
- ./env
27+
links:
28+
- crane_registry
29+
- crane_db
2830
volumes:
2931
- /etc/localtime:/etc/localtime
3032
ports:

release/v1.0.6/README.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
Deploy guide
2+
=============
3+
4+
## 国内
5+
6+
1. 请确保docker安装版本 >=1.12, 并确保docker正常运行.(如何安装和配置docker请参考https://docs.docker.com/engine/installation/)
7+
2. 请确保docker-compose已经正确安装.(如何安装docker-compose请参考https://docs.docker.com/compose/install/)
8+
3. 启动环境 `CRANE_IP=X.X.X.X VERSION=v1.0.6 ./deploy.sh`
9+
4. 安装成功后通过浏览器访问 http://$IP 即可,默认用户名:[email protected] 密码:adminadmin
10+
11+
## Others
12+
13+
1. docker>=1.12 [how to install](https://docs.docker.com/engine/installation/)
14+
2. docker-compose>=1.8.0 [how to install](https://docs.docker.com/compose/install/)
15+
3. Enable the Docker tcp Socket on port: 2375 [how to config](https://docs.docker.com/engine/reference/commandline/dockerd/#/daemon-socket-option)
16+
4. Start ntp service
17+
5. You'd better `setenforce 0`
18+
6. `CRANE_IP=X.X.X.X VERSION=v1.0.6 REGISTRY_PREFIX=2breakfast/ ./deploy.sh`
19+
7. Browser http://$CRANE_IP
20+
21+
* username: `[email protected]`
22+
* password: `adminadmin`

release/v1.0.6/deploy.sh

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
#!/bin/bash
2+
3+
set -e
4+
5+
export CRANE_SWARM_MANAGER_IP=$CRANE_IP
6+
export TAG=${VERSION:-1.0}
7+
export REGISTRY_PREFIX=${REGISTRY_PREFIX:-catalog.shurenyun.com/library/}
8+
9+
# node env check
10+
echo "Checking the node status"
11+
./node-init.sh || exit 1
12+
13+
# swarm init
14+
echo "Trying to init swarm cluster"
15+
INIT_ERROR=$(docker swarm init --advertise-addr=$CRANE_IP 2>&1 > /dev/null) || {
16+
docker info 2>/dev/null | grep Swarm | grep -v inactive || {
17+
printf "\033[41mERROR:\033[0m failed to init swarm against cmd: \e[1;34mdocker swarm init --advertise-addr=$CRANE_IP\e[0m\n"
18+
echo "$INIT_ERROR"
19+
exit 1
20+
}
21+
}
22+
echo "Swarm cluster have been running!"
23+
24+
docker-compose -p crane up -d
25+
26+
# feedback the activities
27+
curl -XPOST 123.59.58.58:4500/activities -H "Content-Type: application/json" -d'{"UniqId": "'"$(hostname)"'"}' &>/dev/null || exit 1

release/v1.0.6/docker-compose.yml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
version: "2"
2+
services:
3+
blackmamba:
4+
image: ${REGISTRY_PREFIX}blackmamba:${TAG}
5+
ports:
6+
- "80:80"
7+
volumes:
8+
- /etc/localtime:/etc/localtime
9+
links:
10+
- crane
11+
restart: always
12+
crane_registry:
13+
image: ${REGISTRY_PREFIX}registry:crane${TAG}
14+
ports:
15+
- "5000:5000"
16+
- "5001:5001"
17+
environment:
18+
- CRANE_IP
19+
volumes:
20+
- ./registry_storage:/storage
21+
- /etc/localtime:/etc/localtime
22+
restart: always
23+
crane:
24+
image: ${REGISTRY_PREFIX}crane:${TAG}
25+
env_file:
26+
- ./env
27+
links:
28+
- crane_registry
29+
- crane_db
30+
volumes:
31+
- /etc/localtime:/etc/localtime
32+
ports:
33+
- "5013:5013"
34+
restart: always
35+
crane_db:
36+
image: ${REGISTRY_PREFIX}mysql:crane${TAG}
37+
environment:
38+
- MYSQL_ROOT_PASSWORD=111111
39+
volumes:
40+
- ./mysql_storage:/var/lib/mysql
41+
- /etc/localtime:/etc/localtime
42+
restart: always

release/v1.0.6/env

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
CRANE_ADDR=0.0.0.0:5013
2+
CRANE_SWARM_MANAGER_IP
3+
CRANE_DOCKER_TLS_VERIFY=false
4+
CRANE_DOCKER_ENTRY_PORT=2375
5+
CRANE_DOCKER_API_VERSION=1.24
6+
CRANE_DOCKER_CERT_PATH=null
7+
8+
CRANE_DB_DSN=root:111111@tcp(crane_db:3306)/crane?charset=utf8&parseTime=true&loc=Local
9+
CRANE_DB_DRIVER=mysql
10+
11+
CRANE_FEATURE_FLAGS=registry,account,catalog,search,registryauth
12+
13+
CRANE_REGISTRY_PRIVATE_KEY_PATH=./private_key.pem
14+
CRANE_REGISTRY_ADDR=http://crane_registry:5000
15+
16+
CRANE_ACCOUNT_TOKEN_STORE=default
17+
CRANE_ACCOUNT_AUTHENTICATOR=default
18+
19+
CRANE_ACCOUNT_PASSWORD_DEFAULT=adminadmin
20+
21+
CRANE_SEARCH_LOAD_DATA_INTERVAL=1

0 commit comments

Comments
 (0)