Automatically Upload Nightly Artifacts if a Release is Cut
continuous-integration/drone/pr Build is passing
Details
continuous-integration/drone/pr Build is passing
Details
This commit is contained in:
parent
eaae82ef55
commit
caf85f337b
|
@ -139,6 +139,8 @@ steps:
|
|||
- scp -r -o StrictHostKeyChecking=no -i ~/id_rsa $DIR buildfiles@build.openprivacy.ca:/home/buildfiles/buildfiles/
|
||||
- ./gen-nightly-index.sh $DIR
|
||||
- scp -r -o StrictHostKeyChecking=no -i ~/id_rsa cwtch-nightly.html buildfiles@build.openprivacy.ca:/home/buildfiles/buildfiles/
|
||||
# Upload Files to releases...if a release has been cut...
|
||||
- ./uploaded-releases.sh deploy/cwtch-`cat VERSION`.apk application/vnd.android.package-archive
|
||||
|
||||
- name: notify-gogs
|
||||
image: openpriv/drone-gogs
|
||||
|
|
|
@ -0,0 +1,19 @@
|
|||
#!/bin/sh
|
||||
|
||||
VERSION=$(cat VERSION)
|
||||
echo "Grabbing Release Data From:" "https://git.openprivacy.ca/api/v1/repos/$DRONE_REPO/releases/tags/$VERSION"
|
||||
RELEASEID=$(curl -s -X 'GET' "https://git.openprivacy.ca/api/v1/repos/$DRONE_REPO/releases/tags/$VERSION" -H 'accept: application/json' | jq '.id')
|
||||
echo $RELEASEID
|
||||
|
||||
URL="$PLUGIN_GOGS_URL/api/v1/repos/$DRONE_REPO/releases/$RELEASEID/assets?name=$1"
|
||||
FILE="@$1"
|
||||
RESULT=$(curl -o /dev/null -w "%{http_code}" -X POST -H "Authorization: token $GOGS_ACCOUNT_TOKEN" -H "accept: application/json" -H "Content-Type: multipart/form-data" -F "attachment=$FILE;type=$2" $URL)
|
||||
|
||||
|
||||
if [ $RESULT -eq 201 ]
|
||||
then
|
||||
echo "Success posting to $URL"
|
||||
else
|
||||
echo "ERROR HTTP $RESULT posting to $URL"
|
||||
exit 1
|
||||
fi
|
Loading…
Reference in New Issue