Linux Automation Release Scripts

Source: Internet
Author: User

#GIT_HOME=/developer/git-repository/Dest_path=/product/frontend/#cd dirif[!-N" $" ]; Then Echo-E"Please enter name!"exit fiif[ $1="Mall-fe" ]; Then Echo-E"========enter mall-fe================"CD $GIT _home$1   ElseEcho-E"Not found!"exitfi#clear git dist echo-E"========clear Git dist================"RM-rf./Dist#git Echo-E"=======git Checkout master================"git checkout master echo-E"=======git pull================"git pull echo-E"=======NPM install================"NPM Install--registry=https://registry.npm.taobao.org#npm run mydist Echo-E"=======NPM Run mydist================"NPM Run Mydistif[-D"./dist" ]; Then #backup dest Echo-E"=======dest backup================"MV $GEST _path$1/dist $DEST _path$1/Dist.bak #copy Echo-E"=======copy================"CP-R $DIT _home$1/dist $DEST _path$1#echo result Echo"======= Deploy success================"   ElseEcho"======= Deploy error================"fi

Note that the parameters in [] must have a space

No space will be an error

If [-D "./dist" ];
In the process of NPM run Dist error, it is possible that the JS file encoding is not the norm caused, modify the deletion of some unnecessary code after you can

Linux Automation Release Scripts

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.