preface

Front-end is known to be a non-verbal person who doesn’t use CMD, just kidding!!

Front-end project release process

  • Develop new features -> Cut new branchesgit ck -b newBranch
  • When the development is complete -> Submit the codegit add . git commit -m 'msg'
  • Merge into the medial and lateral branches -> merge intoRelMedial and lateral branchgit marge rel
  • takeVue ReactFor projects, we also need to delete the code we produced before releasing the inner and outer parts, otherwise it will get bigger and biggerRm -rf/Linux Directory path ~ Current project /*
  • Release inner and outer (and a pre-release),The build - FileZilla | ZOC7 - uploadIt doesn’t matter if you drag and drop, or if you command Linux, just be happy

This is the process of releasing a new feature. You can imagine that I can do it once a day, but who can do it every few minutes? Of course the reality is that this operation happens every few minutes!! And it’s possible to change several items at the same time, so it’s a distraction…

Said a story

, one day, I developed a function, according to the above process released the code to the inside and outside, then test the elder sister, I found my written the login landed, notice to me, do you have a super serious bug, need to change now, it is good to preach, I received this instruction, chrysanthemum had a tight, I decided to switch branches, my code to change, Time passed, in a minute I corrected the bug, after all, it is very easy to screw.

The upload code, upload operation took me 10 minutes, in the test sister’s view, I modify this code took 11 minutes, test sister must be thinking about this dish, change a word to take so long? I wait for so vexed, behind give him score toward low dozen, hum ~~, let so-and-so front end colt son get not bonus.

I also very helpless!!

Shell’s bonus harvester

Due to the low score of the test sisters, there is no bonus to take, so THAT I can not pay my rent, return my flowers, invite my favorite little sister to eat a big meal, and finally lead to my favorite little sister and I hate the back-end program ape ran together, I suddenly hate, I decided to revenge him, 😁.

On Friday afternoon, I sent a message to the backend through the enterprise wechat, informing him of the duel in the afternoon.

War is on the verge of breaking out

The back-end skills The results of skills The front end
He came up and threw a knockout 😏 Java solution A draw Javascript(Dragon) in the sky He incredibly a come up to throw a kill 😤

It seems that he does not want to waste time with me 😉

But I’m not easy to mess with

And I did my best
The man still has a voice

Then don’t push me. Here’s the deal
Is beginning to Spring up

SpringBoot shines
All wounded Left Angular has regrets

Right lift Vue for water

React tail
He made two moves in one second. I couldn’t stop him

He was knocked to the ground before he could think

So fast

He jumped up and wrote mvC in the sky… .

Before he could finish his move

I knew it would kill me. I didn’t have time to think

I have to do this…
It’s too much. Come on Micro service

The container

The message queue

Distributed cache

Multithreaded concurrency

network

The middleware

They were all weakened Webpack

Compatible with

Koa

Performance optimization

Less/Sass

ES6789

TS

Network protocol

visualization

Go ahead, Pikachu
Without speaking, he took out a book of secrets Five Words feng Shui Yin Yang Secret Art (Shell) A draw An empty hand pick up a Shell Silent, I know I can no longer fight

But when he came up with this secret, I found it worked for me

I used all my strength to do what my cousin taught me to do
The front end is not going to use the command line page son, just a word Nothing wins at this time The front end was finally dried up by the command line A humbled Oh, my god, I know how to NPM run serve

In fact, there are a lot of things in the back end, the front end can be used to reduce their usual development of repetitive work, Shell is one of them.

Shell knowledge, a lot of tutorials, go to learn, I put my script out and exchange with you.

My automated scripts

#! /bin/bashset -e if [ "$1"x != "devx" ] && [ "$1"x != "testx" ] && [ "$1"x != "prex" ]; Then echo -e "\033[41;37m \ dev(internal test) test(external) \033[0m" exit fi function devFn() {SSH root@ip rm -rf server project path /* echo -e "\033[32m \033[0m" rsync-e "SSH -p port" --exclude= storage-a local code path /dist/* root@ip: server project path/echo -e "\033[32m Internal test upload successful \033[0m\n"} function testFn() {SSH -p port root@ip rm -rf server project path /* echo -e "\033[32m connected successfully, \033[0m" rsync-e "SSH -p port" --exclude= storage-a Local code path /dist/* root@ip: server project path/echo -e "\033[32m External upload successful \033[0m\n"} function preFn() {CD source NPM run build:$1 echo -e "\033[32m \033[0m" echo -e "\033[32M connect to $1 server \033[0m" if ["$1"x == "devx"];then devFn elif ["$1"x == "testx"];then testFn Elif ["$1"x == "prex"];then preFn else echo -e "\033[41;37m \033[0m" exit fi}

#Get the current branch
branch=$(git symbolic-ref --short HEAD)

#Check if it's an REL branchif [ ${branch} == "rel" ]; $1 environment \033[0m" read-p $'\n\033[31m or n: \033[0m' isbuild if ["$isbuild"!= 'y'];then exit fi build $1 else # echo -e "\n\033[31m dev Test (outer) pre(pre) \033[0m" echo -e "\033[31m Need to publish $1 environment \033[0m" # ask whether to continue to publish $1 environment \033[0m" # read -p $'\n\033[31m Do you want to continue? \033[0m' isVersion if ["$isVersion"!= 'y'];then exit fi echo -e "\n\033[32m \033[0m\n" echo -e "\033[31m $1 \ ${branch} \033[0m" # read -p $'\n\033[31m $'\n\033[31m \033[0m' isContinue if ["$isContinue"!= 'y'];then exit fi echo -e "\n\033[32m ${branch} \033[0m\n" echo -e "\033[32m Add commit \033[0m\n" git add. read -p $'\n\033[31m \033[0m' commitInfo git commit -m ${commitInfo} echo -e "\033[32m "git checkout rel echo -e "\033[32m Git merge ${branch} rel \033[0m\n" git merge ${branch} If [$? == 0];then echo -e "\033[32m merge ${branch} -> rel \033[0m\n" echo -e "\n\033[32m start to push rel to remote end Origin \033[0m\n" git push origin rel echo -e "\n\033[32m push rel to remote origin success \033[0m\n" echo -e "\n\033[32m execute package \033[0m\n" build $1 else echo -e "\033[31m merge failed, check \033[0m" exit fi fiCopy the code

So the test sister will not say you are slow, this is too fast!! Yeah, it’s too fast, and the test sister won’t be happy, it’s too hard…