diff options
author | Pierre Mavro | 2023-02-08 15:33:44 +0100 |
---|---|---|
committer | Pierre Mavro | 2023-02-08 16:33:19 +0100 |
commit | 682e2299407370425c9c9336644160b55703dd92 (patch) | |
tree | 3c7fa72090853d90a7dbc84b2bc28a28a9944747 | |
parent | 88768f6e44685c49c1e7119596c727269d5828a8 (diff) | |
download | aur-682e2299407370425c9c9336644160b55703dd92.tar.gz |
feat: regularly restart then agent because of hang + update script
-rw-r--r-- | .SRCINFO | 4 | ||||
-rw-r--r-- | .gitignore | 1 | ||||
-rw-r--r-- | Dockerfile | 15 | ||||
-rw-r--r-- | PKGBUILD | 13 | ||||
-rwxr-xr-x | update.sh | 19 | ||||
-rw-r--r-- | vanta-agent.conf | 4 |
6 files changed, 51 insertions, 5 deletions
@@ -1,13 +1,15 @@ pkgbase = vanta-agent pkgdesc = Vanta agent pkgver = 2.2.3 - pkgrel = 1 + pkgrel = 2 url = https://www.vanta.com/ install = vanta-agent.install arch = x86_64 license = custom:vanta depends = systemd source = https://vanta-agent-repo.s3.amazonaws.com/targets/versions/2.2.3/vanta-amd64.deb + source = vanta-agent.conf sha256sums = 515abfb227bf44577ed9c5ffc07672101b693ab82148e8939793e98d80826a45 + sha256sums = 2d650c20f8cabb78d3c629c38d8eed3b15f0e3f9f0b96b68f67fbe5831b41307 pkgname = vanta-agent diff --git a/.gitignore b/.gitignore index cef3ea8b885c..97091838249f 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,3 @@ -update.sh *.zst *.deb src/ diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 000000000000..c2f2ff6adb86 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,15 @@ +FROM archlinux + +RUN pacman -Sy --noconfirm base-devel git + +ADD . /home/builduser + +RUN useradd builduser -m \ + && passwd -d builduser \ + && echo -e 'builduser ALL=(ALL) NOPASSWD: ALL\n' >> /etc/sudoers \ + && chown -Rf builduser /home/builduser + +WORKDIR /home/builduser +USER builduser + +#RUN ["makepkg", "-si", "--noconfirm"] @@ -6,15 +6,19 @@ _binname=vanta _svcname=vanta-agent pkgname=vanta-agent +# https://app.vanta.com/downloads pkgver=2.2.3 -pkgrel=1 +pkgrel=2 pkgdesc="Vanta agent" arch=('x86_64') url="https://www.vanta.com/" depends=('systemd') license=('custom:vanta') install=$pkgname.install -source=("https://vanta-agent-repo.s3.amazonaws.com/targets/versions/${pkgver}/${_binname}-amd64.deb") +source=( + "https://vanta-agent-repo.s3.amazonaws.com/targets/versions/${pkgver}/${_binname}-amd64.deb" + "${_svcname}.conf" +) package() { echo " -> Extracting the data.tar.gz..." @@ -23,6 +27,8 @@ package() { echo " -> Moving stuff in place..." # systemd install -Dm644 "$srcdir"/usr/lib/systemd/system/vanta.service "$pkgdir"/usr/lib/systemd/system/$_svcname.service + # systemd override for regular restart because of Agent instability + install -Dm644 $_svcname.conf "$pkgdir"/etc/systemd/system/$_svcname.service.d/$_svcname.conf # changelog install -Dm644 usr/share/doc/vanta/changelog.gz "$pkgdir"/usr/share/doc/$_binname/changelog.gz # vanta @@ -54,4 +60,5 @@ package() { fi } -sha256sums=('515abfb227bf44577ed9c5ffc07672101b693ab82148e8939793e98d80826a45') +sha256sums=('515abfb227bf44577ed9c5ffc07672101b693ab82148e8939793e98d80826a45' + '2d650c20f8cabb78d3c629c38d8eed3b15f0e3f9f0b96b68f67fbe5831b41307') diff --git a/update.sh b/update.sh new file mode 100755 index 000000000000..164457a8b0e2 --- /dev/null +++ b/update.sh @@ -0,0 +1,19 @@ +#!/bin/bash +set -e + +echo "Update the verion in PKGBUILD" +echo "Hit enter when done" +read +head -n -2 PKGBUILD > PKGBUILD.NEW +mv PKGBUILD.NEW PKGBUILD +rm -f vanta-amd64.deb +makepkg -g >> PKGBUILD +makepkg --printsrcinfo > .SRCINFO +makepkg --verifysource -f +makepkg -srf + +echo "Testing locally" +docker build . -t arch:pkgtest +docker run -it -v $(pwd):/home/builduser arch:pkgtest bash -c "cd /home/builduser && read && makepkg -si" + +echo "To test once published: docker run -it --rm thann/yay vanta-agent" diff --git a/vanta-agent.conf b/vanta-agent.conf new file mode 100644 index 000000000000..7857063e3277 --- /dev/null +++ b/vanta-agent.conf @@ -0,0 +1,4 @@ +# Vanta agent regularly hang, this forces to regularly restart it +[Service] +Restart=always +RuntimeMaxSec=12h |