docker.sh 525 Bytes
#!/bin/bash
wordir=$2
cd $wordir
rm -rf yohobuy-node.tar.gz

if [[ $1 == "yoho-gray" ]]
then
    yarn --production=false
else
    yarn
fi

if [[ $1 == "yoho-gray" ]]
then
    rm -rf public/dist
    yarn build

    if [[ $? == 1 ]]
    then
        echo "build failed"
        exit 1
    fi

    yarn upload -f
    if [[ $? == 1 ]]
    then
        echo "file upload failed"
        exit 1
    fi
fi

if [[ $1 == "TEST1" ]] || [[ $1 == "TEST2" ]] || [[ $1 == "TEST3" ]]
then
    yarn build
fi

tar -czvf yohobuy-node.tar.gz *