-
Notifications
You must be signed in to change notification settings - Fork 26
/
Jenkinsfile
89 lines (88 loc) · 2.09 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
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
properties([
pipelineTriggers([[$class: 'PeriodicFolderTrigger', interval: '1d']]),
parameters([
string(name: 'API_URL', defaultValue: 'https://api.quantum-inspire.com/', description: 'Quantum Inspire API url'),
string(name: 'API_CREDENTIALS_ID', defaultValue: 'api.quantum-inspire.com', description: 'Jenkins credentials ID'),
]),
buildDiscarder(
logRotator(
artifactDaysToKeepStr: '',
artifactNumToKeepStr: '',
daysToKeepStr: '',
numToKeepStr: '10'
)
)
])
pipeline {
agent {
kubernetes {
label 'sdk'
yaml '''
apiVersion: v1
kind: Pod
metadata:
labels:
test: sdk
spec:
containers:
- name: python
image: python:3.6
command:
- cat
tty: true
resources:
requests:
memory: "1Gi"
limits:
memory: "1Gi"
- name: jnlp
resources:
requests:
memory: "256Mi"
limits:
memory: "256Mi"
'''
}
}
triggers {
cron(env.BRANCH_NAME == "dev" ? "H H(2-5) * * 1-5" : "")
}
stages {
stage('Workspace') {
steps {
container('python') {
sh '''
git clone https://github.com/Qiskit/qiskit-terra.git
'''
}
}
}
stage('Build') {
steps {
container('python') {
sh '''
python3 -m venv env &&
. ./env/bin/activate &&
pip install cython --upgrade &&
pip install ./qiskit-terra --upgrade &&
pip install . -r ./src/tests/requirements.txt --upgrade
'''
}
}
}
stage('Tests') {
steps {
container('python') {
withCredentials([usernamePassword(credentialsId: API_CREDENTIALS_ID,
usernameVariable: 'QI_EMAIL', passwordVariable: 'QI_PASSWORD')]) {
sh '''
. ./env/bin/activate &&
python ./docs/example_qiskit_entangle.py &&
python ./docs/example_qiskit_conditional.py
'''
}
}
}
}
}
}