Skip to content

Commit 25d21da

Browse files
committed
2016-03-17进入初稿整理阶段
1 parent 0f86a72 commit 25d21da

13 files changed

+563
-143
lines changed

CentOS-Other-Bash.md renamed to Bash-Other-Bash.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<h1id="bash0">CentOS 其他常用命令</h1>
1+
<h1id="bash0">Bash 其他常用命令</h1>
22

33
------
44

Bash.md

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -105,10 +105,14 @@
105105
- `rm -r -i 文件夹`,在删除文件夹里的文件会提示(要的话,在提示后面输入yes)
106106
- `rm -r -f 文件夹`,强制删除
107107
- `rm -r -f 文件夹1/ 文件夹2/ 文件夹3/`删除多个
108-
- `find`高级查找
109-
- `find. -name *lin*`,其中.代表在当前目录找,-name表示匹配文件名/文件夹名,*lin*用通配符搜索含有lin的文件或是文件夹
110-
- `find/ -name *.conf`,其中/代表根目录查找,*.conf代表搜索后缀会.conf的文件
111-
- `find. -name "lin*" -execls -l{}\;`,当前目录搜索lin开头的文件,然后用其搜索后的结果集,再执行ls -l的命令(这个命令可变,其他命令也可以),其中-exec和{}\;都是固定格式
108+
- `find` 高级查找
109+
- `find . -name *lin*`,其中 . 代表在当前目录找,-name 表示匹配文件名 / 文件夹名,\*lin\* 用通配符搜索含有lin的文件或是文件夹
110+
- `find . -iname *lin*`,其中 . 代表在当前目录找,-iname 表示匹配文件名 / 文件夹名(忽略大小写差异),\*lin\* 用通配符搜索含有lin的文件或是文件夹
111+
- `find / -name *.conf`,其中 / 代表根目录查找,*.conf代表搜索后缀会.conf的文件
112+
- `find /opt -name .oh-my-zsh`,其中 /opt 代表目录名,.oh-my-zsh 代表搜索的是隐藏文件 / 文件夹名字为 oh-my-zsh 的
113+
- `find /opt -type f -iname .oh-my-zsh`,其中 /opt 代表目录名,-type f 代表只找文件,.oh-my-zsh 代表搜索的是隐藏文件名字为 oh-my-zsh 的
114+
- `find /opt -type d -iname .oh-my-zsh`,其中 /opt 代表目录名,-type d 代表只找目录,.oh-my-zsh 代表搜索的是隐藏文件夹名字为 oh-my-zsh 的
115+
- `find . -name "lin*" -execls -l{}\;`,当前目录搜索lin开头的文件,然后用其搜索后的结果集,再执行ls -l的命令(这个命令可变,其他命令也可以),其中 -exec 和 {}\; 都是固定格式
112116

113117
<h2 id="information">资料</h2>
114118

CI-Settings.md

Lines changed: 0 additions & 78 deletions
Original file line numberDiff line numberDiff line change
@@ -9,84 +9,6 @@
99

1010
------
1111

