2 # SPDX-license-identifier: Apache-2.0
3 ##############################################################################
4 # Copyright (c) 2018 Ericsson AB and others.
5 # All rights reserved. This program and the accompanying materials
6 # are made available under the terms of the Apache License, Version 2.0
7 # which accompanies this distribution, and is available at
8 # http://www.apache.org/licenses/LICENSE-2.0
9 ##############################################################################
14 # workaround for https://github.com/pypa/virtualenv/issues/1029
17 # This script creates ArtifactPublishedEvent
19 git clone https://gitlab.openci.io/openci/prototypes.git
20 cd prototypes/federated-cicd
21 virtualenv openci_publish
24 python setup.py install
27 cat <<EOF > ./json_body.txt
29 "type": "$PUBLISH_EVENT_TYPE",
31 "time": "$(date -u +%Y-%m-%d_%H:%M:%SUTC)",
32 "buildUrl": "$BUILD_URL",
34 "origin": "$PUBLISH_EVENT_ORIGIN",
35 "artifactLocation": "$ARTIFACT_LOCATION",
36 "confidenceLevel": "$CONFIDENCE_LEVEL"
40 echo "Constructed $PUBLISH_EVENT_TYPE"
41 echo "--------------------------------------------"
43 echo "--------------------------------------------"
45 python openci_publish -H 129.192.69.55 -U ${ACTIVEMQ_USER} -p ${ACTIVEMQ_PASSWORD} -n openci.prototype -B ./json_body.txt