summarylogtreecommitdiffstats
path: root/update.sh
diff options
context:
space:
mode:
Diffstat (limited to 'update.sh')
-rwxr-xr-xupdate.sh24
1 files changed, 24 insertions, 0 deletions
diff --git a/update.sh b/update.sh
new file mode 100755
index 000000000000..605f82e1b056
--- /dev/null
+++ b/update.sh
@@ -0,0 +1,24 @@
+#!/usr/bin/env bash
+
+set -e
+
+UPSTREAM=${UPSTREAM:-newrelic/infrastructure-agent}
+echo "Using ${UPSTREAM} as upstream repo"
+
+if [[ -z $VERSION ]]; then
+ VERSION=$(curl -s https://api.github.com/repos/newrelic/infrastructure-agent/releases/latest | jq -r .tag_name)
+fi
+
+echo "Updating PKGBUILD to ${VERSION}"
+sed -i "s/pkgver=.*/pkgver=${VERSION}/" PKGBUILD
+
+echo "Updating checksums..."
+updpkgsums
+
+echo "Checking build..."
+makepkg -s
+
+echo "Updating .SRCINFO..."
+makepkg --printsrcinfo > .SRCINFO
+
+echo "Successfully updated PKGBUILD to $VERSION"