Skip to content
This repository was archived by the owner on Nov 29, 2023. It is now read-only.

Commit 04ffd1a

Browse files
committed
release v1.0.0
1 parent a5a0696 commit 04ffd1a

File tree

3 files changed

+60
-1
lines changed

3 files changed

+60
-1
lines changed

bin/deploy.py

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
# coding:utf-8
2+
3+
import os
4+
import sys
5+
import re
6+
import shutil
7+
8+
if len(sys.argv) < 2:
9+
print('missing version')
10+
exit()
11+
12+
version = sys.argv[1]
13+
14+
if len(sys.argv) < 3:
15+
print('missing local maven repository path')
16+
exit()
17+
18+
project_repository_path = sys.argv[2]
19+
20+
if not os.path.exists(project_repository_path):
21+
print('local maven repository path not found')
22+
exit()
23+
24+
# 更新版本
25+
26+
os.chdir('..')
27+
with open('pom.xml', 'r+', encoding='utf-8') as fr:
28+
content = fr.read()
29+
30+
with open('pom.xml', 'w+', encoding='utf-8') as fw:
31+
replaced = re.sub('<project.version>.*?</project.version>',
32+
version.join(['<project.version>', '</project.version>']), content)
33+
fw.write(replaced)
34+
35+
# 安装至本地maven仓库
36+
print(os.popen('git pull').read())
37+
print(os.popen('mvn clean deploy').read())
38+
39+
validator_mvn_home = os.sep.join([os.path.expanduser('~'), '.m2',
40+
'repository', 'org', 'code4everything', 'validator', version])
41+
target_path = os.sep.join(
42+
[project_repository_path, 'org', 'code4everything', 'validator', version])
43+
44+
shutil.copytree(validator_mvn_home, target_path)
45+
46+
print(os.popen('git add .').read())
47+
print(os.popen('git commit -m "release v%s"' % version).read())

bin/install.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# coding:utf-8
2+
3+
import os
4+
5+
os.chdir("..")
6+
print(os.popen("git pull").read())
7+
print(os.popen("mvn clean install").read())

pom.xml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,12 @@
66

77
<groupId>org.code4everything</groupId>
88
<artifactId>validator</artifactId>
9-
<version>1.0-SNAPSHOT</version>
9+
<version>${project.version}</version>
10+
11+
<properties>
12+
<java.version>8</java.version>
13+
<project.version>1.0.0</project.version>
14+
</properties>
1015

1116
<!--私有仓库-->
1217
<repositories>

0 commit comments

Comments
 (0)