]> git.apps.os.sepia.ceph.com Git - ceph-build.git/commitdiff
ceph-dev-build: post repo build info to chacra 445/head
authorAndrew Schoen <aschoen@redhat.com>
Mon, 29 Aug 2016 19:51:54 +0000 (14:51 -0500)
committerAndrew Schoen <aschoen@redhat.com>
Tue, 30 Aug 2016 14:13:23 +0000 (09:13 -0500)
Signed-off-by: Andrew Schoen <aschoen@redhat.com>
ceph-dev-build/build/build_deb
ceph-dev-build/build/build_rpm

index ccaa2d86e35aff67973a591e493bcf5382e3451d..3234d11e8e70afd929a83ae5bcf1a03925217e47 100644 (file)
@@ -185,6 +185,18 @@ echo lintian --allow-root $releasedir/$cephver/*$bpvers*.deb
 if [ "$THROWAWAY" = false ] ; then
     # push binaries to chacra
     find release/$vers/ | egrep "*\.(changes|deb|dsc|gz)$" | egrep -v "(Packages|Sources|Contents)" | $VENV/chacractl binary ${chacra_flags} create ${chacra_endpoint}
+    # write json file with build info
+    cat > $WORKSPACE/repo-extra.json << EOF
+{
+    "version":"$vers",
+    "build_url":"$BUILD_URL",
+    "root_build_cause":"$ROOT_BUILD_CAUSE",
+    "node_name":"$NODE_NAME",
+    "job_name":"$JOB_NAME",
+}
+EOF
+    # post the json to repo-extra json to chacra
+    curl -X POST -H "Content-Type:application/json" --data "@$WORKSPACE/repo-extra.json" -u $CHACRACTL_USER:$CHACRACTL_KEY ${chacra_url}${chacra_repo_endpoint}/extra/
     # start repo creation
     $VENV/chacractl repo update ${chacra_repo_endpoint}
 
index b7dea9ed095e651d16473b8c3870c8d1c8c02151..325bdad1cfdbe1f05e9ba2ca943b3cda61679156 100644 (file)
@@ -225,8 +225,21 @@ if [ "$THROWAWAY" = false ] ; then
     # push binaries to chacra
     find release/${vers}/rpm/*/SRPMS | grep rpm | $VENV/chacractl binary ${chacra_flags} create ${chacra_endpoint}/source/flavors/${FLAVOR}
     find release/${vers}/rpm/*/RPMS/* | grep rpm | $VENV/chacractl binary ${chacra_flags} create ${chacra_endpoint}/${ARCH}/flavors/${FLAVOR}
+    # write json file with build info
+    cat > $WORKSPACE/repo-extra.json << EOF
+{
+    "version":"$vers",
+    "build_url":"$BUILD_URL",
+    "root_build_cause":"$ROOT_BUILD_CAUSE",
+    "node_name":"$NODE_NAME",
+    "job_name":"$JOB_NAME",
+}
+EOF
+    chacra_repo_endpoint="${chacra_endpoint}/flavors/${FLAVOR}"
+    # post the json to repo-extra json to chacra
+    curl -X POST -H "Content-Type:application/json" --data "@$WORKSPACE/repo-extra.json" -u $CHACRACTL_USER:$CHACRACTL_KEY ${chacra_url}${chacra_repo_endpoint}/extra/
     # start repo creation
-    $VENV/chacractl repo update ${chacra_endpoint}/flavors/${FLAVOR}
+    $VENV/chacractl repo update ${chacra_repo_endpoint}
 
     echo Check the status of the repo at: https://shaman.ceph.com/api/repos/${chacra_endpoint}/flavors/${FLAVOR}/
 fi