docker.sh 565 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 yo-cli upload -f
    if [[ $? == 1 ]]
    then
        echo "file upload failed"
        exit 1
    fi
    rm -rf public/dist
fi

if [[ $1 == "test1" ]] || [[ $1 == "test2" ]] || [[ $1 == "test3" ]]
then
    yarn build
fi
node-prune

tar -czf yohobuy-node.tar.gz *