diff options
-rw-r--r-- | jjb/integration/integration-templates.yaml | 2 | ||||
-rw-r--r-- | jjb/integration/run-csit.sh | 177 | ||||
-rw-r--r-- | jjb/sdc/sdc-sdc-docker-base.yaml | 44 | ||||
-rw-r--r-- | jjb/so/so-adapters-so-cnf-adapter.yaml | 14 | ||||
-rw-r--r-- | jjb/so/so-adapters-so-etsi-sol005-adapter.yaml | 15 | ||||
-rw-r--r-- | jjb/so/so-adapters-so-oof-adapter.yaml | 14 | ||||
-rw-r--r-- | packer/templates/helm.json | 6 | ||||
-rw-r--r-- | packer/templates/redis.json | 6 |
8 files changed, 122 insertions, 156 deletions
diff --git a/jjb/integration/integration-templates.yaml b/jjb/integration/integration-templates.yaml index 77be42b97..34e3ed6cc 100644 --- a/jjb/integration/integration-templates.yaml +++ b/jjb/integration/integration-templates.yaml @@ -57,7 +57,7 @@ id: integration-linters project-type: freestyle description: 'Job intended for running linters with Tox and Coala' - build-node: ubuntu1804-builder-4c-4g + build-node: centos8-builder-2c-1g node: '{build-node}' parameters: diff --git a/jjb/integration/run-csit.sh b/jjb/integration/run-csit.sh index 877cebbba..4ee5d753b 100644 --- a/jjb/integration/run-csit.sh +++ b/jjb/integration/run-csit.sh @@ -20,99 +20,10 @@ echo "---> run-csit.sh" -WORKDIR=$(mktemp -d --suffix=-robot-workdir) - -# Exit if no arguments are provided and required variables not set -if [[ $# -eq 0 ]] && [[ -z "${TESTPLAN}" ]] && [[ -z "${TESTOPTIONS}" ]]; then - echo - echo "Usage: $0 plans/<project>/<functionality> [<robot-options>]" - echo - echo " <project>, <functionality>, <robot-options>: " - echo " The same values as for the JJB job template:" - echo ' {project}-csit-{functionality}' - echo - exit 1 - -elif [[ $# -ne 2 ]] && [[ -z "${TESTPLAN}" ]] && [[ -z "${TESTOPTIONS}" ]]; then - echo - echo "Script called without arguments, but the following variables" - echo " must be set: {TESTPLAN} {TESTOPTIONS}" - echo - exit 1 - -elif [[ $# -eq 2 ]]; then - export TESTPLAN=$1; export TESTOPTIONS=$2 -fi - -# Python version should match that used to setup -# robot-framework in other jobs/stages -# Use pyenv for selecting the python version -if [[ -d "/opt/pyenv" ]]; then - echo "Setup pyenv:" - export PYENV_ROOT="/opt/pyenv" - export PATH="$PYENV_ROOT/bin:$PATH" - pyenv versions - if command -v pyenv 1>/dev/null 2>&1; then - eval "$(pyenv init - --no-rehash)" - # Choose the latest numeric Python version from installed list - version=$(pyenv versions --bare \ - | sed '/^[^0-9]/d' | sort -V | tail -n 1) - pyenv local "${version}" - fi -fi - # # functions # -# load the saved set options -function load_set { - _setopts="$-" - - # bash shellopts - for i in $(echo "$SHELLOPTS" | tr ':' ' ') ; do - set +o "${i}" - done - for i in $(echo "$RUN_CSIT_SHELLOPTS" | tr ':' ' ') ; do - set -o "${i}" - done - - # other options - for i in $(echo "$_setopts" | sed 's/./& /g') ; do - set +"${i}" - done - set -"${RUN_CSIT_SAVE_SET}" -} - -# set options for quick bailout when error -function harden_set { - set -xeo pipefail - set +u # enabled it would probably fail too many often -} - -# relax set options so the sourced file will not fail -# the responsibility is shifted to the sourced file... -function relax_set { - set +e - set +o pipefail -} - -# save current set options -function save_set { - RUN_CSIT_SAVE_SET="$-" - RUN_CSIT_SHELLOPTS="$SHELLOPTS" -} - -# wrapper for sourcing a file -function source_safely { - if [[ -z "$1" ]] && return 1; then - relax_set - # shellcheck disable=SC1090 - source "$1" - load_set - fi -} - function on_exit { rc=$? if [[ ${WORKSPACE} ]]; then @@ -128,10 +39,11 @@ function on_exit { # Run teardown script plan if it exists cd "${TESTPLANDIR}" TEARDOWN="${TESTPLANDIR}/teardown.sh" - if [[ -f "${TEARDOWN}" ]]; then + if [ -f "${TEARDOWN}" ]; then echo "Running teardown script ${TEARDOWN}" source_safely "${TEARDOWN}" fi + # TODO: do something with the output exit $rc } # ensure that teardown and other finalizing steps are always executed @@ -157,6 +69,52 @@ function docker_stats { echo } +# save current set options +function save_set { + RUN_CSIT_SAVE_SET="$-" + RUN_CSIT_SHELLOPTS="$SHELLOPTS" +} + +# load the saved set options +function load_set { + _setopts="$-" + + # bash shellopts + for i in $(echo "$SHELLOPTS" | tr ':' ' ') ; do + set +o ${i} + done + for i in $(echo "$RUN_CSIT_SHELLOPTS" | tr ':' ' ') ; do + set -o ${i} + done + + # other options + for i in $(echo "$_setopts" | sed 's/./& /g') ; do + set +${i} + done + set -${RUN_CSIT_SAVE_SET} +} + +# set options for quick bailout when error +function harden_set { + set -xeo pipefail + set +u # enabled it would probably fail too many often +} + +# relax set options so the sourced file will not fail +# the responsibility is shifted to the sourced file... +function relax_set { + set +e + set +o pipefail +} + +# wrapper for sourcing a file +function source_safely { + [ -z "$1" ] && return 1 + relax_set + . "$1" + load_set +} + # # main # @@ -164,21 +122,29 @@ function docker_stats { # set and save options for quick failure harden_set && save_set -if [[ -z "${WORKSPACE}" ]]; then - if (git rev-parse --show-toplevel > /dev/null 2>&1); then - WORKSPACE=$(git rev-parse --show-toplevel) - export WORKSPACE - else - WORKSPACE=$(pwd) - export WORKSPACE - fi +if [ $# -eq 0 ]; then + echo + echo "Usage: $0 plans/<project>/<functionality> [<robot-options>]" + echo + echo " <project>, <functionality>, <robot-options>: " + echo " The same values as for the '{project}-csit-{functionality}' JJB job template." + echo + exit 1 +fi + +if [ -z "$WORKSPACE" ]; then + export WORKSPACE=$(git rev-parse --show-toplevel) fi -if [[ ! -f "${WORKSPACE}/${TESTPLAN}/testplan.txt" ]]; then +if [ -f "${WORKSPACE}/${1}/testplan.txt" ]; then + export TESTPLAN="${1}" +else echo "testplan not found: ${WORKSPACE}/${TESTPLAN}/testplan.txt" exit 2 fi +export TESTOPTIONS="${2}" + rm -rf "$WORKSPACE/archives/$TESTPLAN" mkdir -p "$WORKSPACE/archives/$TESTPLAN" @@ -190,6 +156,7 @@ source_safely "${WORKSPACE}/prepare-csit.sh" # Activate the virtualenv containing all the required libraries installed by prepare-csit.sh source_safely "${ROBOT3_VENV}/bin/activate" +WORKDIR=$(mktemp -d --suffix=-robot-workdir) cd "${WORKDIR}" # Add csit scripts to PATH @@ -219,16 +186,16 @@ grep -E -v '(^[[:space:]]*#|^[[:space:]]*$)' "${TESTPLANDIR}/testplan.txt" |\ cat testplan.txt SUITES=$( xargs -a testplan.txt ) -echo ROBOT_VARIABLES="${ROBOT_VARIABLES}" -echo "Starting Robot test suites ${SUITES} ..." -relax_set - echo "Versioning information:" python3 --version -pip freeze +pip3 freeze python3 -m robot.run --version || : -python -m robot.run -N "${TESTPLAN}" -v WORKSPACE:/tmp "${ROBOT_VARIABLES}" "${TESTOPTIONS}" "${SUITES}" +echo ROBOT_VARIABLES="${ROBOT_VARIABLES}" +echo "Starting Robot test suites ${SUITES} ..." +relax_set +# Do NOT quote variables below, it breaks testing +python3 -m robot.run -N ${TESTPLAN} -v WORKSPACE:/tmp ${ROBOT_VARIABLES} ${TESTOPTIONS} ${SUITES} RESULT=$? load_set echo "RESULT: $RESULT" diff --git a/jjb/sdc/sdc-sdc-docker-base.yaml b/jjb/sdc/sdc-sdc-docker-base.yaml deleted file mode 100644 index 3798685c3..000000000 --- a/jjb/sdc/sdc-sdc-docker-base.yaml +++ /dev/null @@ -1,44 +0,0 @@ ---- - -- project: - name: sdc-sdc-docker-base - project-name: 'sdc-sdc-docker-base' - jobs: - - '{project-name}-{stream}-verify-java': - build-node: 'ubuntu1804-docker-v1-8c-8g' - docker-pom: 'pom.xml' - - '{project-name}-{stream}-sdc-merge-java': - build-node: 'ubuntu1804-docker-8c-8g' - docker-pom: 'pom.xml' - mvn-profile: 'default' - - gerrit-maven-docker-stage: - sbom-generator: true - build-node: ubuntu1804-docker-8c-8g - maven-versions-plugin: true - mvn-params: '-P default' - container-public-registry: 'nexus3.onap.org:10001' - container-staging-registry: 'nexus3.onap.org:10003' - - '{project-name}-gerrit-release-jobs': - build-node: centos7-docker-8c-8g - project: 'sdc/sdc-docker-base' - stream: - - 'master': - branch: 'master' - - 'jakarta': - branch: 'jakarta' - - 'kohn': - branch: 'kohn' - mvn-settings: 'sdc-sdc-docker-base-settings' - files: '**' - archive-artifacts: '' - build-node: ubuntu1804-builder-4c-4g - maven-version: 'mvn36' - -- project: - name: sdc-sdc-docker-base-info - project-name: sdc-sdc-docker-base - jobs: - - gerrit-info-yaml-verify - build-node: centos7-builder-2c-1g - project: sdc/sdc-docker-base - branch: master diff --git a/jjb/so/so-adapters-so-cnf-adapter.yaml b/jjb/so/so-adapters-so-cnf-adapter.yaml index ea3db2919..663656bb2 100644 --- a/jjb/so/so-adapters-so-cnf-adapter.yaml +++ b/jjb/so/so-adapters-so-cnf-adapter.yaml @@ -59,3 +59,17 @@ mvn-settings: 'so-adapters-so-cnf-adapter-settings' mvn-goals: 'clean install' mvn-opts: '-Xmx1024m -XX:MaxPermSize=256m' + +- project: + name: so-adapters-so-cnf-adapter-clm + java-version: openjdk11 + jobs: + - gerrit-maven-clm + nexus-iq-namespace: 'onap-' + project: 'so/adapters/so-cnf-adapter' + project-name: 'so-adapters-so-cnf-adapter' + build-node: ubuntu1804-docker-v1-8c-8g + stream: + - 'master': + branch: 'master' + mvn-settings: 'so-adapters-so-cnf-adapter-settings' diff --git a/jjb/so/so-adapters-so-etsi-sol005-adapter.yaml b/jjb/so/so-adapters-so-etsi-sol005-adapter.yaml index cb16d5c15..bb54fd540 100644 --- a/jjb/so/so-adapters-so-etsi-sol005-adapter.yaml +++ b/jjb/so/so-adapters-so-etsi-sol005-adapter.yaml @@ -59,3 +59,18 @@ mvn-settings: 'so-adapters-so-etsi-sol005-adapter-settings' mvn-goals: 'clean install' mvn-opts: '-Xmx1024m -XX:MaxPermSize=256m' + + +- project: + name: so-adapters-so-etsi-sol005-adapter-clm + java-version: openjdk11 + jobs: + - gerrit-maven-clm + nexus-iq-namespace: 'onap-' + project: 'so/adapters/so-etsi-sol005-adapter' + project-name: 'so-adapters-so-etsi-sol005-adapter' + build-node: ubuntu1804-docker-v1-8c-8g + stream: + - 'master': + branch: 'master' + mvn-settings: 'so-adapters-so-etsi-sol005-adapter-settings' diff --git a/jjb/so/so-adapters-so-oof-adapter.yaml b/jjb/so/so-adapters-so-oof-adapter.yaml index 5a37cf6b6..d52f40f28 100644 --- a/jjb/so/so-adapters-so-oof-adapter.yaml +++ b/jjb/so/so-adapters-so-oof-adapter.yaml @@ -59,3 +59,17 @@ mvn-settings: 'so-adapters-so-oof-adapter-settings' mvn-goals: 'clean install' mvn-opts: '-Xmx1024m -XX:MaxPermSize=256m' + +- project: + name: so-adapters-so-oof-adapter-clm + java-version: openjdk11 + jobs: + - gerrit-maven-clm + nexus-iq-namespace: 'onap-' + project: 'so/adapters/so-oof-adapter' + project-name: 'so-adapters-so-oof-adapter' + build-node: ubuntu1804-docker-v1-8c-8g + stream: + - 'master': + branch: 'master' + mvn-settings: 'so-adapters-so-oof-adapter-settings' diff --git a/packer/templates/helm.json b/packer/templates/helm.json index cdf752af0..ac824ced4 100644 --- a/packer/templates/helm.json +++ b/packer/templates/helm.json @@ -42,9 +42,7 @@ "provisioners": [ { "type": "shell", - "scripts": [ - "common-packer/provision/install-python.sh" - ], + "scripts": ["common-packer/provision/install-python.sh"], "execute_command": "chmod +x {{ .Path }}; if [ \"$UID\" == \"0\" ]; then {{ .Vars }} '{{ .Path }}'; else {{ .Vars }} sudo -E '{{ .Path }}'; fi" }, { @@ -53,6 +51,8 @@ }, { "type": "ansible", + "command": "./common-packer/ansible-playbook.sh", + "skip_version_check": true, "playbook_file": "provision/helm.yaml", "ansible_env_vars": [ "ANSIBLE_NOCOWS=1", diff --git a/packer/templates/redis.json b/packer/templates/redis.json index 6bf7b17f3..657f10923 100644 --- a/packer/templates/redis.json +++ b/packer/templates/redis.json @@ -39,9 +39,7 @@ "provisioners": [ { "type": "shell", - "scripts": [ - "common-packer/provision/install-python.sh" - ], + "scripts": ["common-packer/provision/install-python.sh"], "execute_command": "chmod +x {{ .Path }}; if [ \"$UID\" == \"0\" ]; then {{ .Vars }} '{{ .Path }}'; else {{ .Vars }} sudo -E '{{ .Path }}'; fi" }, { @@ -50,6 +48,8 @@ }, { "type": "ansible", + "command": "./common-packer/ansible-playbook.sh", + "skip_version_check": true, "playbook_file": "provision/redis.yaml", "ansible_env_vars": [ "ANSIBLE_NOCOWS=1", |