blob: 5c9eb9456f06d88f678466600009aa5c2f1fbf79 [file] [log] [blame]
Kailash Khalasie43352e2018-06-15 18:46:40 -07001/* mcord-in-a-box 6.0 pipeline build and test*/
2
3pipeline {
4
5 /* no label, executor is determined by JJB */
6 agent {
7 label "${params.executorNode}"
8 }
9
10 stages {
11
12 stage ('Checkout Automation-Tools Repo') {
13 steps {
14 sh '''
15 pushd $WORKSPACE
Kailash Khalasi502c1252018-06-27 11:29:20 -070016 mkdir cord
17 cd cord/
Kailash Khalasie43352e2018-06-15 18:46:40 -070018 git clone https://gerrit.opencord.org/automation-tools
19 popd
20 '''
21 }
22 }
23
24 stage ('Install MCORD') {
25 steps {
26 sh '''
Kailash Khalasi502c1252018-06-27 11:29:20 -070027 pushd $WORKSPACE/cord
Kailash Khalasie43352e2018-06-15 18:46:40 -070028 ./automation-tools/mcord/mcord-in-a-box.sh
29 popd
30 '''
31 }
32 }
Kailash Khalasib3445fa2018-06-21 17:05:56 -070033 stage ('Configure K8 Compute Node DNS') {
34 steps {
35 sh '''
36 pushd $WORKSPACE
37 HOSTNAME=\$(cat /etc/hostname)
38 IPADDRESS=\$(ip route get 8.8.8.8 | head -1 | cut -d' ' -f8)
39 cat <<EOF > /tmp/\$HOSTNAME-dns.yaml
40 kind: Service
41 apiVersion: v1
42 metadata:
43 name: \$HOSTNAME
44 namespace: default
45 spec:
46 type: ExternalName
47 externalName: \$IPADDRESS
48EOF
49 popd
50 kubectl create -f /tmp/\$HOSTNAME-dns.yaml
51 '''
52 }
53 }
Kailash Khalasie43352e2018-06-15 18:46:40 -070054
55 stage ('Test MCORD') {
56 steps {
57 sh '''
58 pushd $WORKSPACE
59 git clone https://gerrit.opencord.org/mcord
60 cd mcord/test
Kailash Khalasib3445fa2018-06-21 17:05:56 -070061 ansible-playbook -i localhost, -c local mcord-cavium-test-playbook.yml
Kailash Khalasie43352e2018-06-15 18:46:40 -070062 popd
63 '''
64 }
65 }
66 }
67
68 post {
69 always {
70 sh '''
71 pushd $WORKSPACE
72 kubectl get pods --all-namespaces
Kailash Khalasi502c1252018-06-27 11:29:20 -070073 helm list
Kailash Khalasie43352e2018-06-15 18:46:40 -070074 popd
75 '''
76 step([$class: 'Mailer', notifyEveryUnstableBuild: true, recipients: "${notificationEmail}", sendToIndividuals: false])
77 }
78 }
79}