Etesting

How to synchronize estuary codes

repo_sync.sh

使用repo_sync.sh脚本同步estuary相关源码:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#!/bin/bash
VERSION=$1
BIN_DIR=~/bin
if [ ! -e $BIN_DIR ]; then
mkdir -p $BIN_DIR
fi
if [ ! -e ${BIN_DIR}/repo ]; then
wget -c http://www.open-estuary.com/EstuaryDownloads/tools/repo -O ${BIN_DIR}/repo
chmod +x ${BIN_DIR}/repo
fi
export PATH=${BIN_DIR}:$PATH
ESTUARY_DIR=~/open-estuary
if [ ! -e $ESTUARY_DIR ]; then
mkdir -p $ESTUARY_DIR
cd $ESTUARY_DIR
else
cd $ESTUARY_DIR
repo forall -c git reset --hard
repo forall -c git clean -dxf
fi
if [ x"$VERSION" != x"" ]; then
repo init -u "https://github.com/open-estuary/estuary.git" -b refs/tags/$VERSION --no-repo-verify --repo-url=git://android.git.linaro.org/tools/repo
else
repo init -u "https://github.com/open-estuary/estuary.git" -b master --no-repo-verify --repo-url=git://android.git.linaro.org/tools/repo
fi
#false; while [ $? -ne 0 ]; do repo sync --force-sync --fetch-submodules; done
false; while [ $? -ne 0 ]; do repo sync --force-sync; done
repo status

使用说明

  1. 不指定任何参数,默认同步master分支代码

    1
    ./repo_sync.sh
  2. 指定tag标签,则同步相应标签的代码

    1
    ./repo_sync.sh estuary-v2.3

上述脚本执行,将下载repo工具并存放于用户主目录下的bin目录,estuary相关代码同步于用户主目录下的open-estuary目录下。

热评文章