summaryrefslogtreecommitdiffstats
path: root/jjb/openci/create-cde.sh
diff options
context:
space:
mode:
authorFatih Degirmenci <fdegir@gmail.com>2018-09-20 07:15:10 +0000
committerGerrit Code Review <gerrit@opnfv.org>2018-09-20 07:15:10 +0000
commit9a621621a31c4278b09b715eacd815580a85b8aa (patch)
treefee65bc475bc673058ec7f6c642d066f8fedb060 /jjb/openci/create-cde.sh
parent1759320eed7258d6926380a63c74b5a7d5a6d377 (diff)
parent8dac489e9c4f321acc6a71f8a713f12a6fac2efa (diff)
Merge "Use publisher in OPNFV compose daily jobs"
Diffstat (limited to 'jjb/openci/create-cde.sh')
-rwxr-xr-xjjb/openci/create-cde.sh33
1 files changed, 25 insertions, 8 deletions
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 <<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",
+ "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