diff options
Diffstat (limited to 'jjb/openci')
-rwxr-xr-x | jjb/openci/create-ane.sh | 26 | ||||
-rwxr-xr-x | jjb/openci/create-ape.sh | 47 | ||||
-rwxr-xr-x | jjb/openci/create-cde.sh | 36 | ||||
-rwxr-xr-x | jjb/openci/create-clme.sh | 37 | ||||
-rw-r--r-- | jjb/openci/openci-odl-daily-jobs.yaml | 24 | ||||
-rw-r--r-- | jjb/openci/openci-onap-daily-jobs.yaml | 24 | ||||
-rw-r--r-- | jjb/openci/openci-opnfv-daily-jobs.yaml | 66 |
7 files changed, 134 insertions, 126 deletions
diff --git a/jjb/openci/create-ane.sh b/jjb/openci/create-ane.sh deleted file mode 100755 index 8a4da8f52..000000000 --- a/jjb/openci/create-ane.sh +++ /dev/null @@ -1,26 +0,0 @@ -#!/bin/bash -# SPDX-license-identifier: Apache-2.0 -############################################################################## -# Copyright (c) 2018 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 - -# This script creates ArtifactPublishedEvent -# 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 -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', 'artifactLocation': '$ARTIFACT_LOCATION', 'confidenceLevel': { $CONFIDENCE_LEVEL } }" -EOF -echo "Constructed $PUBLISH_EVENT_TYPE" -echo "--------------------------------------------" -cat $WORKSPACE/event.properties -echo "--------------------------------------------" diff --git a/jjb/openci/create-ape.sh b/jjb/openci/create-ape.sh new file mode 100755 index 000000000..7c9b46cc6 --- /dev/null +++ b/jjb/openci/create-ape.sh @@ -0,0 +1,47 @@ +#!/bin/bash +# SPDX-license-identifier: Apache-2.0 +############################################################################## +# Copyright (c) 2018 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 + +# workaround for https://github.com/pypa/virtualenv/issues/1029 +export PS1=${PS1:-} + +# This script creates ArtifactPublishedEvent + +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 <<EOF > ./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", + "artifactLocation": "$ARTIFACT_LOCATION", + "confidenceLevel": "$CONFIDENCE_LEVEL" +} +EOF + +echo "Constructed $PUBLISH_EVENT_TYPE" +echo "--------------------------------------------" +cat ./json_body.txt +echo "--------------------------------------------" + +python openci_publish -H 129.192.69.55 -U ${ACTIVEMQ_USER} -p ${ACTIVEMQ_PASSWORD} -n openci.prototype -B ./json_body.txt + +deactivate diff --git a/jjb/openci/create-cde.sh b/jjb/openci/create-cde.sh index 410db50e6..9780119ce 100755 --- a/jjb/openci/create-cde.sh +++ b/jjb/openci/create-cde.sh @@ -11,17 +11,37 @@ set -o errexit set -o nounset set -o pipefail +export PS1=${PS1:-} + # 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 <<EOF > ./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", + "scenario": "$DEPLOY_SCENARIO", + "compositionName": "$DEPLOY_SCENARIO", + "compositionMetadataUrl": "$SCENARIO_METADATA_LOCATION" +} EOF + echo "Constructed $PUBLISH_EVENT_TYPE" echo "--------------------------------------------" -cat $WORKSPACE/event.properties +cat ./json_body.txt echo "--------------------------------------------" + +python openci_publish -H 129.192.69.55 -U ${ACTIVEMQ_USER} -p ${ACTIVEMQ_PASSWORD} -n openci.prototype -B ./json_body.txt + +deactivate diff --git a/jjb/openci/create-clme.sh b/jjb/openci/create-clme.sh index 5e8ee10c9..2ece019b0 100755 --- a/jjb/openci/create-clme.sh +++ b/jjb/openci/create-clme.sh @@ -11,17 +11,38 @@ set -o errexit set -o nounset set -o pipefail +export PS1=${PS1:-} + # This script creates ConfidenceLevelModifiedEvent -# 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', 'confidenceLevel': { $CONFIDENCE_LEVEL } }" +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 <<EOF > ./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", + "scenario": "$DEPLOY_SCENARIO", + "compositionName": "$DEPLOY_SCENARIO", + "compositionMetadataUrl": "$SCENARIO_METADATA_LOCATION", + "confidenceLevel": "$CONFIDENCE_LEVEL" +} EOF + echo "Constructed $PUBLISH_EVENT_TYPE" echo "--------------------------------------------" -cat $WORKSPACE/event.properties +cat ./json_body.txt echo "--------------------------------------------" + +python openci_publish -H 129.192.69.55 -U ${ACTIVEMQ_USER} -p ${ACTIVEMQ_PASSWORD} -n openci.prototype -B ./json_body.txt + +deactivate diff --git a/jjb/openci/openci-odl-daily-jobs.yaml b/jjb/openci/openci-odl-daily-jobs.yaml index d80feadf6..bdaca5742 100644 --- a/jjb/openci/openci-odl-daily-jobs.yaml +++ b/jjb/openci/openci-odl-daily-jobs.yaml @@ -46,19 +46,7 @@ builders: - shell: - !include-raw-escape: ./create-ane.sh - - inject: - properties-file: "$WORKSPACE/event.properties" - - publishers: - - jms-messaging: - provider-name: openci.activemq - msg-type: Custom - msg-props: | - type=$type - origin=$origin - msg-content: - $eventBody + !include-raw-escape: ./create-ape.sh # This job gets triggered by a ConfidenceLevelModifiedEvent published # by OPNFV jobs so ODL can promote the autorelease artifact even further. @@ -78,14 +66,8 @@ triggers: - jms-messaging: provider-name: openci.activemq - selector: CI_TYPE = 'custom' - checks: - - field: origin - expected-value: 'OPNFV' - - field: type - expected-value: 'ConfidenceLevelModifiedEvent' - - field: scenario - expected-value: 'os-odl-nofeature' + selector: | + JMSType = 'ConfidenceLevelModifiedEvent' and JMSOrigin = 'OPNFV' and JMSScenario = 'os-odl-nofeature-ha' builders: - shell: | diff --git a/jjb/openci/openci-onap-daily-jobs.yaml b/jjb/openci/openci-onap-daily-jobs.yaml index 28c3e6948..88589d8ac 100644 --- a/jjb/openci/openci-onap-daily-jobs.yaml +++ b/jjb/openci/openci-onap-daily-jobs.yaml @@ -46,19 +46,7 @@ builders: - shell: - !include-raw-escape: ./create-ane.sh - - inject: - properties-file: "$WORKSPACE/event.properties" - - publishers: - - jms-messaging: - provider-name: openci.activemq - msg-type: Custom - msg-props: | - type=$type - origin=$origin - msg-content: - $eventBody + !include-raw-escape: ./create-ape.sh # This job gets triggered by a ConfidenceLevelModifiedEvent published # by OPNFV jobs so ONAP can promote the autorelease artifact even further. @@ -78,14 +66,8 @@ triggers: - jms-messaging: provider-name: openci.activemq - selector: CI_TYPE = 'custom' - checks: - - field: origin - expected-value: 'OPNFV' - - field: type - expected-value: 'ConfidenceLevelModifiedEvent' - - field: scenario - expected-value: 'k8-nosdn-onap' + selector: | + JMSType = 'ConfidenceLevelModifiedEvent' and JMSOrigin = 'OPNFV' and JMSScenario = 'k8-nosdn-onap-ha' builders: - shell: | diff --git a/jjb/openci/openci-opnfv-daily-jobs.yaml b/jjb/openci/openci-opnfv-daily-jobs.yaml index cb150148b..afa8effea 100644 --- a/jjb/openci/openci-opnfv-daily-jobs.yaml +++ b/jjb/openci/openci-opnfv-daily-jobs.yaml @@ -44,17 +44,22 @@ name: SCENARIO_METADATA_LOCATION default: https://url/to/scenario/metadata/on/opnfv/artifact/repo/$BUILD_NUMBER description: 'The location of the scenario metadata' - - 'opnfv-build-defaults' + - label: + name: SLAVE_LABEL + default: 'xci-virtual' + + wrappers: + - credentials-binding: + - username-password-separated: + credential-id: openci-connect-activemq + username: ACTIVEMQ_USER + password: ACTIVEMQ_PASSWORD + - workspace-cleanup 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 = '{origin}' builders: - shell: | @@ -67,19 +72,6 @@ echo "----------------------------------" - shell: !include-raw-escape: ./create-cde.sh - - 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}' @@ -109,19 +101,22 @@ name: CONFIDENCE_LEVEL default: "'opnfvdaily': 'SUCCESS'" description: 'The confidence level the published artifact gained' - - 'opnfv-build-defaults' + - label: + name: SLAVE_LABEL + default: 'xci-virtual' + + wrappers: + - credentials-binding: + - username-password-separated: + credential-id: openci-connect-activemq + username: ACTIVEMQ_USER + password: ACTIVEMQ_PASSWORD + - workspace-cleanup triggers: - jms-messaging: provider-name: openci.activemq - selector: CI_TYPE = 'custom' - checks: - - field: origin - expected-value: 'OPNFV' - - field: type - expected-value: 'CompositionDefinedEvent' - - field: scenario - expected-value: '{scenario}' + selector: JMSType = 'CompositionDefinedEvent' and JMSOrigin = 'OPNFV' and JMSScenario = '{scenario}' builders: - shell: | @@ -134,16 +129,3 @@ echo "----------------------------------" - shell: !include-raw-escape: ./create-clme.sh - - 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 |