12-
<h2 id="nexus1">Nexus 安装</h2>
13-
14-
- maven 的 全局配置:
15-
```
16-
<?xml version="1.0" encoding="UTF-8"?>
17-
18-
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd">
19-
20-
<!--本地仓库路径-->
21-
<localRepository>D:/maven/my_local_repository</localRepository>
22-
23-
<pluginGroups>
24-
</pluginGroups>
25-
26-
<proxies>
27-
</proxies>
28-
29-
30-
<servers>
31-
<!--配置 nexus 仓库用户名密码 -->
32-
<server>
33-
<id>releases</id>
34-
<username>admin</username>
35-
<password>admin123</password>
36-
</server>
37-
38-
<!--配置 nexus 仓库用户名密码 -->
39-
<server>
40-
<id>snapshots</id>
41-
<username>admin</username>
42-
<password>admin123</password>
43-
</server>
44-
45-
<!-- 配置 tomcat 的用户名和密码 -->
46-
<server>
47-
<id>tomcatRole</id>
48-
<username>admin</username>
49-
<password>admin</password>
50-
</server>
51-
</servers>
52-
53-
54-
<mirrors>
55-
<mirror>
56-
<id>privateNexusMirror</id>
57-
<name>YouMeek Nexus</name>
58-
<mirrorOf>*</mirrorOf>
59-
<url>http://192.168.0.110:8081/nexus/content/groups/public/</url>
60-
</mirror>
61-
</mirrors>
62-
63-
64-
<profiles>
65-
<profile>
66-
<id>privateNexusProfile</id>
67-
<repositories>
68-
<repository>
69-
<id>privateRepo</id>
70-
<url>http://192.168.0.110:8081/nexus/content/groups/public/</url>
71-
<releases>
72-
<enabled>true</enabled>
73-
</releases>
74-
<snapshots>
75-
<enabled>true</enabled>
76-
</snapshots>
77-
</repository>
78-
</repositories>
79-
</profile>
80-
</profiles>
81-
82-
83-
<activeProfiles>
84-
<activeProfile>privateNexusProfile</activeProfile>
85-
</activeProfiles>
86-
87-
</settings>
88-
```
89-
9012

9113
<h2 id="nexus3">资料</h2>
9214

Maven-Install-And-Settings.md

Lines changed: 116 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,8 @@
1-
<h1 id="maven0">Maven 安装和配置</h1>
1+
# Maven 安装和配置
22

3-
------
43

