Prepare application and Ansible validation pipeline
myfileagent-python-ci/pipeline/head This commit looks good
myfileagent-python-ci/pipeline/head This commit looks good
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
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' } }
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user