Skip to content

Commit

Permalink
Merge pull request #600 from Dataman-Cloud/v1.0.6
Browse files Browse the repository at this point in the history
V1.0.6
  • Loading branch information
vitan authored Oct 31, 2016
2 parents 53e6731 + aa403b0 commit b246d93
Show file tree
Hide file tree
Showing 11 changed files with 512 additions and 16 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ Crane, maintained by [dataman-cloud](https://github.com/Dataman-Cloud), is a doc

### Option 1: Stable version in one line

Please read the [release/v1.0.5/README.md](release/v1.0.5/README.md)
Please read the [release/v1.0.6/README.md](release/v1.0.6/README.md)

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

Expand Down
10 changes: 3 additions & 7 deletions bin/build-push-or-up.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#!/bin/bash

set -o errtrace
set -o errexit
set -e

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

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

Expand Down Expand Up @@ -52,5 +47,6 @@ then

docker-compose -p crane -f deploy/docker-compose.yml stop
docker-compose -p crane -f deploy/docker-compose.yml rm -f
docker-compose -p crane -f deploy/docker-compose.yml up -d

CRANE_SWARM_MANAGER_IP=${CRANE_IP} docker-compose -p crane -f deploy/docker-compose.yml up -d
fi
6 changes: 5 additions & 1 deletion deploy/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,19 +24,22 @@ services:
- CRANE_IP
volumes:
- ./registry_storage:/storage
- /etc/localtime:/etc/localtime
restart: always
crane:
build:
context: ../
dockerfile: ./deploy/Dockerfile
image: ${REGISTRY_PREFIX}crane:${TAG}
env_file:
- ./env_file
- ./env
links:
- crane_registry
- crane_db
ports:
- "5013:5013"
volumes:
- /etc/localtime:/etc/localtime
restart: always
crane_db:
build:
Expand All @@ -47,4 +50,5 @@ services:
- MYSQL_ROOT_PASSWORD=111111
volumes:
- ./mysql_storage:/var/lib/mysql
- /etc/localtime:/etc/localtime
restart: always
2 changes: 1 addition & 1 deletion deploy/env
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
CRANE_ADDR=0.0.0.0:5013
CRANE_SWARM_MANAGER_IP=CRANE_IP
CRANE_SWARM_MANAGER_IP
CRANE_DOCKER_TLS_VERIFY=false
CRANE_DOCKER_ENTRY_PORT=2375
CRANE_DOCKER_API_VERSION=1.24
Expand Down
5 changes: 3 additions & 2 deletions release/how-to-release.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,6 @@ Suppose we are bumping version v1.0.5

1. CRANE_IP=192.168.59.105 VERSION=v1.0.5 REGISTRY_PREFIX=catalog.shurenyun.com/library/ ./bin/build-push-or-up.sh push
2. cp -r template v1.0.5
3. edit the file v1.0.5/README.md , set the VERSION=v1.0.5
4. edit the script v1.0.5/deploy.sh if needed
3. cp ../deploy/env v1.0.5
4. edit the file v1.0.5/README.md , set the VERSION=v1.0.5
5. edit the script v1.0.5/deploy.sh if needed
10 changes: 6 additions & 4 deletions release/template/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,16 @@ services:
environment:
- CRANE_IP
volumes:
- ./registry_storage:/var/lib/registry
- ./registry_storage:/storage
- /etc/localtime:/etc/localtime
restart: always
crane:
image: ${REGISTRY_PREFIX}crane:${TAG}
environment:
- CRANE_SWARM_MANAGER_IP
- CRANE_DOCKER_ENTRY_PORT
env_file:
- ./env
links:
- crane_registry
- crane_db
volumes:
- /etc/localtime:/etc/localtime
ports:
Expand Down
22 changes: 22 additions & 0 deletions release/v1.0.6/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
Deploy guide
=============

## 国内

1. 请确保docker安装版本 >=1.12, 并确保docker正常运行.(如何安装和配置docker请参考https://docs.docker.com/engine/installation/)
2. 请确保docker-compose已经正确安装.(如何安装docker-compose请参考https://docs.docker.com/compose/install/)
3. 启动环境 `CRANE_IP=X.X.X.X VERSION=v1.0.6 ./deploy.sh`
4. 安装成功后通过浏览器访问 http://$IP 即可,默认用户名:[email protected] 密码:adminadmin

## Others

1. docker>=1.12 [how to install](https://docs.docker.com/engine/installation/)
2. docker-compose>=1.8.0 [how to install](https://docs.docker.com/compose/install/)
3. Enable the Docker tcp Socket on port: 2375 [how to config](https://docs.docker.com/engine/reference/commandline/dockerd/#/daemon-socket-option)
4. Start ntp service
5. You'd better `setenforce 0`
6. `CRANE_IP=X.X.X.X VERSION=v1.0.6 REGISTRY_PREFIX=2breakfast/ ./deploy.sh`
7. Browser http://$CRANE_IP

* username: `[email protected]`
* password: `adminadmin`
27 changes: 27 additions & 0 deletions release/v1.0.6/deploy.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#!/bin/bash

set -e

export CRANE_SWARM_MANAGER_IP=$CRANE_IP
export TAG=${VERSION:-1.0}
export REGISTRY_PREFIX=${REGISTRY_PREFIX:-catalog.shurenyun.com/library/}

# node env check
echo "Checking the node status"
./node-init.sh || exit 1

# swarm init
echo "Trying to init swarm cluster"
INIT_ERROR=$(docker swarm init --advertise-addr=$CRANE_IP 2>&1 > /dev/null) || {
docker info 2>/dev/null | grep Swarm | grep -v inactive || {
printf "\033[41mERROR:\033[0m failed to init swarm against cmd: \e[1;34mdocker swarm init --advertise-addr=$CRANE_IP\e[0m\n"
echo "$INIT_ERROR"
exit 1
}
}
echo "Swarm cluster have been running!"

docker-compose -p crane up -d

# feedback the activities
curl -XPOST 123.59.58.58:4500/activities -H "Content-Type: application/json" -d'{"UniqId": "'"$(hostname)"'"}' &>/dev/null || exit 1
42 changes: 42 additions & 0 deletions release/v1.0.6/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
version: "2"
services:
blackmamba:
image: ${REGISTRY_PREFIX}blackmamba:${TAG}
ports:
- "80:80"
volumes:
- /etc/localtime:/etc/localtime
links:
- crane
restart: always
crane_registry:
image: ${REGISTRY_PREFIX}registry:crane${TAG}
ports:
- "5000:5000"
- "5001:5001"
environment:
- CRANE_IP
volumes:
- ./registry_storage:/storage
- /etc/localtime:/etc/localtime
restart: always
crane:
image: ${REGISTRY_PREFIX}crane:${TAG}
env_file:
- ./env
links:
- crane_registry
- crane_db
volumes:
- /etc/localtime:/etc/localtime
ports:
- "5013:5013"
restart: always
crane_db:
image: ${REGISTRY_PREFIX}mysql:crane${TAG}
environment:
- MYSQL_ROOT_PASSWORD=111111
volumes:
- ./mysql_storage:/var/lib/mysql
- /etc/localtime:/etc/localtime
restart: always
21 changes: 21 additions & 0 deletions release/v1.0.6/env
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
CRANE_ADDR=0.0.0.0:5013
CRANE_SWARM_MANAGER_IP
CRANE_DOCKER_TLS_VERIFY=false
CRANE_DOCKER_ENTRY_PORT=2375
CRANE_DOCKER_API_VERSION=1.24
CRANE_DOCKER_CERT_PATH=null

CRANE_DB_DSN=root:111111@tcp(crane_db:3306)/crane?charset=utf8&parseTime=true&loc=Local
CRANE_DB_DRIVER=mysql

CRANE_FEATURE_FLAGS=registry,account,catalog,search,registryauth

CRANE_REGISTRY_PRIVATE_KEY_PATH=./private_key.pem
CRANE_REGISTRY_ADDR=http://crane_registry:5000

CRANE_ACCOUNT_TOKEN_STORE=default
CRANE_ACCOUNT_AUTHENTICATOR=default
[email protected]
CRANE_ACCOUNT_PASSWORD_DEFAULT=adminadmin

CRANE_SEARCH_LOAD_DATA_INTERVAL=1
Loading

0 comments on commit b246d93

Please sign in to comment.