5-
* [Maven 安装和配置](#maven0)
6-
* [Maven 安装](#maven1)
7-
* [Maven 配置](#maven2)
8-
* [资料](#maven3)
9-
10-
------
114

12-
<h2 id="maven1">Maven 安装</h2>
5+
## Maven 安装
136

147
- Maven 安装
158
- 官网:<http://maven.apache.org/>
@@ -25,6 +18,7 @@
2518
- 移到我个人习惯的安装目录下:`mv maven3.3.9/ /usr/program`
2619
- 环境变量设置:`vim /etc/profile`
2720
- 在文件最尾巴添加下面内容:
21+
2822
```
2923
# Maven
3024
MAVEN_HOME=/usr/program/maven3.3.9
@@ -34,17 +28,128 @@
3428
export PATH
3529
export MAVEN_OPTS
3630
```
31+
3732
- 刷新配置文件:`source /etc/profile`
3833
- 测试是否安装成功:`mvn -version`
3934
4035
41-
<h2 id="maven2">Maven 配置</h2>
36+
## Maven 配置
37+
38+
- 配置项目连接上私服
39+
- 全局方式配置:
40+
41+
``` bash
42+
<?xml version="1.0" encoding="UTF-8"?>
43+
44+
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd">
45+
46+
<!--本地仓库位置-->
47+
<localRepository>D:/maven/my_local_repository</localRepository>
48+
49+
<pluginGroups>
50+
</pluginGroups>
51+
52+
<proxies>
53+
</proxies>
54+
55+
<!--设置 Nexus 认证信息-->
56+
<servers>
57+
<server>
58+
<id>nexus-releases</id>
59+
<username>admin</username>
60+
<password>admin123</password>
61+
</server>
62+
<server>
63+
<id>nexus-snapshots</id>
64+
<username>admin</username>
65+
<password>admin123</password>
66+
</server>
67+
</servers>
68+
69+
<!--设置 Nexus 镜像,后面只要本地没对应的以来,则到 Nexus 去找-->
70+
<mirrors>
71+
<mirror>
72+
<id>nexus-releases</id>
73+
<mirrorOf>*</mirrorOf>
74+
<url>http://localhost:8081/nexus/content/groups/public</url>
75+
</mirror>
76+
<mirror>
77+
<id>nexus-snapshots</id>
78+
<mirrorOf>*</mirrorOf>
79+
<url>http://localhost:8081/nexus/content/groups/public-snapshots</url>
80+
</mirror>
81+
</mirrors>
82+
83+
84+
<profiles>
85+
<profile>
86+
<id>nexus</id>
87+
<repositories>
88+
<repository>
89+
<id>nexus-releases</id>
90+
<url>http://nexus-releases</url>
91+
<releases>
92+
<enabled>true</enabled>
93+
</releases>
94+
<snapshots>
95+
<enabled>true</enabled>
96+
</snapshots>
97+
</repository>
98+
<repository>
99+
<id>nexus-snapshots</id>
100+
<url>http://nexus-snapshots</url>
101+
<releases>
102+
<enabled>true</enabled>
103+
</releases>
104+
<snapshots>
105+
<enabled>true</enabled>
106+
</snapshots>
107+
</repository>
108+
</repositories>
109+
<pluginRepositories>
110+
<pluginRepository>
111+
<id>nexus-releases</id>
112+
<url>http://nexus-releases</url>
113+
<releases>
114+
<enabled>true</enabled>
115+
</releases>
116+
<snapshots>
117+
<enabled>true</enabled>
118+
</snapshots>
119+
</pluginRepository>
120+
<pluginRepository>
121+
<id>nexus-snapshots</id>
122+
<url>http://nexus-snapshots</url>
123+
<releases>
124+
<enabled>true</enabled>
125+
</releases>
126+
<snapshots>
127+
<enabled>true</enabled>
128+
</snapshots>
129+
</pluginRepository>
130+
</pluginRepositories>
131+
</profile>
132+
</profiles>
133+
134+
<activeProfiles>
135+
<activeProfile>nexus</activeProfile>
136+
</activeProfiles>
137+
138+
</settings>
139+
```
140+
141+
- 项目级别:
142+
143+
42144

43145

44-
<h2 id="maven3">资料</h2>
146+
## 资料
45147

46148
- <http://maven.apache.org/install.html>
47149
- <http://www.tutorialspoint.com/maven/index.htm>
48150
- <http://maven.apache.org/guides/getting-started/maven-in-five-minutes.html>
49151
- <http://maven.apache.org/guides/getting-started/index.html>
50152
- <http://maven.apache.org/general.html>
153+
- <http://stackoverflow.com/questions/6950346/infrastructure-with-maven-jenkins-nexus>
154+
- <http://blog.csdn.net/sxyx2008/article/details/7975129>
155+
- <http://blog.csdn.net/xuke6677/article/details/8482472>

Nexus-Install-And-Settings.md

Lines changed: 55 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,8 @@
1-
<h1 id="nexus">Nexus 安装和配置</h1>
1+
# Nexus 安装和配置
22

3-
------
43

5-
* [Nexus 安装和配置](#nexus)
6-
* [Nexus 安装](#install)
7-
* [Nexus 配置](#settings)
8-
* [Nexus 手动更新索引文件](#update-index)
9-
* [资料](#information)
10-
11-
------
124

13-
<h2 id="install">Nexus 安装</h2>
5+
## Nexus 安装
146

157
- Nexus 安装
168
- 官网:<http://www.sonatype.org/nexus/>
@@ -32,13 +24,15 @@
3224
- 把目录名字改为更好看点:`mv nexus-2.11.4-01/ nexus2.11.4/`
3325
- 编辑系统配置文件:`vim /etc/profile`
3426
- 在文件的尾巴增加下面内容:
27+
3528
```
3629
# Nexus
3730
NEXUS_HOME=/usr/program/nexus2.11.4
3831
export NEXUS_HOME
3932
RUN_AS_USER=root
4033
export RUN_AS_USER
4134
```
35+
4236
- 刷新配置:`source /etc/profile`
4337
- 由于目录 `sonatype-work` 以后是做仓库用的,会存储很多 jar,所以这个目录一定要放在磁盘空间大的区内,目前我们还没第一次启动 Nexus,所以这里还是空文件
4438
- 我个人习惯把这类目录放在 `/opt` 下,所以你要特别注意,下面有内容对这个文件夹进行操作的都是基于 opt 目录的:`mv /opt/setup/sonatype-work/ /opt/`
@@ -58,18 +52,16 @@
5852
- 登录账号密码:
5953
- 账号密码:**admin**
6054
- 密码:**admin123**
61-
62-
63-
64-
<h2 id="settings">Nexus 配置</h2>
6555
56+
57+
## Nexus 配置
58+
59+
- 修改默认端口:`vim /usr/program/nexus2.11.4/conf/nexus.properties`,修改该值:application-port=8081
6660
- 下载远程中央库的索引到服务器
6761
- ![Nexus 配置](images/Nexus-Install-And-Settings-a-1.jpg)
6862
- 如上图标注 4 所示,把默认是 `False` 改为 `True`
6963
- ![Nexus 配置](images/Nexus-Install-And-Settings-a-2.gif)
7064
- 如上图 gif 所示,创建任务开始进行索引下载。需要特别提醒的是,如果你的私服是虚拟机,那得保证你分配的硬盘足够大,别像我一样吝啬只给 10 G(现在还剩下 1.9 G),结果报:**设备上没有空间**
71-
72-
7365
- 项目上配置链接连接私服(下面内容涉及到 maven 的基础知识,请自行私下学习):
7466
- 对项目独立设置:
7567
- 打开项目的 pom.xml 文件:
@@ -96,9 +88,50 @@
9688
</mirror>
9789
</mirrors>
9890
```
99-
100-
101-
<h2 id="update-index">Nexus 手动更新索引文件</h2>
91+
92+
93+
## 持续集成自动构建后发布到 Nexus 上
94+
95+
- 在 Maven 的 settings.xml 加上连接服务器信息:
96+
97+
``` bash
98+
<!--设置私库认证信息,用户名和密码我就用默认的,如果你们有权限控制的需求可以创建对应的一些账号-->
99+
<servers>
100+
<server>
101+
<id>nexus-releases</id>
102+
<username>admin</username>
103+
<password>admin123</password>
104+
</server>
105+
<server>
106+
<id>nexus-snapshots</id>
107+
<username>admin</username>
108+
<password>admin123</password>
109+
</server>
110+
</servers>
111+
```
112+
113+
114+
- 在项目的 pom.xml 文件加上:
115+
116+
``` bash
117+
<!-- nexus-releases nexus-snapshots 与 Maven 的配置文件 settings.xml 中 server 下的 id 对应 -->
118+
<distributionManagement>
119+
<repository>
120+
<id>nexus-releases</id>
121+
<name>Nexus Releases Repository</name>
122+
<url>http://192.168.0.110:8081/nexus/content/repositories/releases/</url>
123+
</repository>
124+
<snapshotRepository>
125+
<id>nexus-snapshots</id>
126+
<name>Nexus Snapshots Repository</name>
127+
<url>http://192.168.0.110:8081/nexus/content/repositories/snapshots/</url>
128+
</snapshotRepository>
129+
</distributionManagement>
130+
```
131+
132+
133+
134+
## Nexus 手动更新索引文件
102135
- 手动更新索引
103136
- 关闭 Nexus:`/usr/program/nexus2.11.4/bin/nexus stop`
104137
- 命令:`cd /opt/sonatype-work/nexus/indexer/central-ctx`
@@ -110,8 +143,9 @@
110143
- 执行解压命令(该命令执行需要4分钟左右):`java -jar indexer-cli-5.1.0.jar -u nexus-maven-repository-index.gz -d ./`
111144
- 删除解压前文件:`rm -rf indexer-cli-5.1.0.jar nexus-maven-repository-index.gz nexus-maven-repository-index.properties`
112145
- 重启服务:`/usr/program/nexus2.11.4/bin/nexus start`
113-
114-
<h2 id="information">资料</h2>
146+
147+
148+
## 资料
115149

116150
- <http://www.cnblogs.com/leefreeman/p/4211530.html>
117151
- <http://www.itdadao.com/article/89071/>

0 commit comments

Comments
 (0)