File tree 5 files changed +17
-12
lines changed
mongodb_consistent_backup/Backup/Mongodump
5 files changed +17
-12
lines changed Original file line number Diff line number Diff line change @@ -27,18 +27,12 @@ jobs:
27
27
28
28
environment :
29
29
PYTHON_BIN : /usr/local/bin/python2.7
30
+
30
31
working_directory : ~/repo
31
32
32
33
steps :
33
34
- checkout
34
-
35
- # Download and cache dependencies
36
- - restore_cache :
37
- keys :
38
- - v1-dependencies-{{ checksum "requirements.txt" }}
39
- # fallback to using the latest cache if no exact match is found
40
- - v1-dependencies-
41
-
35
+
42
36
- run :
43
37
name : set version and build the rpm
44
38
command : |
Original file line number Diff line number Diff line change 4
4
* .pyc
5
5
.idea
6
6
* .iml
7
+ .history *
8
+ venv *
9
+ .local *
Original file line number Diff line number Diff line change 1
- 1.4.1
1
+ 1.4.2
Original file line number Diff line number Diff line change 2
2
import os
3
3
import logging
4
4
import sys
5
+ from distutils .version import LooseVersion
5
6
6
7
from multiprocessing import Process
7
8
from select import select
@@ -73,7 +74,7 @@ def do_ssl_insecure(self):
73
74
74
75
def is_version_gte (self , compare ):
75
76
if os .path .isfile (self .binary ) and os .access (self .binary , os .X_OK ):
76
- if tuple (compare . split ( "." )) <= tuple (self .version . split ( "." ) ):
77
+ if LooseVersion (compare ) <= LooseVersion (self .version ):
77
78
return True
78
79
return False
79
80
@@ -168,6 +169,12 @@ def mongodump_cmd(self):
168
169
mongodump_flags .extend ([
169
170
"--out=%s/dump" % self .backup_dir
170
171
])
172
+ if self .is_version_gte ("4.2.0" ):
173
+ logging .info ("MongoDump Version higher that 4.2.0 found extending mongodump with snppy compressor flag" )
174
+ ## https://www.mongodb.com/docs/drivers/node/v4.4/fundamentals/connection/network-compression/
175
+ mongodump_flags .extend ([
176
+ "--compressors=%s" % "snappy,zlib,zstd"
177
+ ])
171
178
172
179
# --numParallelCollections
173
180
if self .threads > 0 :
@@ -222,6 +229,7 @@ def mongodump_cmd(self):
222
229
sys .exit (1 )
223
230
224
231
mongodump_cmd .extend (mongodump_flags )
232
+ logging .info ("-----mongodump_cmd: %s" % mongodump_cmd )
225
233
return mongodump_cmd
226
234
227
235
def run (self ):
Original file line number Diff line number Diff line change @@ -109,8 +109,8 @@ if [ -d ${srcdir} ]; then
109
109
exit 1
110
110
fi
111
111
112
- # build fails on Pex 1.5+
113
- ${venvdir} /bin/python2.7 ${venvdir} /bin/pip install ${pip_flags} " pex<=1.4 "
112
+ # build work with pex<=2.1.120 as of 23 feb 2023
113
+ ${venvdir} /bin/python2.7 ${venvdir} /bin/pip install ${pip_flags} " pex<=2.1.120 "
114
114
if [ $? -gt 0 ]; then
115
115
echo " Failed to install pex utility for building!"
116
116
exit 1
You can’t perform that action at this time.
0 commit comments