Create separate macros for ONAP baremetal jobs 68/4168/1
authorFatih Degirmenci <fdegir@gmail.com>
Tue, 24 Mar 2020 18:45:29 +0000 (18:45 +0000)
committerFatih Degirmenci <fdegir@gmail.com>
Tue, 24 Mar 2020 18:45:29 +0000 (18:45 +0000)
Change-Id: Id0f849c78ece7e13aa3776243d59da67e14637d2

jjb/cloud-infra/cloud-infra-periodic-onap-baremetal.yaml
jjb/cloud-infra/onap-deploy-baremetal.sh [new file with mode: 0644]
jjb/cloud-infra/onap-healthcheck-baremetal.sh [new file with mode: 0644]
jjb/cloud-infra/onap-macros.yaml

index f3eef6d5ff29d55d0906f5b513b0934d86080664..646888022751d158808480ff760ddecb8c4b3438 100644 (file)
@@ -67,8 +67,8 @@
       - oom-hc:
           build-timeout: 30
           test-type: oom-healthcheck
       - oom-hc:
           build-timeout: 30
           test-type: oom-healthcheck
-      - promote-onap:
-          build-timeout: 240
+#      - promote-onap:
+#          build-timeout: 240
 
     onap-healthcheck-phases:
       - onap-hc-core:
 
     onap-healthcheck-phases:
       - onap-hc-core:
 
     builders:
       - description-setter:
 
     builders:
       - description-setter:
-          description: $DEPLOY_SCENARIO | $ONAP_FLAVOR
+          description: $DEPLOY_SCENARIO | $ONAP_FLAVOR | baremetal
       - multijob:
           name: Deploy ONAP using OOM
           condition: ALWAYS
       - multijob:
           name: Deploy ONAP using OOM
           condition: ALWAYS
 
     builders:
       - description-setter:
 
     builders:
       - description-setter:
-          description: $DEPLOY_SCENARIO | $ONAP_FLAVOR | $OPENSTACK_CLOUD_PROVIDER
-      - '{onap-other-phases}-macro'
+          description: $DEPLOY_SCENARIO | $ONAP_FLAVOR | baremetal
+      - '{onap-other-phases}-baremetal-macro'
 
 - job-template:
     name: '{onap-healthcheck-phases}-{distro}-{installer-type}-baremetal-{ci-loop}-{onap-branch}'
 
 - job-template:
     name: '{onap-healthcheck-phases}-{distro}-{installer-type}-baremetal-{ci-loop}-{onap-branch}'
 
     builders:
       - description-setter:
 
     builders:
       - description-setter:
-          description: $DEPLOY_SCENARIO | $ONAP_FLAVOR | $OPENSTACK_CLOUD_PROVIDER
-      - 'onap-healthcheck-macro'
+          description: $DEPLOY_SCENARIO | $ONAP_FLAVOR | baremetal
+      - 'onap-healthcheck-baremetal-macro'
 
 # vim: set ts=2 sw=2 expandtab:
 
 # vim: set ts=2 sw=2 expandtab:
