File tree Expand file tree Collapse file tree 1 file changed +63
-0
lines changed Expand file tree Collapse file tree 1 file changed +63
-0
lines changed Original file line number Diff line number Diff line change 1+ pipeline {
2+ agent any
3+
4+ environment {
5+ VENV = ' venv'
6+ }
7+
8+ stages {
9+ stage(' Clone Repo' ) {
10+ steps {
11+ git ' https://github.com/ap-dev-github/sentiment-analyzer-api.git'
12+ }
13+ }
14+
15+ stage(' Set Up Python' ) {
16+ steps {
17+ sh '''
18+ python3 -m venv venv
19+ . venv/bin/activate
20+ pip install --upgrade pip
21+ pip install -r requirements.txt
22+ '''
23+ }
24+ }
25+
26+ stage(' Lint & Security' ) {
27+ steps {
28+ sh '''
29+ . venv/bin/activate
30+ flake8 .
31+ bandit -r . || true
32+ isort . --check-only
33+ mypy . || true
34+ '''
35+ }
36+ }
37+
38+ stage(' Run Tests' ) {
39+ steps {
40+ sh '''
41+ . venv/bin/activate
42+ pytest tests/ --junitxml=results.xml
43+ '''
44+ }
45+ }
46+
47+ stage(' Deploy to Lambda' ) {
48+ steps {
49+ sh '''
50+ . venv/bin/activate
51+ npm install -g serverless
52+ serverless deploy --stage dev
53+ '''
54+ }
55+ }
56+ }
57+
58+ post {
59+ always {
60+ junit ' results.xml'
61+ }
62+ }
63+ }
You can’t perform that action at this time.
0 commit comments