4 DISTROS="jessie stretch"
6 BASE_URL="https://artifactory.foobar/artifactory"
8 REPO_URL="${BASE_URL}/${REPO}"
14 This script will upload your Debian package to artifactory and rebuild
21 function build_dist_list {
23 for x in ${DISTROS}; do
24 debdist="${debdist}deb.distribution=${x};"
29 if [ -z "${1}" ]; then
30 echo "ERROR: no deb package provided"
35 ARCH="$(dpkg -I ${PKG} | grep Architecture | cut -d' ' -f 3)"
36 SHA="$(sha256sum ${PKG} | cut -d' ' -f 1)"
37 DIST="$(build_dist_list)"
39 echo "PKGNAME: ${PKG}"
42 echo "ARCHITECTURE: ${ARCH}"
45 curl -s "${REPO_URL}/${PKG};${DIST}deb.component=${COMPONENT};deb.architecture=${ARCH}" -T ${PKG} -H"X-Checksum-Sha256:${SHA}" -H"X-JFrog-Art-Api:${APIKEY}"
48 if [ "$ret" != "0" ]; then
49 echo "ERROR: Uploading your package ${pkg} to ${REPO_URL} failed - aborting"
55 curl -s -X POST "${BASE_URL}/api/deb/reindex/${REPO}" -H"X-JFrog-Art-Api:${APIKEY}"
58 if [ "$ret" != "0" ]; then
59 echo "ERROR: Rebuild package index for ${REPO} failed - aborting"