Add csit for policy docker 47/9347/5
authorandrew-est <andrew.fenner@est.tech>
Tue, 22 Jun 2021 14:23:46 +0000 (15:23 +0100)
committerandrew-est <andrew.fenner@est.tech>
Tue, 22 Jun 2021 15:08:55 +0000 (16:08 +0100)
Add docker verify
Change-Id: Ifd86b4aaebb616a0685c02eb73e07162693b6c0a
Signed-off-by: andrew-est <andrew.fenner@est.tech>
jjb/onap/global-templates-onap-java.yaml
jjb/onap/policy-docker-csit-jobs.sh [new file with mode: 0644]
jjb/onap/policy-docker/policy-docker-csit-jobs.yaml [new file with mode: 0644]
jjb/onap/policy-docker/policy-docker-verify-jobs.yaml [new file with mode: 0644]

index 5f038aa3d0ccabb8b567105922176c1f74c19e6d..6c874e75cc2cb3bd75f3ac3aab7cbd6d7402a872 100644 (file)
     builders:
       - shell:
           !include-raw-escape: ./verify-jobs.sh
+
+# csits for diferent projects are different so need to have special handling
+- job-template:
+    name: 'onap-policy-docker-{stream}-csit-java'
+    disabled_job_var: false
+    node: onap-ubuntu1804
+
+    disabled: '{obj:disabled_job_var}'
+    concurrent: true
+    properties:
+      - logrotate
+
+    parameters:
+      - project-parameters:
+          project: 'onap/{project}'
+          branch: '{branch}'
+      - nordix-gerrit-parameters
+      - string:
+          name: JAVA_HOME
+          default: '/usr/lib/jvm/{jdk-version}-openjdk-amd64'
+          description: Java home
+      - string:
+          name: CSIT_TEST_NAMES
+          default: '{csit_test_names}'
+          description: The name of the csits test to run
+    scm:
+      - git-scm-gerrit:
+          ssh-credentials-id: nordixinfra-nordix-gerrit-ssh
+          branch: 'master'
+          refspec: $GERRIT_REFSPEC
+          wipe_workspace: true
+          clean_before: false
+
+    triggers:
+      - nordix-gerrit-trigger-patchset-created:
+          project: 'onap/{project}'
+          branch: '{branch}'
+          files: '**'
+
+    wrappers:
+      - build-timeout:
+          timeout: 45
+
+    builders:
+      - 'wait-pkg-mgr-macro'
+      - shell:
+          !include-raw-escape: ./policy-docker-csit-jobs.sh
diff --git a/jjb/onap/policy-docker-csit-jobs.sh b/jjb/onap/policy-docker-csit-jobs.sh
new file mode 100644 (file)
index 0000000..5d1c80c
--- /dev/null
@@ -0,0 +1,34 @@
+#!/bin/bash
+set -o errexit
+set -o nounset
+set -o pipefail
+
+cd $WORKSPACE
+
+cd $WORKSPACE/csit
+echo "----------------------------------------------------"
+echo "Ensure Pip is usable"
+echo "----------------------------------------------------"
+sudo apt-get install -y python3-venv
+sudo apt-get install -y python3-dev gcc
+
+echo "----------------------------------------------------"
+echo "Install Docker compose if needed"
+echo "----------------------------------------------------"
+if [ -f /usr/local/bin/docker-compose ]; then
+  echo "Docker compose already installed"
+else
+  sudo curl -L "https://github.com/docker/compose/releases/download/1.29.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
+  sudo chmod +x /usr/local/bin/docker-compose
+fi
+
+unset WORKSPACE
+
+
+sed -i 's#./include-raw-integration-install-robotframework.sh#$SCRIPTS/include-raw-integration-install-robotframework.sh#g' prepare-csit.sh
+sed -i 's#pylibs.txt#$SCRIPTS/pylibs.txt#g' include-raw-integration-install-robotframework.sh
+
+for csit_test in  $(echo "$CSIT_TEST_NAMES" | tr " " "\n")
+do
+  ./run-project-csit.sh "$csit_test"
+done
diff --git a/jjb/onap/policy-docker/policy-docker-csit-jobs.yaml b/jjb/onap/policy-docker/policy-docker-csit-jobs.yaml
new file mode 100644 (file)
index 0000000..6e1de55
--- /dev/null
@@ -0,0 +1,35 @@
+---
+#
+# ============LICENSE_START=======================================================
+#  Copyright (C) 2019 Nordix Foundation.
+# ================================================================================
+# 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=========================================================
+
+# this job gets triggered when a change is proposed to
+# policy/docker project on Nordix Gerrit.
+
+- project:
+    name: policy-docker-csit
+    project: policy/docker
+    project-name: docker
+
+    stream:
+      - 'master':
+          branch: '{stream}'
+          jdk-version: java-11
+          csit_test_names: apex-pdp api xacml-pdp drools-applications pap drools-pdp distribution
+    jobs:
+      - 'onap-policy-docker-{stream}-csit-java'
diff --git a/jjb/onap/policy-docker/policy-docker-verify-jobs.yaml b/jjb/onap/policy-docker/policy-docker-verify-jobs.yaml
new file mode 100644 (file)
index 0000000..1360f3c
--- /dev/null
@@ -0,0 +1,35 @@
+---
+#
+# ============LICENSE_START=======================================================
+#  Copyright (C) 2021 Nordix Foundation.
+# ================================================================================
+# 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=========================================================
+
+# this job gets triggered when a change is proposed to
+# policy/docker project on Nordix Gerrit.
+
+- project:
+    name: policy-docker-verify
+    project: policy/docker
+    project-name: docker
+
+    stream:
+      - master:
+          branch: '{stream}'
+          jdk-version: java-11
+
+    jobs:
+      - 'onap-{project-name}-{stream}-verify-java'