25
25
- slack/notify :
26
26
event : fail
27
27
template : basic_fail_1
28
- linter :
29
- docker :
30
- - image : alpine/flake8
31
- working_directory : ~/repo
32
- steps :
33
- - checkout
34
- - run : apk update && apk upgrade && apk --no-cache add curl gettext bash
35
- - run :
36
- name : flake8
37
- command : flake8 --ignore=E,W ~/repo
38
- - slack/notify :
39
- event : fail
40
- template : basic_fail_1
41
28
test :
42
29
working_directory : ~/openbas
43
30
docker :
@@ -48,11 +35,34 @@ jobs:
48
35
- run :
49
36
working_directory : ~/openbas/crowdstrike
50
37
name : Install dependencies for crowdstrike collector
51
- command : pip install -r requirements.txt
38
+ command : |
39
+ CIRCLE_BRANCH_EXISTS=$(git ls-remote --heads https://github.com/OpenBAS-Platform/client-python.git ${CIRCLE_BRANCH} | wc -l)
40
+
41
+ if [ "CIRCLE_BRANCH_EXISTS" -eq "1" ]; then
42
+ TARGET_BRANCH=${CIRCLE_BRANCH}
43
+ else
44
+ TARGET_BRANCH="release/current"
45
+ fi
46
+
47
+ sed -i "s|^pyobas.*$|pyobas @ git+https://github.com/OpenBAS-Platform/client-python.git@${TARGET_BRANCH}|" requirements.txt
48
+ pip install -r requirements.txt
52
49
- run :
53
50
working_directory : ~/openbas/crowdstrike
54
51
name : Tests for crowdstrike collector
55
52
command : python -m unittest
53
+ linter :
54
+ docker :
55
+ - image : alpine/flake8
56
+ working_directory : ~/repo
57
+ steps :
58
+ - checkout
59
+ - run : apk update && apk upgrade && apk --no-cache add curl gettext bash
60
+ - run :
61
+ name : flake8
62
+ command : flake8 --ignore=E,W ~/repo
63
+ - slack/notify :
64
+ event : fail
65
+ template : basic_fail_1
56
66
build_1 :
57
67
working_directory : ~/openbas
58
68
docker :
@@ -290,6 +300,7 @@ workflows:
290
300
requires :
291
301
- ensure_formatting
292
302
- linter
303
+ - test
293
304
filters :
294
305
branches :
295
306
only :
@@ -298,6 +309,7 @@ workflows:
298
309
requires :
299
310
- ensure_formatting
300
311
- linter
312
+ - test
301
313
filters :
302
314
branches :
303
315
only :
0 commit comments