Line code, rollback code

Source: Internet
Author: User

Online script #!/bin/bashfwdir= "$ (cd  ' dirname " ${bash_source-$0} "';  pwd)" Bin= ' dirname  "$" ' bin= ' CD   "$bin";  pwd ' now= ' date  "+%y%m%d_%h%m%s" ' tag_release=di.release.${now}[email protected]: bdp-server/bdp-di.gitecho -e  "\033[32m=====>  build release tag\033[0m" git  clone  $repo _url  $tag _releasecd  $tag _release# on-line branch, if not transmitted to the online master[[ $# -eq 1  ]] && git checkout di_$1git tag -a ${tag_release} -m   "${tag_release} tagged from branch master" Git push origin ${tag_ release}#  Extract version information commiter=$ (git for-each-ref --format= "% (committername)"  refs/heads) release _note=$ (git for-each-ref --format= "% (committername) @% (refname:short)  [% (Committerdate:short)]  % (contents) " refs/heads) rm -rf .gitecho -e " \033[32m=====>  stop  the old service... \033[0m "cd  $bin/service/binbash di.sh stopecho -e " \033[32m=====>   start new service...\033[0m "cd  $binrm  -rf serviceln -s ${tag_release}  servicecd  $bin/service/binbash di.sh start#  Send online log mail echo -e  "${tag_release}   version on-line description (online environment) \n==================================\n version Summary: ${release_note} \n on-line description:\n\n1.  "  >  $FWDIR/note.tmpvi  $FWDIR/note.tmp +mail -s  "bdp-di online log" ${tag_release} [ email protected] <  $FWDIR/note.tmprm  $FWDIR/note.tmp

Rollback script #!/bin/bashbin= ' dirname ' $ "' bin= ' CD" $bin ";   PWD ' [[[$#-eq 0]] && echo "usage:$0 {version}" && exit 0version= "di.release.$1" Echo-e "\033[32m=====> Stop the Old service...\033[0m "CD $bin/service/binbash di.sh stopecho-e" \033[32m=====> start new service...\033[0m "CD $BINRM-rf serviceln-s ${version} servicecd $bin/service/binbash di.sh startecho-e" \033[32m=====> success to Ro Llback to $version \033[0m "#send mailecho-e ' Bdp-di version rollback (online environment) \ n ' ==================================\n ' was rolled back to version: ' ${ Version} | Mail-s "Bdp-di rollback log" [email protected]


Line code, rollback code

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.