forked from palisadoes/infoset-ng
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Jenkinsfile
40 lines (37 loc) · 1.32 KB
/
Jenkinsfile
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
/*
You will need to create the requisite db and db user on the machine using Jenkins
create database test_infoset;
create user 'travis'@'localhost' identified by '';
grant all privileges on test_infoset.* to 'travis'@'localhost';
*/
pipeline {
agent any
stages {
stage('Build') {
steps {
echo 'Building..'
}
}
stage('Test') {
steps {
sh 'virtualenv venv ; chmod -R +x venv ; ./venv/bin/activate'
sh 'pip3 install setuptools'
sh 'pip3 install -r requirements.txt'
sh 'export PYTHONPATH=${PYTHONPATH}:$(pwd)/infoset/test'
sh 'python3 infoset/test/_do_all_tests.py'
}
}
stage('Deploy') {
when {
branch 'master'
}
steps{
echo 'Deploying....'
sh 'cp -r * /home/luke/infoset-ng'
sh 'cp etc/config.yaml.example /home/luke/infoset-ng/etc/config.yaml'
sh 'cd /home/luke && infoset-ng/bin/systemd/infoset-ng-api --stop --force'
sh 'cd /home/luke/ && ./infoset-ng/venv/bin/activate && infoset-ng/bin/systemd/infoset-ng-ingester --restart --force && infoset-ng/bin/systemd/infoset-ng-api --start --force'
}
}
}
}