From 4ff7399fd66525743b3cfd7e3e46d8efc13f0ed5 Mon Sep 17 00:00:00 2001 From: Trevor Bramwell Date: Fri, 4 Mar 2016 11:04:55 -0800 Subject: Create Releng Job for Generating Artifact JSON API 'opnfv.org/artifacts' uses the index.json file generated by the opnfv-artifacts.py script to list artifacts generated by other OPNFV builds. This adds a Jenkins 'cronjob' for generating and uploading a JSON file to Google Storage containing links to the artifacts and their metadata. Change-Id: I3c40391b40e1e536d4c27e27d5621bf4bc4c00a3 Signed-off-by: Trevor Bramwell --- jjb/releng-jobs.yaml | 17 +++++++++++++++++ jjb/releng-macros.yaml | 22 ++++++++++++++++++++++ 2 files changed, 39 insertions(+) (limited to 'jjb') diff --git a/jjb/releng-jobs.yaml b/jjb/releng-jobs.yaml index 0b36f0775..655660bb9 100644 --- a/jjb/releng-jobs.yaml +++ b/jjb/releng-jobs.yaml @@ -3,6 +3,7 @@ jobs: - 'builder-verify-jjb' - 'builder-merge' + - 'artifacts-api' project: 'releng' @@ -99,3 +100,19 @@ git pull jenkins-jobs update --delete-old jjb/ +- job-template: + name: 'artifacts-api' + + # Generate and upload the JSON file to used for artifacts site + + parameters: + - project-parameter: + project: '{project}' + - gerrit-parameter: + branch: 'master' + + triggers: + - timed: '@hourly' + + builders: + - build-and-upload-artifacts-json-api diff --git a/jjb/releng-macros.yaml b/jjb/releng-macros.yaml index b43a76d5f..625e10a4d 100644 --- a/jjb/releng-macros.yaml +++ b/jjb/releng-macros.yaml @@ -298,6 +298,28 @@ gsutil -m rm -r "gs://$gs_path" fi +- builder: + name: build-and-upload-artifacts-json-api + builders: + - shell: | + #!/bin/bash + set -o errexit + set -o pipefail + + echo "Generating Artifacts API ..." + virtualenv $WORKSPACE/releng_artifacts + source $WORKSPACE/releng_artifacts/bin/activate + + # install python packages + easy_install -U setuptools + pip install google-api-python-client + + # generate and upload index file + python ./releng/utils/opnfv-artifacts.py > index.json + gsutil cp index.json gs://artifacts.opnfv.org/index.json + + deactivate + - builder: name: upload-review-docs builders: -- cgit 1.2.3-korg