Merge "Add node UUI display macro"
[ci-management.git] / jjb / akraino-templates / akraino-ta-common-macros.yaml
index 24436b9..7006eac 100644 (file)
 ###########
 # BUILDER #
 ###########
+- builder:
+    name: lf-display-node-uuid
+    builders:
+        - shell: |2-
+            echo "---> Node UUID:"
+            curl -s http://169.254.169.254/openstack/latest/meta_data.json | python -c 'import sys, json; data = json.load(sys.stdin); print(data["uuid"])'
+
 - builder:
     name: ta-builder-tox
     builders:
     name: ta-builder-rpm
     builders:
         - shell: |2-
-            sudo yum install -y createrepo
-            ta/build-tools/build_rpms.sh \
-              -m ta/manifest \
-              -r ta/rpmbuilder \
-              -w work \
-              {project-to-build}
-            find work/
+            #  Skip RPM build in case no *.spec file is found within the {project-to-build}
+            if [ -n "$(find {project-to-build} -name '*.spec')" ]
+            then
+                sudo yum install -y createrepo
+                ta/build-tools/build_rpms.sh \
+                 -m ta/manifest \
+                 -r ta/rpmbuilder \
+                 -w work \
+                 {project-to-build}
+                find work/
+            fi
 
 - builder:
     name: ta-builder-scm
           - ../shell/ta-rpm-deploy.sh
       - shell: !include-raw:
           - ../../global-jjb/shell/logs-clear-credentials.sh
+      - inject:
+          properties-content: 'ALT_NEXUS_URL='
 
 - builder:
     name: ta-lf-infra-ship-isos