forked from mongodb/mongo-java-driver
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmavenPush.py
More file actions
executable file
·48 lines (32 loc) · 1.12 KB
/
Copy pathmavenPush.py
File metadata and controls
executable file
·48 lines (32 loc) · 1.12 KB
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
#!/usr/bin/python
# http://repo1.maven.org/maven2/org/mongodb/mongo-java-driver/
import os
import sys
import shutil
import subprocess
if len( sys.argv ) == 1:
raise Exception( "need version number for now" )
version = sys.argv[1]
root = "/ebs/maven/"
p = subprocess.Popen( [ "/usr/bin/ant" , "clean" ] , stdout=subprocess.PIPE ).communicate()
p = subprocess.Popen( [ "/usr/bin/ant" , "alljars" ] , stdout=subprocess.PIPE ).communicate()
if p[0].find( "SUCCESSFUL" ) < 0:
print( p[0] )
print( p[1] )
raise( "build failed" )
dir = root + "/org/mongodb/mongo-java-driver/" + version
if not os.path.exists( dir ):
os.makedirs( dir )
root = dir + "/mongo-java-driver-" + version
for x in [ "" , "-sources" , "-javadoc" ]:
shutil.copy2( "mongo%s.jar" % x , root + x + ".jar" )
pom = open( "maven.xml" , "r" ).read()
pom = pom.replace( "$VERSION" , version )
out = open( root + ".pom" , 'w' )
out.write( pom )
out.close()
p = subprocess.Popen( [ "sha1sum" , root + ".jar" ] , stdout=subprocess.PIPE ).communicate()
sha1 = p[0].split( ' ' )[0]
out = open( root + ".jar.sha1" , 'w' )
out.write( sha1 )
out.close()