diff --git a/jjb/cloud-infra/onap-deploy-baremetal.sh b/jjb/cloud-infra/onap-deploy-baremetal.sh
new file mode 100644 (file)
index 0000000..42cc7cf
--- /dev/null
@@ -0,0 +1,76 @@
+#!/bin/bash
+
+# ============LICENSE_START=======================================================
+#  Copyright (C) 2019 The Nordix Foundation. All rights reserved.
+# ================================================================================
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+# SPDX-License-Identifier: Apache-2.0
+# ============LICENSE_END=========================================================
+
+set -o errexit
+set -o nounset
+
+cd $WORKSPACE
+/bin/rm -f ../inventory.ini
+echo "Info: Preparing for ONAP deployment"
+
+# checkout given engine version
+if [[ "$ENGINE_VERSION" != "master" ]]; then
+  echo "Warning: Checking out $ENGINE_VERSION"
+  git checkout -q $ENGINE_VERSION
+fi
+
+# checkout given engine refspec
+if [[ "$ENGINE_REFSPEC" != "master" ]]; then
+  echo "Warning: Checking out engine $ENGINE_REFSPEC"
+  echo "-------------------------------------------------------------------------"
+  git fetch https://gerrit.nordix.org/infra/engine $ENGINE_REFSPEC && git checkout -q FETCH_HEAD
+  echo "-------------------------------------------------------------------------"
+fi
+
+# update scenario version and refspec in engine/envine/var/sdf.yml
+if [[ "$DEPLOY_SCENARIO_VERSION" != "master" && "$DEPLOY_SCENARIO_REFSPEC" != "master" ]]; then
+  echo "Warning: Adding $DEPLOY_SCENARIO_VERSION as scenario version and $DEPLOY_SCENARIO_REFSPEC as scenario refspec"
+cat << EOF > $WORKSPACE/engine/var/sdf.yml
+scenario:
+  $DEPLOY_SCENARIO:
+    scm: git
+    src: https://gerrit.nordix.org/infra/swconfig.git
+    version: $DEPLOY_SCENARIO_VERSION
+    refspec: $DEPLOY_SCENARIO_REFSPEC
+    provisioners:
+      - $PROVISIONER_TYPE
+    installers:
+      $INSTALLER_TYPE:
+        role: scenarios/$DEPLOY_SCENARIO/$INSTALLER_TYPE/role/$DEPLOY_SCENARIO
+        distros:
+          - $DISTRO
+EOF
+
+  echo "Info: Temporary SDF content"
+  echo "-------------------------------------------------------------------------"
+  cat $WORKSPACE/engine/var/sdf.yml
+  echo "-------------------------------------------------------------------------"
+fi
+
+echo "Info: Starting K8S cluster creation and ONAP deployment"
+echo "-------------------------------------------------------------------------"
+cd $WORKSPACE
+./engine/deploy.sh -d $INSTALLER_TYPE -r $PROVISIONER_TYPE -s $DEPLOY_SCENARIO -v \
+    -p "https://gerrit.nordix.org/gitweb?p=infra/hwconfig.git;a=blob_plain;f=pods/${NODE_NAME}-pdf.yml" \
+    -i "https://gerrit.nordix.org/gitweb?p=infra/hwconfig.git;a=blob_plain;f=pods/${NODE_NAME}-idf.yml"
+
+cd $WORKSPACE
+/bin/cp /opt/engine/.cache/config/inventory.ini ../inventory.ini
+# vim: set ts=2 sw=2 expandtab:
diff --git a/jjb/cloud-infra/onap-healthcheck-baremetal.sh b/jjb/cloud-infra/onap-healthcheck-baremetal.sh
new file mode 100644 (file)
index 0000000..6099d0b
--- /dev/null
@@ -0,0 +1,33 @@
+#!/bin/bash
+
+# ============LICENSE_START=======================================================
+#  Copyright (C) 2019 The Nordix Foundation. All rights reserved.
+# ================================================================================
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+# SPDX-License-Identifier: Apache-2.0
+# ============LICENSE_END=========================================================
+
+set -o errexit
+set -o nounset
+
+cd $WORKSPACE
+echo "Info: Starting ${TEST_TYPE}-${ONAP_FLAVOR} using Xtesting"
+echo "-------------------------------------------------------------------------"
+echo "Info: Cloning opnfv/xtesting-onap repository"
+cd $HOME && /bin/rm -rf $WORKSPACE
+git clone -q $XTESTING_REPO_URL $WORKSPACE && cd $WORKSPACE
+cp /tmp/inventory.ini inventory/inventory.ini
+$WORKSPACE/xtesting.sh
+
+# vim: set ts=2 sw=2 expandtab:
index 7cfac2e7a1d6755cd359451e94f41b032189bc4b..0771a145b8938ef20b6a769ddcff8a9394b1b35f 100644 (file)
       - shell:
           !include-raw: ./onap-deploy.sh
 
       - shell:
           !include-raw: ./onap-deploy.sh
 
+- builder:
+    name: 'onap-deploy-baremetal-macro'
+    builders:
+      - shell:
+          !include-raw: ./wait-for-pkg-manager.sh
+      - shell:
+          !include-raw: ./onap-deploy-baremetal.sh
+
 - builder:
     name: 'oom-hc-macro'
     builders:
       - shell:
           !include-raw: ./oom-healthcheck.sh
 
 - builder:
     name: 'oom-hc-macro'
     builders:
       - shell:
           !include-raw: ./oom-healthcheck.sh
 
+- builder:
+    name: 'oom-hc-baremetal-macro'
+    builders:
+      - shell:
+          !include-raw: ./oom-healthcheck.sh
+
 - builder:
     name: 'onap-healthcheck-macro'
     builders:
       - shell:
           !include-raw: ./onap-healthcheck.sh
 
 - builder:
     name: 'onap-healthcheck-macro'
     builders:
       - shell:
           !include-raw: ./onap-healthcheck.sh
 
+- builder:
+    name: 'onap-healthcheck-baremetal-macro'
+    builders:
+      - shell:
+          !include-raw: ./onap-healthcheck.sh
+
 - builder:
     name: 'promote-onap-macro'
     builders:
 - builder:
     name: 'promote-onap-macro'
     builders: