-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* fix: Publish Release notes
- Loading branch information
Ryan Faircloth
authored
Feb 13, 2021
1 parent
1c3a131
commit 5ea99b4
Showing
4 changed files
with
74 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
#!/usr/bin/env bash | ||
source .splunkbase | ||
source ~/.venv/bin/activate | ||
PACKAGE=$(ls build/package/splunkbase/*) | ||
PACKAGE_ID=$(crudini --get package/default/app.conf id name) | ||
[[ $1 =~ ^v[0-9]*.[0-9]*.[0-9]*$ ]] || export ISPRE=-prerelease | ||
SPLUNKBASE_VERSION=$(echo $1 | sed 's/^v//' | sed 's/-develop./develop/g') | ||
echo publish $SPLUNKBASE_VERSION | ||
[ "${ISPRE}" == "-prerelease" ] && SPLUNKBASE_VIS="false" || SPLUNKBASE_VIS="true" | ||
echo uploading package | ||
BASE=https://splunkbase.splunk.com/api/v0.1/app/${SPLUNKBASE_ID}/release/ | ||
echo $BASE | ||
|
||
curl -u ${SPLUNKBASE_USERNAME}:${SPLUNKBASE_PASSWORD} \ | ||
--request POST https://splunkbase.splunk.com/api/v1/app/${SPLUNKBASE_ID}/new_release/ \ | ||
-F "files[]=@${PACKAGE}" -F "filename=${PACKAGE_ID}.spl" \ | ||
-F "splunk_versions=${SPLUNKBASE_SPLUNK_VERSION}" \ | ||
-F "visibility=${SPLUNKBASE_VIS}" | ||
sleep 30 | ||
ITEM=$(curl -u ${SPLUNKBASE_USERNAME}:${SPLUNKBASE_PASSWORD} \ | ||
--request GET $BASE \ | ||
| jq ".[] | select(.name==\"$SPLUNKBASE_VERSION\") | .id") | ||
|
||
echo get $ITEM | ||
CURRENT=$(curl -u ${SPLUNKBASE_USERNAME}:${SPLUNKBASE_PASSWORD} \ | ||
--request GET $BASE${ITEM}/ \ | ||
| jq ) | ||
|
||
NOTES=$(cat CHANGELOG.md | jq -sR) | ||
NEW=$(echo $CURRENT | jq ".release_notes = $NOTES" | jq -c) | ||
curl -u ${SPLUNKBASE_USERNAME}:${SPLUNKBASE_PASSWORD} \ | ||
--location \ | ||
--request PUT $BASE${ITEM}/ \ | ||
--header 'Content-Type: application/json' \ | ||
--data-raw "$NEW" | jq | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters