spring_basic

spring基础

###@Componet####

阅读更多

springboot_annotation

springBoot @Configuration @Lazy

@ComponentScan 使用

ComponentScan 就是基本的扫描spring的注解包
注意点:如果要用到springboot的Filters属性,那么需要把useDefaultFilters设置成false,否则filter失效
@ComponentScan(value=”com.melon.web”,
includeFilters={@Filters(type=FilterType.ANNOTATION,classes={Controller.class}},
useDefaultFilters=false)

阅读更多

python_db

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
import cx_Oracle
import os
try:
os.environ['NLS_LANG'] = 'SIMPLIFIED CHINESE_CHINA.utf8'
db = cx_Oracle.connect('数据库用户名', '数据库密码', '数据库IP地址/数据库实例')
c = db.cursor()
##读取SQL文件,获得sql语句的list
with open(u'E:\\test.sql', 'r+') as f:
sql_list = f.read().split(';')[:-1] # sql文件最后一行加上;
sql_list = [x.replace('\n', ' ') if '\n' in x else x for x in sql_list] # 将每段sql里的换行符改成空格
##执行sql语句,使用循环执行sql语句
for sql_item in sql_list:
# print (sql_item)
c.execute(sql_item)
except cx_Oracle.Error as e:
print e
finally:
c.close()
db.commit()
db.close()

阅读更多

Hello World

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.

阅读更多

apollo

apollo

apollo

阅读更多

jenkins_jacoco

jekins jacoco

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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
<?xml version="1.0" encoding="UTF-8"?>

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<groupId>com.melon</groupId>
<artifactId>fenmi</artifactId>
<version>1.0-SNAPSHOT</version>

<name>fenmi</name>
<!-- FIXME change it to the project's website -->
<url>http://www.example.com</url>

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>1.7</maven.compiler.source>
<maven.compiler.target>1.7</maven.compiler.target>
</properties>

<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.11</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>0.8.1</version>
</dependency>
</dependencies>
<build>
<plugins>
<!-- jacoco plugin -->
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>0.7.9</version>
<executions>
<execution>
<!-- 在maven的initialize阶段,将Jacoco的runtime agent作为VM的一个参数 传给被测程序,用于监控JVM中的调用。 -->
<id>default-prepare-agent</id>
<goals>
<goal>prepare-agent</goal>
</goals>
<configuration>
<destFile>
${project.build.directory}/coverage-reports/jacoco.exec
</destFile>
<propertyName>surefireArgLine</propertyName>
</configuration>
</execution>
<!-- 在程序的verify阶段,执行report测试的程序。 文件的输入为perpare-agent阶段中设置或者默认的jacoco.exec.
参数 includes和excludes可用来选定report中过滤的类。 -->
<execution>
<id>default-report</id>
<phase>test</phase>
<goals>
<goal>report</goal>
</goals>
<configuration>
<dataFile>${project.build.directory}/coverage-reports/jacoco.exec</dataFile>
<outputDirectory>${project.reporting.outputDirectory}/jacoco</outputDirectory>
</configuration>
</execution>
</executions>
</plugin>
<!-- 使用 maven-surefire-plugin来执行单元测试。 将surefireArgLine赋值给argLine参数,以保证在测试执行时Jacoco
agent处于运行状态。 -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.19.1</version>
<configuration>
<argLine>${surefireArgLine}</argLine>
</configuration>
</plugin>
</plugins>
</build>
</project>

阅读更多

docker_jenkins

docker jenkins

1拉取镜像
1
docker pull jenkinsci/jenkins

阅读更多

docker example

docker example

1
2
3
4
$ tree identidock/
identidock/
└─ app
└─ identidock.py

阅读更多

docker常用命令

docker常用命令_RUN命令

阅读更多

gitlab备份还原

备份跟还原 GitLab

应用数据备份创建的压缩文件包含了数据库,所有代码仓库和所有附件。
你可以在另一个利用同一个版本的gitLab中回复。
通过备份跟恢复是迁移你的仓库从一个服务器到另一个的最好的方式。

阅读更多