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 (APE)
19 git clone https://gitlab.openci.io/openci/prototypes.git
20 cd prototypes/federated-cicd
21 virtualenv openci_publish
23 # shellcheck disable=SC1091
25 python setup.py install
28 cat <<EOF > ./json_body.txt
30 "type": "$PUBLISH_EVENT_TYPE",
32 "time": "$(date -u +%Y-%m-%d_%H:%M:%SUTC)",
33 "buildUrl": "$BUILD_URL",
35 "origin": "$PUBLISH_EVENT_ORIGIN",
36 "artifactLocation": "$ARTIFACT_LOCATION",
37 "confidenceLevel": "$CONFIDENCE_LEVEL"
41 echo "Constructed $PUBLISH_EVENT_TYPE"
42 echo "--------------------------------------------"
44 echo "--------------------------------------------"
46 python openci_publish -H 129.192.69.55 -U "${ACTIVEMQ_USER}" -p "${ACTIVEMQ_PASSWORD}" -n openci.prototype -B ./json_body.txt