check_api_cn.sh 1.0 KB
Newer Older
T
tianshuo78520a 已提交
1 2
#!/bin/bash

3
git_files=`git diff --numstat upstream/$BRANCH|awk '{print $NF}'`
T
tianshuo78520a 已提交
4 5 6 7 8 9


if [ "$night" == "develop" ];then
   wget -q https://paddle-wheel.bj.bcebos.com/0.0.0-gpu-cuda9-cudnn7-mkl/paddlepaddle_gpu-0.0.0-cp27-cp27mu-linux_x86_64.whl
   pip install -U paddlepaddle_gpu-0.0.0-cp27-cp27mu-linux_x86_64.whl
else
T
tianshuo78520a 已提交
10 11
   cd Paddle/build
   cmake .. -DWITH_GPU=ON  -DWITH_COVERAGE=OFF -DWITH_TESTING=OFF -DCMAKE_BUILD_TYPE=Release
T
tianshuo78520a 已提交
12 13 14 15 16
   make -j`nproc`
   pip install -U python/dist/paddlepaddle_gpu-0.0.0-cp27-cp27mu-linux_x86_64.whl 
fi

for files in `echo $git_files`;do
17 18
  grep "code-block" $files
  if [ $? -eq 0 ] ;then 
T
tianshuo78520a 已提交
19 20 21 22 23 24 25 26 27 28 29 30
    echo $files|grep 'doc/fluid/api_cn/.*/.*.rst'
    if [ $? -eq 0 ];then
        api_file=`echo $files|sed 's#doc/fluid/api_cn/##g'`
        cd /FluidDoc/doc/fluid/api_cn/
        grep -w "$api_file" /FluidDoc/scripts/api_white_list.txt
        if [ $? -ne 0 ];then
            python chinese_samplecode_processor.py $api_file
            if [ $? -ne 0 ];then
                exit 5
            fi
        fi 
    fi
31
  fi
T
tianshuo78520a 已提交
32 33
done