Only run att-workflow on master
Only find xos-core in "Running" state when looking for container
Change-Id: Ic172ab747169da77fac7babaea89faae655ea2c6
diff --git a/jjb/pipeline/chart-api-test-helm.groovy b/jjb/pipeline/chart-api-test-helm.groovy
index e074f35..1ca5fbe 100644
--- a/jjb/pipeline/chart-api-test-helm.groovy
+++ b/jjb/pipeline/chart-api-test-helm.groovy
@@ -93,6 +93,11 @@
}
stage('install/test att-workflow') {
+ when {
+ expression {
+ params.manifestBranch ==~ 'master'
+ }
+ }
steps {
sh """
#!/usr/bin/env bash
@@ -120,7 +125,8 @@
helm status "\${hchart}"
done
- CORE_CONTAINER=\$(docker ps | grep k8s_xos-core | awk '{print \$1}')
+ CORE_POD=\$(kubectl get pods | grep "xos-core.*Running" | awk '{print \$1}')
+ CORE_CONTAINER=\$(docker ps | grep k8s_xos-core_\${CORE_POD} | awk '{print \$1}')
docker cp $WORKSPACE/cord/test/cord-tester/src/test/cord-api/Tests/targets/xosapitests.xtarget \$CORE_CONTAINER:/opt/xos/lib/xos-genx/xosgenx/targets/xosapitests.xtarget
docker cp $WORKSPACE/cord/test/cord-tester/src/test/cord-api/Tests/targets/xosserviceapitests.xtarget \$CORE_CONTAINER:/opt/xos/lib/xos-genx/xosgenx/targets/xosserviceapitests.xtarget
@@ -137,7 +143,6 @@
for i in \$SERVICES; do bash -c "docker exec -i \$CORE_CONTAINER /bin/bash -c 'xosgenx --target /opt/xos/lib/xos-genx/xosgenx/targets/./xoslibrary.xtarget /opt/xos/dynamic_services/\$i/\$i.xproto /opt/xos/core/models/core.xproto'" > $WORKSPACE/cord/test/cord-tester/src/test/cord-api/Tests/\$i\$library; done
- CORE_CONTAINER=\$(docker ps | grep k8s_xos-core | awk '{print \$1}')
CHAM_CONTAINER=\$(docker ps | grep k8s_xos-chameleon | awk '{print \$1}')
XOS_CHAMELEON=\$(docker exec \$CHAM_CONTAINER ip a | grep -oE "([0-9]{1,3}\\.){3}[0-9]{1,3}\\b" | grep 172)
@@ -190,7 +195,8 @@
helm status "\${hchart}"
done
- CORE_CONTAINER=\$(docker ps | grep k8s_xos-core | awk '{print \$1}')
+ CORE_POD=\$(kubectl get pods | grep "xos-core.*Running" | awk '{print \$1}')
+ CORE_CONTAINER=\$(docker ps | grep k8s_xos-core_\${CORE_POD} | awk '{print \$1}')
docker cp $WORKSPACE/cord/test/cord-tester/src/test/cord-api/Tests/targets/xosapitests.xtarget \$CORE_CONTAINER:/opt/xos/lib/xos-genx/xosgenx/targets/xosapitests.xtarget
docker cp $WORKSPACE/cord/test/cord-tester/src/test/cord-api/Tests/targets/xosserviceapitests.xtarget \$CORE_CONTAINER:/opt/xos/lib/xos-genx/xosgenx/targets/xosserviceapitests.xtarget
@@ -207,7 +213,6 @@
for i in \$SERVICES; do bash -c "docker exec -i \$CORE_CONTAINER /bin/bash -c 'xosgenx --target /opt/xos/lib/xos-genx/xosgenx/targets/./xoslibrary.xtarget /opt/xos/dynamic_services/\$i/\$i.xproto /opt/xos/core/models/core.xproto'" > $WORKSPACE/cord/test/cord-tester/src/test/cord-api/Tests/\$i\$library; done
- CORE_CONTAINER=\$(docker ps | grep k8s_xos-core | awk '{print \$1}')
CHAM_CONTAINER=\$(docker ps | grep k8s_xos-chameleon | awk '{print \$1}')
XOS_CHAMELEON=\$(docker exec \$CHAM_CONTAINER ip a | grep -oE "([0-9]{1,3}\\.){3}[0-9]{1,3}\\b" | grep 172)
@@ -262,7 +267,8 @@
helm status "\${hchart}"
done
- CORE_CONTAINER=\$(docker ps | grep k8s_xos-core | awk '{print \$1}')
+ CORE_POD=\$(kubectl get pods | grep "xos-core.*Running" | awk '{print \$1}')
+ CORE_CONTAINER=\$(docker ps | grep k8s_xos-core_\${CORE_POD} | awk '{print \$1}')
docker cp $WORKSPACE/cord/test/cord-tester/src/test/cord-api/Tests/targets/xosapitests.xtarget \$CORE_CONTAINER:/opt/xos/lib/xos-genx/xosgenx/targets/xosapitests.xtarget
docker cp $WORKSPACE/cord/test/cord-tester/src/test/cord-api/Tests/targets/xosserviceapitests.xtarget \$CORE_CONTAINER:/opt/xos/lib/xos-genx/xosgenx/targets/xosserviceapitests.xtarget
@@ -279,7 +285,6 @@
for i in \$SERVICES; do bash -c "docker exec -i \$CORE_CONTAINER /bin/bash -c 'xosgenx --target /opt/xos/lib/xos-genx/xosgenx/targets/./xoslibrary.xtarget /opt/xos/dynamic_services/\$i/\$i.xproto /opt/xos/core/models/core.xproto'" > $WORKSPACE/cord/test/cord-tester/src/test/cord-api/Tests/\$i\$library; done
- CORE_CONTAINER=\$(docker ps | grep k8s_xos-core | awk '{print \$1}')
CHAM_CONTAINER=\$(docker ps | grep k8s_xos-chameleon | awk '{print \$1}')
XOS_CHAMELEON=\$(docker exec \$CHAM_CONTAINER ip a | grep -oE "([0-9]{1,3}\\.){3}[0-9]{1,3}\\b" | grep 172)
@@ -329,7 +334,8 @@
helm status "\${hchart}"
done
- CORE_CONTAINER=\$(docker ps | grep k8s_xos-core | awk '{print \$1}')
+ CORE_POD=\$(kubectl get pods | grep "xos-core.*Running" | awk '{print \$1}')
+ CORE_CONTAINER=\$(docker ps | grep k8s_xos-core_\${CORE_POD} | awk '{print \$1}')
docker cp $WORKSPACE/cord/test/cord-tester/src/test/cord-api/Tests/targets/xosapitests.xtarget \$CORE_CONTAINER:/opt/xos/lib/xos-genx/xosgenx/targets/xosapitests.xtarget
docker cp $WORKSPACE/cord/test/cord-tester/src/test/cord-api/Tests/targets/xosserviceapitests.xtarget \$CORE_CONTAINER:/opt/xos/lib/xos-genx/xosgenx/targets/xosserviceapitests.xtarget
@@ -346,7 +352,6 @@
for i in \$SERVICES; do bash -c "docker exec -i \$CORE_CONTAINER /bin/bash -c 'xosgenx --target /opt/xos/lib/xos-genx/xosgenx/targets/./xoslibrary.xtarget /opt/xos/dynamic_services/\$i/\$i.xproto /opt/xos/core/models/core.xproto'" > $WORKSPACE/cord/test/cord-tester/src/test/cord-api/Tests/\$i\$library; done
- CORE_CONTAINER=\$(docker ps | grep k8s_xos-core | awk '{print \$1}')
CHAM_CONTAINER=\$(docker ps | grep k8s_xos-chameleon | awk '{print \$1}')
XOS_CHAMELEON=\$(docker exec \$CHAM_CONTAINER ip a | grep -oE "([0-9]{1,3}\\.){3}[0-9]{1,3}\\b" | grep 172)
@@ -394,7 +399,8 @@
helm status "\${hchart}"
done
- CORE_CONTAINER=\$(docker ps | grep k8s_xos-core | awk '{print \$1}')
+ CORE_POD=\$(kubectl get pods | grep "xos-core.*Running" | awk '{print \$1}')
+ CORE_CONTAINER=\$(docker ps | grep k8s_xos-core_\${CORE_POD} | awk '{print \$1}')
docker cp $WORKSPACE/cord/test/cord-tester/src/test/cord-api/Tests/targets/xosapitests.xtarget \$CORE_CONTAINER:/opt/xos/lib/xos-genx/xosgenx/targets/xosapitests.xtarget
docker cp $WORKSPACE/cord/test/cord-tester/src/test/cord-api/Tests/targets/xosserviceapitests.xtarget \$CORE_CONTAINER:/opt/xos/lib/xos-genx/xosgenx/targets/xosserviceapitests.xtarget