summaryrefslogtreecommitdiffstats
path: root/jjb/scripts/packagecloud_promote.sh
blob: 8523e6cf0537dc5e943e4218d20232279bc9ae86 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#!/bin/bash

stage_repo="https://packagecloud.io/api/v1/repos/fdio/staging"
curl --netrc-file /home/jenkins/packagecloud_api $stage_repo/packages.json | \
    python -mjson.tool >filenames.txt
grep 'promote_url' filenames.txt > packages.txt
sed -i 's|[",:]||g' packages.txt
sed -i 's/promote_url//g' packages.txt

while read packages; do
echo $packages
curl --netrc-file /home/jenkins/packagecloud_api -v -o -X POST -F \
    destination=fdio/release/ https://packagecloud.io$packages

done <packages.txt