Kailash Khalasi | e43352e | 2018-06-15 18:46:40 -0700 | [diff] [blame] | 1 | /* mcord-in-a-box 6.0 pipeline build and test*/ |
| 2 | |
| 3 | pipeline { |
| 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 Khalasi | 502c125 | 2018-06-27 11:29:20 -0700 | [diff] [blame] | 16 | mkdir cord |
| 17 | cd cord/ |
Kailash Khalasi | e43352e | 2018-06-15 18:46:40 -0700 | [diff] [blame] | 18 | git clone https://gerrit.opencord.org/automation-tools |
| 19 | popd |
| 20 | ''' |
| 21 | } |
| 22 | } |
| 23 | |
| 24 | stage ('Install MCORD') { |
| 25 | steps { |
| 26 | sh ''' |
Kailash Khalasi | 502c125 | 2018-06-27 11:29:20 -0700 | [diff] [blame] | 27 | pushd $WORKSPACE/cord |
Kailash Khalasi | e43352e | 2018-06-15 18:46:40 -0700 | [diff] [blame] | 28 | ./automation-tools/mcord/mcord-in-a-box.sh |
| 29 | popd |
| 30 | ''' |
| 31 | } |
| 32 | } |
Kailash Khalasi | b3445fa | 2018-06-21 17:05:56 -0700 | [diff] [blame] | 33 | 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 |
| 48 | EOF |
| 49 | popd |
| 50 | kubectl create -f /tmp/\$HOSTNAME-dns.yaml |
| 51 | ''' |
| 52 | } |
| 53 | } |
Kailash Khalasi | e43352e | 2018-06-15 18:46:40 -0700 | [diff] [blame] | 54 | |
| 55 | stage ('Test MCORD') { |
| 56 | steps { |
| 57 | sh ''' |
| 58 | pushd $WORKSPACE |
| 59 | git clone https://gerrit.opencord.org/mcord |
| 60 | cd mcord/test |
Kailash Khalasi | b3445fa | 2018-06-21 17:05:56 -0700 | [diff] [blame] | 61 | ansible-playbook -i localhost, -c local mcord-cavium-test-playbook.yml |
Kailash Khalasi | e43352e | 2018-06-15 18:46:40 -0700 | [diff] [blame] | 62 | popd |
| 63 | ''' |
| 64 | } |
| 65 | } |
| 66 | } |
| 67 | |
| 68 | post { |
| 69 | always { |
| 70 | sh ''' |
| 71 | pushd $WORKSPACE |
| 72 | kubectl get pods --all-namespaces |
Kailash Khalasi | 502c125 | 2018-06-27 11:29:20 -0700 | [diff] [blame] | 73 | helm list |
Kailash Khalasi | e43352e | 2018-06-15 18:46:40 -0700 | [diff] [blame] | 74 | popd |
| 75 | ''' |
| 76 | step([$class: 'Mailer', notifyEveryUnstableBuild: true, recipients: "${notificationEmail}", sendToIndividuals: false]) |
| 77 | } |
| 78 | } |
| 79 | } |