-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbintray-upload.sh
executable file
·34 lines (29 loc) · 1.12 KB
/
bintray-upload.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#!/bin/bash
set -e -o pipefail
BINTRAY_REPO="jacobvwrepo/libtrace-bigdata"
BINTRAY_LICENSE="LGPL-3.0"
apt-get update && apt-get install -y curl
curl --silent -fL -XGET \
"https://api.bintray.com/content/jfrog/jfrog-cli-go/\$latest/jfrog-cli-linux-amd64/jfrog?bt_package=jfrog-cli-linux-amd64" \
> /usr/local/bin/jfrog
chmod +x /usr/local/bin/jfrog
mkdir ~/.jfrog/
cat << EOF > ~/.jfrog/jfrog-cli.conf
{
"artifactory": null,
"bintray": {
"user": "${BINTRAY_USERNAME}",
"key": "${BINTRAY_API_KEY}"
},
"Version": "1"
}
EOF
for path in `find built-packages/ -maxdepth 1 -type d`; do
IFS=_ read linux_version <<< $(basename "${path}")
for deb in `find "${path}" -maxdepth 1 -type f`; do
pkg_filename=$(basename "${deb}")
IFS=_ read pkg_name pkg_version pkg_arch <<< $(basename -s ".deb" "${pkg_filename}")
jfrog bt package-create --licenses ${BINTRAY_LICENSE} --vcs-url ${CI_PROJECT_URL} ${BINTRAY_REPO}/${pkg_name} || true
jfrog bt upload --deb ${linux_version}/main/${pkg_arch} ${deb} ${BINTRAY_REPO}/${pkg_name}/${pkg_version} pool/${linux_version}/main/${pkg_name}/
done
done