diff options
author | Fatih Degirmenci <fatih.degirmenci@ericsson.com> | 2017-03-20 13:30:55 +0100 |
---|---|---|
committer | Fatih Degirmenci <fatih.degirmenci@ericsson.com> | 2017-03-20 13:33:50 +0100 |
commit | d3fc60f22dd0d7831f901568dc9eaa9b748b5215 (patch) | |
tree | 7b8b4385c45e930ea99114c852ecf020c4b5d295 /jjb/infra | |
parent | 34dea93ae5adad32c3f88f867ebcf85da78e803c (diff) |
xci: Create skeletons for jobs and rename directory
This patch
- creates job skeletongs based on the structure of other OPNFV jobs
upstream job per scenario triggering and controlling the downstream jobs
downstream jobs to run provisioning, deployment and functest
- renames infra directory to xci
Change-Id: I9a7ac3590d660f4270ab387598586e4270787ecb
Signed-off-by: Fatih Degirmenci <fatih.degirmenci@ericsson.com>
Diffstat (limited to 'jjb/infra')
-rw-r--r-- | jjb/infra/bifrost-cleanup-job.yml | 140 | ||||
-rw-r--r-- | jjb/infra/bifrost-verify-jobs.yml | 223 | ||||
-rwxr-xr-x | jjb/infra/bifrost-verify.sh | 134 |
3 files changed, 0 insertions, 497 deletions
diff --git a/jjb/infra/bifrost-cleanup-job.yml b/jjb/infra/bifrost-cleanup-job.yml deleted file mode 100644 index 571e275da..000000000 --- a/jjb/infra/bifrost-cleanup-job.yml +++ /dev/null @@ -1,140 +0,0 @@ -- project: - name: 'openstack-bifrost-cleanup' -#-------------------------------- -# branches -#-------------------------------- - stream: - - master: - branch: '{stream}' - -#-------------------------------- -# projects -#-------------------------------- - project: - - 'openstack': - project-repo: 'https://git.openstack.org/openstack/bifrost' - clone-location: '/opt/bifrost' - - 'opnfv': - project-repo: 'https://gerrit.opnfv.org/gerrit/releng' - clone-location: '/opt/releng' - -#-------------------------------- -# jobs -#-------------------------------- - jobs: - - '{project}-bifrost-cleanup-{stream}' - -- job-template: - name: '{project}-bifrost-cleanup-{stream}' - - concurrent: false - - node: bifrost-verify-virtual - - # Make sure no verify job is running on any of the slaves since that would - # produce build logs after we wipe the destination directory. - properties: - - build-blocker: - blocking-jobs: - - '{project}-bifrost-verify-*' - - parameters: - - string: - name: PROJECT - default: '{project}' - - builders: - - shell: | - #!/bin/bash - - set -eu - - # DO NOT change this unless you know what you are doing. - BIFROST_GS_URL="gs://artifacts.opnfv.org/cross-community-ci/openstack/bifrost/$GERRIT_NAME/$GERRIT_CHANGE_NUMBER/" - - # This should never happen... even 'recheck' uses the last jobs' - # gerrit information. Better exit with error so we can investigate - [[ ! -n $GERRIT_NAME ]] || [[ ! -n $GERRIT_CHANGE_NUMBER ]] && exit 1 - - echo "Removing build artifacts for $GERRIT_NAME/$GERRIT_CHANGE_NUMBER" - - if ! [[ "$BIFROST_GS_URL" =~ "/cross-community-ci/openstack/bifrost/" ]]; then - echo "Oops! BIFROST_GS_URL=$BIFROST_GS_URL does not seem like a valid" - echo "bifrost location on the Google storage server. Please double-check" - echo "that it's set properly or fix this line if necessary." - echo "gsutil will not be executed until this is fixed!" - exit 1 - fi - # No force (-f). We always verify upstream jobs so if there are no logs - # something else went wrong and we need to break immediately and investigate - gsutil -m rm -r $BIFROST_GS_URL - - triggers: - - '{project}-gerrit-trigger-cleanup': - branch: '{branch}' - - publishers: - - email: - recipients: fatih.degirmenci@ericsson.com yroblamo@redhat.com mchandras@suse.de jack.morgan@intel.com zhang.jun3g@zte.com.cn -#-------------------------------- -# trigger macros -#-------------------------------- -- trigger: - name: 'openstack-gerrit-trigger-cleanup' - triggers: - - gerrit: - server-name: 'review.openstack.org' - escape-quotes: true - trigger-on: - # We only run this when the change is merged or - # abandoned since we don't need the logs anymore - - patchset-uploaded-event: 'false' - - change-merged-event: 'true' - - change-abandoned-event: 'true' - - change-restored-event: 'false' - - draft-published-event: 'false' - # This is an OPNFV maintenance job. We don't want to provide - # feedback on Gerrit - silent: true - silent-start: true - projects: - - project-compare-type: 'PLAIN' - project-pattern: 'openstack/bifrost' - branches: - - branch-compare-type: 'ANT' - branch-pattern: '**/{branch}' - disable-strict-forbidden-file-verification: 'true' - forbidden-file-paths: - - compare-type: ANT - pattern: 'doc/**' - - compare-type: ANT - pattern: 'releasenotes/**' - disable-strict-forbidden-file-verification: 'true' - readable-message: true -- trigger: - name: 'opnfv-gerrit-trigger-cleanup' - triggers: - - gerrit: - server-name: 'gerrit.opnfv.org' - trigger-on: - # We only run this when the change is merged or - # abandoned since we don't need the logs anymore - - patchset-uploaded-event: 'false' - - change-merged-event: 'true' - - change-abandoned-event: 'true' - - change-restored-event: 'false' - - draft-published-event: 'false' - # This is an OPNFV maintenance job. We don't want to provide - # feedback on Gerrit - silent: true - silent-start: true - projects: - - project-compare-type: 'ANT' - project-pattern: 'releng' - branches: - - branch-compare-type: 'ANT' - branch-pattern: '**/{branch}' - file-paths: - - compare-type: ANT - pattern: 'prototypes/bifrost/**' - readable-message: true diff --git a/jjb/infra/bifrost-verify-jobs.yml b/jjb/infra/bifrost-verify-jobs.yml deleted file mode 100644 index 33032bc7b..000000000 --- a/jjb/infra/bifrost-verify-jobs.yml +++ /dev/null @@ -1,223 +0,0 @@ -- project: - name: 'openstack-bifrost-verify' -#-------------------------------- -# branches -#-------------------------------- - stream: - - master: - branch: '{stream}' -#-------------------------------- -# projects -#-------------------------------- - project: - - 'openstack': - project-repo: 'https://git.openstack.org/openstack/bifrost' - clone-location: '/opt/bifrost' - - 'opnfv': - project-repo: 'https://gerrit.opnfv.org/gerrit/releng' - clone-location: '/opt/releng' -#-------------------------------- -# distros -#-------------------------------- - distro: - - 'trusty': - disabled: false - dib-os-release: 'trusty' - dib-os-element: 'ubuntu-minimal' - dib-os-packages: 'vlan,vim,less,bridge-utils,language-pack-en,iputils-ping,rsyslog,curl' - extra-dib-elements: 'openssh-server' - - 'centos7': - disabled: false - dib-os-release: '7' - dib-os-element: 'centos7' - dib-os-packages: 'vim,less,bridge-utils,iputils,rsyslog,curl' - extra-dib-elements: 'openssh-server' - - 'suse': - disabled: false - dib-os-release: '42.2' - dib-os-element: 'opensuse-minimal' - dib-os-packages: 'vim,less,bridge-utils,iputils,rsyslog,curl' - extra-dib-elements: 'openssh-server' -#-------------------------------- -# type -#-------------------------------- - type: - - virtual -#-------------------------------- -# jobs -#-------------------------------- - jobs: - - '{project}-bifrost-verify-{distro}-{type}-{stream}' - -#-------------------------------- -# VM defaults -#-------------------------------- -- defaults: - name: vm_defaults - vm-disk: '30' - vm-disk-cache: 'unsafe' - vm-memory: '4096' - vm-cpu: '2' - -#-------------------------------- -# job templates -#-------------------------------- -- job-template: - name: '{project}-bifrost-verify-{distro}-{type}-{stream}' - - disabled: '{obj:disabled}' - - defaults: vm_defaults - - concurrent: false - - properties: - - logrotate-default - - build-blocker: - use-build-blocker: true - blocking-jobs: - - '.*-bifrost-verify.*-{type}' - block-level: 'NODE' - - parameters: - - string: - name: PROJECT - default: '{project}' - - string: - name: PROJECT_REPO - default: '{project-repo}' - - string: - name: CLONE_LOCATION - default: '{clone-location}' - - string: - name: DISTRO - default: '{distro}' - - string: - name: DIB_OS_RELEASE - default: '{dib-os-release}' - - string: - name: DIB_OS_ELEMENT - default: '{dib-os-element}' - - string: - name: EXTRA_DIB_ELEMENTS - default: '{extra-dib-elements}' - - string: - name: DIB_OS_PACKAGES - default: '{dib-os-packages}' - - string: - name: VM_DISK - default: '{vm-disk}' - - string: - name: VM_DISK_CACHE - default: '{vm-disk-cache}' - - string: - name: VM_MEMORY - default: '{vm-memory}' - - string: - name: VM_CPU - default: '{vm-cpu}' - - string: - name: CLEAN_DIB_IMAGES - default: 'true' - - label: - name: SLAVE_LABEL - default: 'infra-{type}-{distro}' - - string: - name: BIFROST_LOG_URL - default: 'http://artifacts.opnfv.org/cross-community-ci/openstack/bifrost/$GERRIT_NAME/$GERRIT_CHANGE_NUMBER/$GERRIT_PATCHSET_NUMBER/$JOB_NAME' - - scm: - - git: - url: '$PROJECT_REPO' - refspec: '$GERRIT_REFSPEC' - branches: - - 'origin/$BRANCH' - skip-tag: true - choosing-strategy: 'gerrit' - timeout: 10 - wipe-workspace: true - - triggers: - - '{project}-gerrit-trigger': - branch: '{branch}' - - builders: - - bifrost-set-name - - bifrost-build - - publishers: - - email: - recipients: fatih.degirmenci@ericsson.com yroblamo@redhat.com mchandras@suse.de jack.morgan@intel.com julienjut@gmail.com -#-------------------------------- -# trigger macros -#-------------------------------- -- trigger: - name: 'openstack-gerrit-trigger' - triggers: - - gerrit: - server-name: 'review.openstack.org' - escape-quotes: true - trigger-on: - - patchset-created-event: - exclude-drafts: 'false' - exclude-trivial-rebase: 'false' - exclude-no-code-change: 'false' - - comment-added-contains-event: - comment-contains-value: 'recheck' - custom-url: '* $JOB_NAME $BIFROST_LOG_URL/index.html' - silent-start: true - projects: - - project-compare-type: 'PLAIN' - project-pattern: 'openstack/bifrost' - branches: - - branch-compare-type: 'ANT' - branch-pattern: '**/{branch}' - disable-strict-forbidden-file-verification: 'true' - forbidden-file-paths: - - compare-type: ANT - pattern: 'doc/**' - - compare-type: ANT - pattern: 'releasenotes/**' - disable-strict-forbidden-file-verification: 'true' - readable-message: true -- trigger: - name: 'opnfv-gerrit-trigger' - triggers: - - gerrit: - server-name: 'gerrit.opnfv.org' - 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' - custom-url: '* $JOB_NAME $BIFROST_LOG_URL/index.html' - projects: - - project-compare-type: 'ANT' - project-pattern: 'releng' - branches: - - branch-compare-type: 'ANT' - branch-pattern: '**/{branch}' - file-paths: - - compare-type: ANT - pattern: 'prototypes/bifrost/**' - readable-message: true - -#--------------------------- -# builder macros -#--------------------------- -- builder: - name: bifrost-set-name - builders: - - description-setter: - description: "Built on $NODE_NAME" - -- builder: - name: bifrost-build - builders: - - shell: - !include-raw: ./bifrost-verify.sh diff --git a/jjb/infra/bifrost-verify.sh b/jjb/infra/bifrost-verify.sh deleted file mode 100755 index 4115ffcc4..000000000 --- a/jjb/infra/bifrost-verify.sh +++ /dev/null @@ -1,134 +0,0 @@ -#!/bin/bash -# SPDX-license-identifier: Apache-2.0 -############################################################################## -# Copyright (c) 2016 Ericsson AB and others. -# All rights reserved. This program and the accompanying materials -# are made available under the terms of the Apache License, Version 2.0 -# which accompanies this distribution, and is available at -# http://www.apache.org/licenses/LICENSE-2.0 -############################################################################## -set -o errexit -set -o nounset -set -o pipefail - -trap cleanup_and_upload EXIT - -function upload_logs() { - BIFROST_CONSOLE_LOG="${BUILD_URL}/consoleText" - BIFROST_GS_URL=${BIFROST_LOG_URL/http:/gs:} - - # Make sure the old landing page is gone in case - # we break later on. We don't want to publish - # stale information. - # TODO: Maybe cleanup the entire $BIFROST_GS_URL directory - # before we upload the new data. - gsutil -q rm ${BIFROST_GS_URL}/index.html || true - - echo "Uploading collected bifrost build logs to ${BIFROST_LOG_URL}" - - if [[ -d ${WORKSPACE}/logs ]]; then - pushd ${WORKSPACE}/logs &> /dev/null - for x in *.log; do - echo "Compressing and uploading $x" - gsutil -q cp -Z ${x} ${BIFROST_GS_URL}/${x} - done - popd &> /dev/null - fi - - echo "Generating the ${BIFROST_LOG_URL}/index.html landing page" - cat > ${WORKSPACE}/index.html <<EOF -<html> -<h1>Build results for <a href=https://$GERRIT_NAME/#/c/$GERRIT_CHANGE_NUMBER/$GERRIT_PATCHSET_NUMBER>$GERRIT_NAME/$GERRIT_CHANGE_NUMBER/$GERRIT_PATCHSET_NUMBER</a></h1> -<h2>Job: <a href=${BUILD_URL}>$JOB_NAME</a></h2> -<ul> -<li><a href=${BIFROST_LOG_URL}/build_log.txt>build_log.txt</a></li> -EOF - - if [[ -d ${WORKSPACE}/logs ]]; then - pushd ${WORKSPACE}/logs &> /dev/null - for x in *.log; do - echo "<li><a href=${BIFROST_LOG_URL}/${x}>${x}</a></li>" >> ${WORKSPACE}/index.html - done - popd &> /dev/null - fi - - cat >> ${WORKSPACE}/index.html << EOF -</ul> -</html> -EOF - - # Finally, download and upload the entire build log so we can retain - # as much build information as possible - echo "Uploading the final console output" - curl -s -L ${BIFROST_CONSOLE_LOG} > ${WORKSPACE}/build_log.txt - gsutil -q cp -Z ${WORKSPACE}/build_log.txt ${BIFROST_GS_URL}/build_log.txt - rm ${WORKSPACE}/build_log.txt - - # Upload landing page - gsutil -q cp ${WORKSPACE}/index.html ${BIFROST_GS_URL}/index.html - rm ${WORKSPACE}/index.html -} - -function fix_ownership() { - if [ -z "${JOB_URL+x}" ]; then - echo "Not running as part of Jenkins. Handle the logs manually." - else - # Make sure cache exists - [[ ! -d ${HOME}/.cache ]] && mkdir ${HOME}/.cache - - sudo chown -R jenkins:jenkins $WORKSPACE - sudo chown -R jenkins:jenkins ${HOME}/.cache - fi -} - -function cleanup_and_upload() { - original_exit=$? - fix_ownership - upload_logs - exit $original_exit -} - -# check distro to see if we support it -if [[ ! "$DISTRO" =~ (trusty|centos7|suse) ]]; then - echo "Distro $DISTRO is not supported!" - exit 1 -fi - -# remove previously cloned repos -sudo /bin/rm -rf /opt/bifrost /opt/puppet-infracloud /opt/stack /opt/releng - -# Fix up permissions -fix_ownership - -# clone all the repos first and checkout the patch afterwards -sudo git clone https://git.openstack.org/openstack/bifrost /opt/bifrost -sudo git clone https://git.openstack.org/openstack-infra/puppet-infracloud /opt/puppet-infracloud -sudo git clone https://gerrit.opnfv.org/gerrit/releng /opt/releng - -# checkout the patch -cd $CLONE_LOCATION -sudo git fetch $PROJECT_REPO $GERRIT_REFSPEC && sudo git checkout FETCH_HEAD - -# combine opnfv and upstream scripts/playbooks -sudo /bin/cp -rf /opt/releng/prototypes/bifrost/* /opt/bifrost/ - -# place bridge creation file on the right path -sudo mkdir -p /opt/puppet-infracloud/files/elements/infra-cloud-bridge/static/opt -sudo cp /opt/puppet-infracloud/templates/bifrost/create_bridge.py.erb /opt/puppet-infracloud/files/elements/infra-cloud-bridge/static/opt/create_bridge.py - -# replace bridge name -sudo sed -i s/"<%= @bridge_name -%>"/br_opnfv/g /opt/puppet-infracloud/files/elements/infra-cloud-bridge/static/opt/create_bridge.py - -# cleanup remnants of previous deployment -cd /opt/bifrost -sudo -E ./scripts/destroy-env.sh - -# provision 3 VMs; jumphost, controller, and compute -cd /opt/bifrost -sudo -E ./scripts/test-bifrost-deployment.sh - -# list the provisioned VMs -cd /opt/bifrost -source env-vars -ironic node-list -virsh list |