diff options
Diffstat (limited to 'jjb')
-rw-r--r-- | jjb/ci_gate_security/anteater-report-to-gerrit.sh | 13 | ||||
-rwxr-xr-x | jjb/daisy4nfv/daisy4nfv-build.sh | 2 | ||||
-rwxr-xr-x | jjb/daisy4nfv/daisy4nfv-upload-artifact.sh | 4 | ||||
-rw-r--r-- | jjb/octopus/octopus.yml | 77 | ||||
-rw-r--r-- | jjb/releng/automate.yml | 4 | ||||
-rw-r--r-- | jjb/releng/htmlize/doc-build.sh | 21 | ||||
-rw-r--r-- | jjb/releng/htmlize/htmlize.py | 57 | ||||
-rw-r--r-- | jjb/releng/htmlize/push-doc-artifact.sh | 27 | ||||
-rw-r--r-- | jjb/storperf/storperf-daily-jobs.yml | 3 |
9 files changed, 161 insertions, 47 deletions
diff --git a/jjb/ci_gate_security/anteater-report-to-gerrit.sh b/jjb/ci_gate_security/anteater-report-to-gerrit.sh index de1fdd745..6710862a7 100644 --- a/jjb/ci_gate_security/anteater-report-to-gerrit.sh +++ b/jjb/ci_gate_security/anteater-report-to-gerrit.sh @@ -15,11 +15,14 @@ if [[ -e securityaudit.log ]] ; then grep 'ERROR' securityaudit.log | awk -F"ERROR - " '{ print $2 }' | tr -d "\'\"" > shortlog - ssh -p 29418 gerrit.opnfv.org \ - "gerrit review -p $GERRIT_PROJECT \ - -m \"$(cat shortlog)\" \ - $GERRIT_PATCHSET_REVISION \ - --notify NONE" + # Only report to Gerrit when there are errors to report. + if [[ -s shortlog ]]; then + ssh -p 29418 gerrit.opnfv.org \ + "gerrit review -p $GERRIT_PROJECT \ + -m \"$(cat shortlog)\" \ + $GERRIT_PATCHSET_REVISION \ + --notify NONE" + fi exit $EXITSTATUS fi diff --git a/jjb/daisy4nfv/daisy4nfv-build.sh b/jjb/daisy4nfv/daisy4nfv-build.sh index 925f68e18..a081b3bc6 100755 --- a/jjb/daisy4nfv/daisy4nfv-build.sh +++ b/jjb/daisy4nfv/daisy4nfv-build.sh @@ -31,6 +31,8 @@ cd $WORKSPACE echo "OPNFV_GIT_SHA1=$(git rev-parse HEAD)" echo "OPNFV_ARTIFACT_URL=$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.bin" echo "OPNFV_ARTIFACT_SHA512SUM=$(sha512sum $OUTPUT_DIR/opnfv-$OPNFV_ARTIFACT_VERSION.bin | cut -d' ' -f1)" + echo "OPNFV_ARTIFACT_URL_ISO=$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.iso" + echo "OPNFV_ARTIFACT_SHA512SUM_ISO=$(sha512sum $OUTPUT_DIR/opnfv-$OPNFV_ARTIFACT_VERSION.iso | cut -d' ' -f1)" echo "OPNFV_BUILD_URL=$BUILD_URL" ) > $WORKSPACE/opnfv.properties diff --git a/jjb/daisy4nfv/daisy4nfv-upload-artifact.sh b/jjb/daisy4nfv/daisy4nfv-upload-artifact.sh index 6b0aec54f..27bb8de23 100755 --- a/jjb/daisy4nfv/daisy4nfv-upload-artifact.sh +++ b/jjb/daisy4nfv/daisy4nfv-upload-artifact.sh @@ -50,13 +50,15 @@ cd $WORKSPACE # upload artifact and additional files to google storage gsutil cp $BUILD_DIRECTORY/opnfv-$OPNFV_ARTIFACT_VERSION.bin \ gs://$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.bin > gsutil.bin.log 2>&1 +gsutil cp $BUILD_DIRECTORY/opnfv-$OPNFV_ARTIFACT_VERSION.iso \ + gs://$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.bin >> gsutil.bin.log 2>&1 gsutil cp $WORKSPACE/opnfv.properties \ gs://$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.properties > gsutil.properties.log 2>&1 if [[ ! "$JOB_NAME" =~ (verify|merge) ]]; then gsutil cp $WORKSPACE/opnfv.properties \ gs://$GS_URL/latest.properties > gsutil.latest.log 2>&1 elif [[ "$JOB_NAME" =~ "merge" ]]; then - echo "Uploaded Daisy4nfv BIN for a merged change" + echo "Uploaded Daisy4nfv artifacts for a merged change" fi gsutil -m setmeta \ diff --git a/jjb/octopus/octopus.yml b/jjb/octopus/octopus.yml index f51db1bc1..fb6263d81 100644 --- a/jjb/octopus/octopus.yml +++ b/jjb/octopus/octopus.yml @@ -1,3 +1,4 @@ +--- ################################ # job configuration for Octopus ################################ @@ -7,17 +8,17 @@ project: '{name}' jobs: - - 'octopus-verify-{stream}' + - 'octopus-verify-{stream}' stream: - - master: - branch: '{stream}' - gs-pathname: '' - disabled: false - - euphrates: - branch: 'stable/{stream}' - gs-pathname: '/{stream}' - disabled: false + - master: + branch: '{stream}' + gs-pathname: '' + disabled: false + - euphrates: + branch: 'stable/{stream}' + gs-pathname: '/{stream}' + disabled: false - job-template: name: 'octopus-verify-{stream}' @@ -25,38 +26,38 @@ disabled: '{obj:disabled}' parameters: - - project-parameter: - project: '{project}' - branch: '{branch}' - - 'opnfv-build-ubuntu-defaults' + - project-parameter: + project: '{project}' + branch: '{branch}' + - 'opnfv-build-ubuntu-defaults' scm: - - git-scm-gerrit + - git-scm-gerrit 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' - projects: - - project-compare-type: 'ANT' - project-pattern: '{project}' - branches: - - branch-compare-type: 'ANT' - branch-pattern: '**/{branch}' - disable-strict-forbidden-file-verification: 'true' - forbidden-file-paths: - - compare-type: ANT - pattern: 'docs/**|.gitignore' + - 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' + projects: + - project-compare-type: 'ANT' + project-pattern: '{project}' + branches: + - branch-compare-type: 'ANT' + branch-pattern: '**/{branch}' + disable-strict-forbidden-file-verification: 'true' + forbidden-file-paths: + - compare-type: ANT + pattern: 'docs/**|.gitignore' builders: - - shell: | - echo "Nothing to verify!" + - shell: | + echo "Nothing to verify!" diff --git a/jjb/releng/automate.yml b/jjb/releng/automate.yml index c7e34b20c..de7fcd6c0 100644 --- a/jjb/releng/automate.yml +++ b/jjb/releng/automate.yml @@ -221,13 +221,13 @@ name: 'testapi-doc-build' builders: - shell: | - bash ./utils/test/testapi/htmlize/doc-build.sh + bash ./jjb/releng/htmlize/doc-build.sh - builder: name: 'upload-doc-artifact' builders: - shell: | - bash ./utils/test/testapi/htmlize/push-doc-artifact.sh + bash ./jjb/releng/htmlize/push-doc-artifact.sh - builder: name: 'reporting-automate-generate-doc-macro' diff --git a/jjb/releng/htmlize/doc-build.sh b/jjb/releng/htmlize/doc-build.sh new file mode 100644 index 000000000..33560ceea --- /dev/null +++ b/jjb/releng/htmlize/doc-build.sh @@ -0,0 +1,21 @@ +#!/bin/bash + +set -o errexit + +# Create virtual environment +virtualenv $WORKSPACE/testapi_venv +source $WORKSPACE/testapi_venv/bin/activate + +# Swgger Codegen Tool +url="http://repo1.maven.org/maven2/io/swagger/swagger-codegen-cli/2.2.1/swagger-codegen-cli-2.2.1.jar" + +# Check for jar file locally and in the repo +if [ ! -f swagger-codegen-cli.jar ]; +then + wget http://repo1.maven.org/maven2/io/swagger/swagger-codegen-cli/2.2.1/swagger-codegen-cli-2.2.1.jar -O swagger-codegen-cli.jar +fi + +# Install Pre-requistics +pip install requests + +python ./utils/test/testapi/htmlize/htmlize.py -o ${WORKSPACE}/ diff --git a/jjb/releng/htmlize/htmlize.py b/jjb/releng/htmlize/htmlize.py new file mode 100644 index 000000000..da6a6cf91 --- /dev/null +++ b/jjb/releng/htmlize/htmlize.py @@ -0,0 +1,57 @@ +#!/usr/bin/env python + +# 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 + +import argparse +import requests +import json +import os + + +def main(args): + + # Merging two specs + api_response = requests.get(args.api_declaration_url) + api_response = json.loads(api_response.content) + resource_response = requests.get(args.resource_listing_url) + resource_response = json.loads(resource_response.content) + resource_response['models'] = api_response['models'] + resource_response['apis'] = api_response['apis'] + + # Storing the swagger specs + with open('specs.json', 'w') as outfile: + json.dump(resource_response, outfile) + + # Generating html page + cmd = 'java -jar swagger-codegen-cli.jar generate \ + -i specs.json -l html2 -o %s' % (args.output_directory) + if os.system(cmd) == 0: + exit(0) + else: + exit(1) + + +if __name__ == '__main__': + parser = argparse.ArgumentParser(description='Create \ + Swagger Spec documentation') + parser.add_argument('-ru', '--resource-listing-url', + type=str, + required=False, + default=('http://testresults.opnfv.org' + '/test/swagger/resources.json'), + help='Resource Listing Spec File') + parser.add_argument('-au', '--api-declaration-url', + type=str, + required=False, + default=('http://testresults.opnfv.org' + '/test/swagger/APIs'), + help='API Declaration Spec File') + parser.add_argument('-o', '--output-directory', + required=True, + default='./', + help='Output Directory where the \ + file should be stored') + main(parser.parse_args()) diff --git a/jjb/releng/htmlize/push-doc-artifact.sh b/jjb/releng/htmlize/push-doc-artifact.sh new file mode 100644 index 000000000..4cf1988b0 --- /dev/null +++ b/jjb/releng/htmlize/push-doc-artifact.sh @@ -0,0 +1,27 @@ +#!/bin/bash + +set -e +set -o pipefail + +export PATH=$PATH:/usr/local/bin/ + +project=$PROJECT +workspace=$WORKSPACE +artifact_dir="$project/docs" + +set +e +gsutil&>/dev/null +if [ $? != 0 ]; then + echo "Not possible to push results to artifact: gsutil not installed" + exit 1 +else + gsutil ls gs://artifacts.opnfv.org/"$project"/ &>/dev/null + if [ $? != 0 ]; then + echo "Not possible to push results to artifact: gsutil not installed." + exit 1 + else + echo "Uploading document to artifact $artifact_dir" + gsutil cp "$workspace"/index.html gs://artifacts.opnfv.org/"$artifact_dir"/testapi.html >/dev/null 2>&1 + echo "Document can be found at http://artifacts.opnfv.org/releng/docs/testapi.html" + fi +fi diff --git a/jjb/storperf/storperf-daily-jobs.yml b/jjb/storperf/storperf-daily-jobs.yml index ebc78237e..3c9e527be 100644 --- a/jjb/storperf/storperf-daily-jobs.yml +++ b/jjb/storperf/storperf-daily-jobs.yml @@ -111,8 +111,9 @@ - build-name: name: '$BUILD_NUMBER Scenario: $DEPLOY_SCENARIO' - timeout: - timeout: '30' + timeout: '45' abort: true + - fix-workspace-permissions parameters: - project-parameter: |