On the way

It's a new beginning.


  • Home

  • Categories

  • Archives

  • Tags

  • Sitemap

  • About

  • Search

Git Maven Tomcat deploy.sh

Posted on 2017-09-30 | In Shell |

Recently took over a computer, too lazy to install Jenkins, then wrote a simple deployment scripts, welcome to discuss about it.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#!/bin/bash
BRANCH="dev"
TODAY=$(date +"%Y-%m-%d")
PRO_NAME="mkt-admin"
GIT_HOME="/home/app/git_repo/mkt-admin"
TOMCAT_NAME="tomcat-pay-8080"
TOMCAT_HOME=/usr/local/${TOMCAT_NAME}
cd ${GIT_HOME}
git fetch
git checkout ${BRANCH}
echo "Start pull code..."
git pull
mvn clean install -Dmaven.test.skip=true -e -U
cd $TOMCAT_HOME
echo "Shutdown Tomcat..."
./bin/shutdown.sh
sleep 20
echo "Testing Tomcat status..."
TOMCAT_PID=$( ps aux | grep ${_TOMCAT_NAME} | grep -v grep | awk '{print $2}' )
echo "Get Tomcat PID: " $TOMCAT_PID
if [[ ${TOMCAT_PID} ]] # if PID exists
then
echo "PID exists, cannot shutdown Tomcat successfully."
#echo "Killing..."
#kill -9 ${_TOMCAT_PID}
#sleep 5
# Considering strongly killing processes leading to accidental error, so conservative to opt out and manual processing it.
echo "Exiting..."
exit 1
else
echo "PID is not exists, ready for start."
fi
rm -rf webapps/${PRO_NAME}*
rm -rf work/*
cp ${GIT_HOME}/target/mkt-admin.war webapps/
sleep 1
echo "Start Tomcat..."
./bin/startup.sh
tailf logs/localhost.${TODAY}.log

Logback Manual(Section 1)

Posted on 2017-01-22 | In Java |

Markdown Expansion

Posted on 2017-01-16 | In Markdown |

This article mainly tells the rest of common markdown syntax.

Markdown Expansion

Code

To coding in Markdown, you preface the phrase with a TAB or four blanks, you also surround code block with ``` ```, like

```
hello world
```

And to write inline code, you can surround words with backticks(``), like `TAB`.

Separator Line

To add a separator line, you use three or more characters such as * or - or _ in a line.

Read more »

Markdown Note

Posted on 2017-01-15 | In Markdown |

Markdown is a better way to write content for the web. So spending several minutes learning it is beneficial for us.

Markdown Syntax

Italics and Bold

To make a phrase italic in Markdown, you can surround words with an underscore ( _ ).

1
_Writing in Markdown_ is not that hard!

Writing in Markdown is not that hard!

Similarly, to make phrases bold in Markdown, you can surround words with two asterisks ( ** ).

1
**Writing in Markdown** is not that hard!

Read more »

Git Command(Section 3)

Posted on 2017-01-08 | In Git |

This section is used to record some problems and solutions. Welcome to ask questions and discuss them.

Q & A

Q1

If I want to abandon changes on a branch like dev and fetch the remote banch of the same name?

1
$ git checkout -B dev

If -B is given, is created if it doesn’t exist; otherwise, it is reset. This is the transactional equivalent of

1
2
$ git branch -f <branch> [<start point>]
$ git checkout <branch>

Read more »

Git Command(Section 2)

Posted on 2017-01-07 | In Git |

Now we could learn more about git.

Advanced reference

Clone a repository into a new directory

1
$ git clone git@github.com:xuxin0612/pythonLearning.git my-pythonLearning

Switch branches

1
$ git checkout -b dev

List branches

1
$ git branch -a
Read more »

Git Command(Section 1)

Posted on 2017-01-06 | In Git |

At first, let’s look at a common example for using git.

Example

1
2
3
4
5
6
$ echo "# pythonLearning" >> README.md
$ git init
$ git add README.md
$ git commit -m "first commit"
$ git remote add origin git@github.com:xuxin0612/pythonLearning.git
$ git push -u origin master

Reference

Create an empty Git repository or reinitialize an existing one

1
$ git init
Read more »

Hello World

Posted on 2017-01-01 | In Nodejs |

Welcome to Hexo! This is your very first post. Check documentation for more info. If you get any problems when using Hexo, you can find the answer in troubleshooting or you can ask me on GitHub.

Quick Start

Create a new post

1
$ hexo new "My New Post"

More info: Writing

Run server

1
$ hexo server

More info: Server

Read more »
Scott Hsu

Scott Hsu

Never do, never know.

8 posts
5 categories
7 tags
RSS
Github Weibo Linkedin
Scott Hsu wechat
my public wechat account
© 2017 Scott Hsu
Powered by Hexo
Theme - NexT.Muse