From 8dac489e9c4f321acc6a71f8a713f12a6fac2efa Mon Sep 17 00:00:00 2001 From: Yolanda Robla Date: Wed, 19 Sep 2018 10:19:19 +0200 Subject: Use publisher in OPNFV compose daily jobs Change-Id: I2341191b9afbf7b572a6ae28a50eb722b66109c7 Signed-off-by: Yolanda Robla --- jjb/openci/create-cde.sh | 33 +++++++++++++++++++++++++-------- jjb/openci/openci-opnfv-daily-jobs.yaml | 25 ++++++++----------------- 2 files changed, 33 insertions(+), 25 deletions(-) (limited to 'jjb') diff --git a/jjb/openci/create-cde.sh b/jjb/openci/create-cde.sh index 410db50e6..b4b273a32 100755 --- a/jjb/openci/create-cde.sh +++ b/jjb/openci/create-cde.sh @@ -12,16 +12,33 @@ set -o nounset set -o pipefail # This script creates CompositionDefinedEvent -# The JMS Messaging Plugin doesn't handle the newlines well so the eventBody is -# constructed on a single line. This is something that needs to be fixed properly -cat << EOF > $WORKSPACE/event.properties -type=$PUBLISH_EVENT_TYPE -origin=$PUBLISH_EVENT_ORIGIN -scenario=$DEPLOY_SCENARIO -eventBody="{ 'type': '$PUBLISH_EVENT_TYPE', 'id': '$(uuidgen)', 'time': '$(date -u +%Y-%m-%d_%H:%M:%SUTC)', 'origin': '$PUBLISH_EVENT_ORIGIN', 'buildUrl': '$BUILD_URL', 'branch': 'master', 'compositionName': '$DEPLOY_SCENARIO', 'compositionMetadataUrl': '$SCENARIO_METADATA_LOCATION' }" +git clone https://gitlab.openci.io/openci/prototypes.git +cd prototypes/federated-cicd +virtualenv openci_publish +cd openci_publish +source bin/activate +python setup.py install + +# generate event body +cat < ./json_body.txt +{ + "type": "$PUBLISH_EVENT_TYPE", + "id": "$(uuidgen)", + "time": "$(date -u +%Y-%m-%d_%H:%M:%SUTC)", + "buildUrl": "$BUILD_URL", + "branch": "master", + "origin": "$PUBLISH_EVENT_ORIGIN", + "compositionName": "$DEPLOY_SCENARIO", + "compositionMetadataUrl": "$SCENARIO_METADATA_LOCATION" +} EOF + +openci_publish -H 129.192.69.55 -U ${ACTIVEMQ_USER} -p ${ACTIVEMQ_PASSWORD} -n openci.prototype -B ./json_body.txt + echo "Constructed $PUBLISH_EVENT_TYPE" echo "--------------------------------------------" -cat $WORKSPACE/event.properties +cat ./json_body.txt echo "--------------------------------------------" + +deactivate diff --git a/jjb/openci/openci-opnfv-daily-jobs.yaml b/jjb/openci/openci-opnfv-daily-jobs.yaml index cb150148b..3cacee65d 100644 --- a/jjb/openci/openci-opnfv-daily-jobs.yaml +++ b/jjb/openci/openci-opnfv-daily-jobs.yaml @@ -46,15 +46,17 @@ description: 'The location of the scenario metadata' - 'opnfv-build-defaults' + wrappers: + - credentials-binding: + - username-password-separated: + credential-id: openci-connect-activemq + username: ACTIVEMQ_USER + password: ACTIVEMQ_PASSWORD + triggers: - jms-messaging: provider-name: openci.activemq - selector: CI_TYPE = 'custom' - checks: - - field: origin - expected-value: '{origin}' - - field: type - expected-value: 'ArtifactPublishedEvent' + selector: JMSType = 'ArtifactPublishedEvent' and JMSOrigin = 'ODL' builders: - shell: | @@ -70,17 +72,6 @@ - inject: properties-file: "$WORKSPACE/event.properties" - publishers: - - jms-messaging: - provider-name: openci.activemq - msg-type: Custom - msg-props: | - type=$type - origin=$origin - scenario=$scenario - msg-content: - $eventBody - - job-template: name: 'openci-opnfv-{scenario}-test-daily-{stream}' -- cgit 1.2.3-korg