23 lines
661 B
Plaintext
23 lines
661 B
Plaintext
pipeline {
|
|||
|
|
agent { label 'assignment8-trusted' }
|
||
|
|
options { disableConcurrentBuilds(); timeout(time: 15, unit: 'MINUTES'); timestamps() }
|
||
|
|
stages {
|
||
|
|
stage('Checkout') { steps { checkout scm } }
|
||
|
|
stage('Unit tests') {
|
||
|
|
steps {
|
||
|
|
dir('secure-delivery/v1') {
|
||
|
|
sh '''set -eu
|
||
|
|
python3 -m venv .test-venv
|
||
|
|
.test-venv/bin/pip install -r requirements.txt
|
||
|
|
.test-venv/bin/python -m py_compile app.py test_app.py
|
||
|
|
.test-venv/bin/python -m unittest -v
|
||
|
|
'''
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|
||
|
|
stage('Ansible syntax') {
|
||
|
|
steps { dir('secure-delivery') { sh 'ansible-playbook -i ansible/inventory.ini ansible/deploy.yml --syntax-check' } }
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|