-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathcircleci-config.yml
More file actions
118 lines (112 loc) · 3.08 KB
/
circleci-config.yml
File metadata and controls
118 lines (112 loc) · 3.08 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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
version: 2.1
jobs:
build:
docker:
- image: python:3.10
steps:
- checkout
- run:
name: Install system dependencies
command: |
apt-get update
apt-get install -y python3-venv curl
- run:
name: Set up virtual environment and install dependencies
command: |
python -m venv env
source env/bin/activate
pip install --upgrade pip
pip install -r requirements.txt
python manage.py check
test:
docker:
- image: python:3.10
steps:
- checkout
- run:
name: Install dependencies and run tests
command: |
python -m venv env
source env/bin/activate
pip install --upgrade pip
pip install -r requirements.txt
python manage.py test taskManager
run_app_and_scan:
docker:
- image: python:3.10
steps:
- checkout
- run:
name: Install system dependencies
command: |
apt-get update
apt-get install -y python3-venv curl sudo
- run:
name: Set up virtual environment and run Django app
command: |
python -m venv env
source env/bin/activate
pip install --upgrade pip
pip install -r requirements.txt
nohup python manage.py runserver 0.0.0.0:8000 & sleep 10
background: true
- run:
name: Install Vimana Framework
command: |
curl -s https://raw.githubusercontent.com/s4dhulabs/vimana-framework/develop/scripts/install | bash
- run:
name: Create workspace directory
command: mkdir -p /tmp/workspace
- run:
name: Run Vimana Framewalk Scan
environment:
PYTHONWARNINGS: ignore
command: |
cd ~/vimana-framework && source .venv/bin/activate
export REPORT=framewalk_report_$(date +%Y%m%d_%H%M%S).json
vimana run framewalk --target-url http://127.0.0.1:8000/ --output $REPORT
echo "* Final plugin report: $REPORT"
# Copy report to workspace for artifact storage
cp $REPORT /tmp/workspace/
- persist_to_workspace:
root: /tmp/workspace
paths:
- framewalk_report_*.json
- store_artifacts:
path: /tmp/workspace
destination: vimana-reports
integration:
docker:
- image: python:3.10
steps:
- checkout
- run:
command: |
echo "~ Integration step"
exit 1
when: on_fail
prod:
docker:
- image: python:3.10
steps:
- checkout
- run: echo "~ Deploy step"
workflows:
version: 2
django_with_vimana:
jobs:
- build
- test:
requires:
- build
- run_app_and_scan:
requires:
- test
- integration:
requires:
- test
- run_app_and_scan
- prod:
type: approval
requires:
- integration