blob: f41778bcca152017d69eea4c01cdc6866dbecf45 [file] [log] [blame]
---
#
# ============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=========================================================
#--------------------------------------------------------------------------------------
# The jobs declared in this JJB configuration file are used for verifying patches
# that are sent to the repositories below
# - cloud-infra/engine
#
# These jobs verify changes that
# - implement new features or fix bugs for the deployment framework, engine, itself
# - implement new features or fix bugs to the playbooks and roles used for utilizing
# open source components such as bifrost, kubespray, and kolla-ansible
# - bump versions of open source components or the scenarios
#
# These jobs are set to run on slaves with label vpod-deploy-ubuntu1604.
# The slaves have
# - Ubuntu1604 as the base distro
# - nested virtualization
# - internet access
# - passwordless sudo
# - 16 CPUs/32GB RAM/200 GB Disk
# - docker, git vim curl wget zip unzip chrony apt-transport-https ca-certificates curl
# gnupg-agent software-properties-common docker-ce docker-ce-cli containerd.io openjdk-8-jre
#
# The slaves should not have a cloud infra scenario deployed on them.
#--------------------------------------------------------------------------------------
- project:
name: 'cloud-infra-verify-engine'
project: 'infra/engine'
stream:
- 'master':
branch: '{stream}'
distro:
- ubuntu1804:
disabled: false
- centos7:
disabled: true
cloud:
- city:
openrc-credentials-file: 'est-jenkins-openrcfile-city-karlskrona-onap'
type:
- virtual:
provisioner-type: 'bifrost'
slave-type: 'vpod'
successful: false
failed: false
unstable: false
notbuilt: false
- cloud:
provisioner-type: 'heat'
slave-type: 'jumphost'
successful: false
failed: false
unstable: false
notbuilt: false
phase:
- deploy:
build-timeout: 90
- functest:
build-timeout: 60
jobs:
- 'cloud-infra-verify-engine-{distro}-{cloud}-{type}-{stream}'
- 'cloud-infra-verify-engine-{distro}-{phase}-{type}-{stream}'
- job-template:
name: 'cloud-infra-verify-engine-{distro}-{cloud}-{type}-{stream}'
project-type: multijob
disabled: '{obj:disabled}'
concurrent: true
parameters:
- project-parameters:
project: '{project}'
branch: '{branch}'
- nordix-gerrit-parameters
- label:
name: SLAVE_LABEL
default: '{cloud}-{slave-type}-{distro}'
description: 'Slave label to schedule this job on. All slaves have Ubuntu1604 no matter what distro target nodes use'
- string:
name: DISTRO
default: '{distro}'
description: 'Distribution to use for configuring target nodes (networking etc.)'
- string:
name: PROVISIONER_TYPE
default: '{provisioner-type}'
description: 'Provisioner type to use'
- string:
name: DEPLOY_TYPE
default: '{type}'
description: 'Type of the deployment'
- string:
name: HEAT_ENVIRONMENT_FILENAME
default: 'heat-environment-{cloud}-{distro}.yaml'
description: 'Name of heat-environment file to use.'
- string:
name: STACK_NAME
default: "nordix-cicd-verify-engine-{distro}-$BUILD_NUMBER"
description: 'Name of the created stack'
- string:
name: KEYPAIR_NAME
default: "keypair-nordix-cicd-verify-engine-{distro}-$BUILD_NUMBER"
description: 'Name of the created keypair'
- string:
name: USE_PREBUILT_DEPLOYMENT_IMAGE
default: 'true'
description: 'Use prebuilt deployment image while running as part of CI/CD'
- string:
name: TEST_SUITE
default: 'healthcheck'
description: 'Test suite to run'
- string:
name: YARDSTICK_DISPATCHER
default: 'file'
description: 'Dispatcher to use for Yardstick reporting'
- string:
name: DELETE_STACK
default: 'yes'
description: 'Delete the stack upon completion of the build'
- string:
name: CLEANUP
default: 'true'
description: 'Cleanup leftovers of the previous run'
properties:
- logrotate
- build-blocker:
use-build-blocker: true
blocking-jobs:
- 'cloud-infra-verify-engine-.*'
- 'cloud-infra-verify-scenario-.*'
- 'cloud-infra-periodic-engine-.*'
- 'k8-.*'
- 'nolabs-.*'
block-level: 'NODE'
- throttle:
max-per-node: 1
max-total: 3
option: project
wrappers:
- credentials-binding:
- file:
credential-id: '{openrc-credentials-file}'
variable: OPENRC_FILE
- mask-passwords
- build-timeout:
timeout: 150
- fix-workspace-permissions
- openstack:
single-use: True
scm:
- git-scm-gerrit:
ssh-credentials-id: nordixinfra-nordix-gerrit-ssh
branch: '{branch}'
refspec: $GERRIT_REFSPEC
wipe_workspace: true
clean_before: false
triggers:
- gerrit:
server-name: 'Nordix Gerrit'
trigger-on:
- patchset-created-event:
exclude-drafts: 'false'
exclude-trivial-rebase: 'false'
exclude-no-code-change: 'false'
- draft-published-event
- comment-added-contains-event:
comment-contains-value: 'recheck'
- comment-added-contains-event:
comment-contains-value: 'reverify'
projects:
- project-compare-type: 'REG_EXP'
project-pattern: 'infra\/engine'
branches:
- branch-compare-type: 'ANT'
branch-pattern: '**/{branch}'
file-paths:
- compare-type: 'ANT'
pattern: '**'
skip-vote:
successful: '{obj:successful}'
failed: '{obj:failed}'
unstable: '{obj:unstable}'
notbuilt: '{obj:notbuilt}'
custom-url: '* $JOB_NAME $BUILD_URL'
builders:
- shell: |
#!/bin/bash
cp $OPENRC_FILE /tmp/openrc
- 'cloud-infra-determine-scenario-macro'
- multijob:
name: deploy
condition: SUCCESSFUL
projects:
- name: 'cloud-infra-verify-engine-{distro}-deploy-{type}-{stream}'
current-parameters: true
predefined-parameters: |
DISTRO=$DISTRO
DEPLOY_TYPE=$DEPLOY_TYPE
PROVISIONER_TYPE=$PROVISIONER_TYPE
STACK_NAME=$STACK_NAME
KEYPAIR_NAME=$KEYPAIR_NAME
HEAT_ENVIRONMENT_FILENAME=$HEAT_ENVIRONMENT_FILENAME
USE_PREBUILT_DEPLOYMENT_IMAGE=$USE_PREBUILT_DEPLOYMENT_IMAGE
CLEANUP=$CLEANUP
GERRIT_PROJECT=$GERRIT_PROJECT
GERRIT_BRANCH=$GERRIT_BRANCH
GERRIT_REFSPEC=$GERRIT_REFSPEC
GERRIT_CHANGE_NUMBER=$GERRIT_CHANGE_NUMBER
GERRIT_CHANGE_COMMIT_MESSAGE=$GERRIT_CHANGE_COMMIT_MESSAGE
node-parameters: true
kill-phase-on: FAILURE
abort-all-job: true
- multijob:
name: functest
condition: SUCCESSFUL
projects:
- name: 'cloud-infra-verify-engine-{distro}-functest-{type}-{stream}'
current-parameters: true
predefined-parameters: |
DISTRO=$DISTRO
DEPLOY_TYPE=$DEPLOY_TYPE
PROVISIONER_TYPE=$PROVISIONER_TYPE
STACK_NAME=$STACK_NAME
KEYPAIR_NAME=$KEYPAIR_NAME
HEAT_ENVIRONMENT_FILENAME=$HEAT_ENVIRONMENT_FILENAME
USE_PREBUILT_DEPLOYMENT_IMAGE=$USE_PREBUILT_DEPLOYMENT_IMAGE
TEST_SUITE=$TEST_SUITE
YARDSTICK_DISPATCHER=$YARDSTICK_DISPATCHER
CLEANUP=$CLEANUP
GERRIT_PROJECT=$GERRIT_PROJECT
GERRIT_BRANCH=$GERRIT_BRANCH
GERRIT_REFSPEC=$GERRIT_REFSPEC
GERRIT_CHANGE_NUMBER=$GERRIT_CHANGE_NUMBER
GERRIT_CHANGE_COMMIT_MESSAGE=$GERRIT_CHANGE_COMMIT_MESSAGE
node-parameters: true
kill-phase-on: FAILURE
abort-all-job: true
publishers:
- postbuildscript:
builders:
- role: SLAVE
build-on:
- SUCCESS
- FAILURE
- ABORTED
- NOT_BUILT
- UNSTABLE
build-steps:
- shell:
!include-raw-escape: ./wait-for-pkg-manager.sh
- shell:
!include-raw: ./delete-heat-stack.sh
- job-template:
name: 'cloud-infra-verify-engine-{distro}-{phase}-{type}-{stream}'
disabled: false
concurrent: true
properties:
- logrotate
parameters:
- string:
name: PROJECT
default: $GERRIT_PROJECT
- string:
name: DISTRO
default: 'ubuntu1804'
description: 'Distribution to use for configuring target nodes (networking etc.). Overriden by upstream job.'
- string:
name: DEPLOY_TYPE
default: 'virtual'
description: 'Type of the deployment. Overriden by upstream job.'
- string:
name: PROVISIONER_TYPE
default: 'bifrost'
description: 'Provisioner type to use. Overriden by upstream job.'
- string:
name: HEAT_ENVIRONMENT_FILENAME
default: "heat-environment-city-ubuntu1804.yaml"
description: 'Name of heat-environment file to use.'
- string:
name: HEAT_ENVIRONMENT_FILE
default: "file://$WORKSPACE/engine/provisioner/heat/playbooks/roles/install-configure-heat/files/$HEAT_ENVIRONMENT_FILENAME"
description: 'Location of heat-environment file to use.'
- string:
name: STACK_NAME
default: "nordix-cicd-verify-engine-{distro}-$BUILD_NUMBER"
description: 'Name of the created stack'
- string:
name: USE_PREBUILT_DEPLOYMENT_IMAGE
default: 'false'
description: 'Use prebuilt deployment image while running as part of CI/CD'
- string:
name: TEST_FW
default: '{phase}'
description: 'Test framework to use'
- string:
name: TEST_SUITE
default: 'healthcheck'
description: 'Test suite to run'
- string:
name: TEST_REPO_URL
default: 'https://gerrit.nordix.org/infra/test.git'
description: 'URL to Nordix Cloud Infra test repository'
- string:
name: YARDSTICK_DISPATCHER
default: 'file'
description: 'Dispatcher to use for Yardstick reporting'
- string:
name: CLEANUP
default: 'false'
wrappers:
- mask-passwords
- build-timeout:
timeout: '{build-timeout}'
- fix-workspace-permissions
scm:
- git-scm-gerrit:
ssh-credentials-id: nordixinfra-nordix-gerrit-ssh
branch: '{branch}'
refspec: $GERRIT_REFSPEC
wipe_workspace: true
clean_before: false
builders:
- 'cloud-infra-determine-scenario-macro'
- 'cloud-infra-{phase}-macro'
# vim: set ts=2 sw=2 expandtab: