forked from openshift/assisted-test-infra
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Jenkinsfile.test
61 lines (53 loc) · 1.96 KB
/
Jenkinsfile.test
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
pipeline {
agent { label 'test-infra' }
environment {
SKIPPER_PARAMS = " "
PULL_SECRET = credentials('assisted-test-infra-pull-secret')
OCPMETAL_CREDS = credentials('docker_ocpmetal_cred')
BASE_DNS_DOMAINS = credentials('route53_dns_domain')
ROUTE53_SECRET = credentials('route53_secret')
PROFILE = "minikube"
NAMESPACE = "assisted-installer"
}
options {
timeout(time: 1, unit: 'HOURS')
}
stages {
stage('Init') {
steps {
sh "make image_build"
sh "make create_full_environment"
// Login
sh "minikube --profile ${PROFILE} ssh \"docker login --username ${OCPMETAL_CREDS_USR} --password ${OCPMETAL_CREDS_PSW}\""
}
}
stage('Test') {
steps {
sh "make run"
sh "make test"
}
post {
always {
junit '**/reports/*test.xml'
}
}
}
}
post {
always {
script {
try {
ip = sh(returnStdout: true, script: "minikube ip --profile ${PROFILE}").trim()
minikube_url = "https://${ip}:8443"
sh "kubectl --server=${minikube_url} get pods -A"
sh '''make download_all_logs LOGS_DEST=$WORKSPACE/cluster_logs REMOTE_SERVICE_URL="$(minikube service assisted-service --url -p ${PROFILE} -n ${NAMESPACE})"'''
for (service in ["assisted-service","postgres","scality","createimage"]) {
sh "kubectl --server=${minikube_url} get pods -o=custom-columns=NAME:.metadata.name -A | grep ${service} | xargs -r -I {} sh -c \"kubectl --server=${minikube_url} logs {} -n ${NAMESPACE} > {}.log\" || true"
}
} finally {
sh "make destroy"
}
}
}
}
}