Browse Source

Sync ci/files with ws17-ci repo

Michael Mächtel 8 years ago
parent
commit
8c63a81d39
3 changed files with 16 additions and 6 deletions
  1. 1
    1
      ci/check-basic-style.py
  2. 14
    4
      ci/check-files.py
  3. 1
    1
      ci/run-travis.sh

+ 1
- 1
ci/check-basic-style.py View File

1
-#!/usr/bin/env python
1
+#!/usr/bin/env python2
2
 from __future__ import print_function
2
 from __future__ import print_function
3
 
3
 
4
 # Checks
4
 # Checks

+ 14
- 4
ci/check-files.py View File

1
-#!/usr/bin/env python
1
+#!/usr/bin/env python2
2
 from __future__ import print_function
2
 from __future__ import print_function
3
 
3
 
4
+import re
5
+import sys
6
+
4
 from os import listdir
7
 from os import listdir
5
 from os.path import dirname, isfile, join, isdir
8
 from os.path import dirname, isfile, join, isdir
6
 
9
 
7
 ROOT_DIR = join(dirname(__file__), '..')
10
 ROOT_DIR = join(dirname(__file__), '..')
8
 FILES_FOLDER = join(ROOT_DIR, 'files')
11
 FILES_FOLDER = join(ROOT_DIR, 'files')
9
 
12
 
13
+def natural_sort_key(value):
14
+    return [int(s) if s.isdigit() else s.lower() for s in re.split(r"(\d+)", value)]
15
+
10
 
16
 
11
 def get_file_lists():
17
 def get_file_lists():
12
     if not isdir(FILES_FOLDER):
18
     if not isdir(FILES_FOLDER):
41
             errors += 1
47
             errors += 1
42
 
48
 
43
     if errors == 0:
49
     if errors == 0:
50
+        return True
44
         print(" -> All Files found.")
51
         print(" -> All Files found.")
52
+    return False
45
 
53
 
46
 
54
 
47
 def main():
55
 def main():
48
-    for f, file_list in get_file_lists().items():
49
-        print(f)
50
-        check_files(file_list)
56
+    file_lists = get_file_lists()
57
+    newest_folder = sorted(file_lists.keys(), key=natural_sort_key)[-1]
58
+    print(newest_folder)
59
+    if not check_files(file_lists[newest_folder]):
60
+        sys.exit(1)
51
 
61
 
52
 
62
 
53
 if __name__ == '__main__':
63
 if __name__ == '__main__':

+ 1
- 1
ci/run-travis.sh View File

13
 
13
 
14
 # file existence
14
 # file existence
15
 echo "=== Checking for Missing Files ======================================="
15
 echo "=== Checking for Missing Files ======================================="
16
-"$MY_PATH/check-files.py"
16
+"$MY_PATH/check-files.py" || true
17
 
17
 
18
 echo "++++++++++++++++++++++++++++++++++++++++++++++++++++"
18
 echo "++++++++++++++++++++++++++++++++++++++++++++++++++++"
19
 echo "+              Everything is fine!                 +"
19
 echo "+              Everything is fine!                 +"

Loading…
Cancel
Save