From ad6210fbb231e7cda6b86fefd94cd677799bec9d Mon Sep 17 00:00:00 2001 From: Boris Ranto Date: Mon, 12 Dec 2016 16:06:50 +0100 Subject: [PATCH] samba: send extra information Signed-off-by: Boris Ranto --- samba/build/build_deb | 15 +++++++++++++++ samba/build/build_rpm | 15 +++++++++++++++ 2 files changed, 30 insertions(+) diff --git a/samba/build/build_deb b/samba/build/build_deb index c95629a38..62519c37c 100644 --- a/samba/build/build_deb +++ b/samba/build/build_deb @@ -50,6 +50,21 @@ chacra_endpoint="samba/${BRANCH}/${GIT_COMMIT}/${DISTRO}/${DIST}" # push binaries to chacra find *.deb | $VENV/chacractl binary ${chacra_flags} create ${chacra_endpoint}/${DEB_ARCH}/ +PACKAGE_MANAGER_VERSION=$(dpkg-deb -f $(find *"$DEB_ARCH".deb | head -1) Version) + +# write json file with build info +cat > $WORKSPACE/repo-extra.json << EOF +{ + "version":"$VERSION", + "package_manager_version":"$PACKAGE_MANAGER_VERSION", + "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}repos/${chacra_endpoint}/extra/ # start repo creation $VENV/chacractl repo update ${chacra_endpoint} diff --git a/samba/build/build_rpm b/samba/build/build_rpm index 44e1c73b0..780a8945c 100644 --- a/samba/build/build_rpm +++ b/samba/build/build_rpm @@ -50,6 +50,21 @@ chacra_endpoint="samba/${BRANCH}/${GIT_COMMIT}/${DISTRO}/${RELEASE}" # push binaries to chacra find *.rpm | $VENV/chacractl binary ${chacra_flags} create ${chacra_endpoint}/$ARCH/ +PACKAGE_MANAGER_VERSION=$(rpm --queryformat '%{VERSION}-%{RELEASE}\n' -qp $(find *.rpm | egrep "\.$ARCH\.rpm" | head -1)) + +# write json file with build info +cat > $WORKSPACE/repo-extra.json << EOF +{ + "version":"$VERSION", + "package_manager_version":"$PACKAGE_MANAGER_VERSION", + "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}repos/${chacra_endpoint}/extra/ # start repo creation $VENV/chacractl repo update ${chacra_endpoint} -- 2.47.3