Created
May 5, 2024 06:44
-
-
Save sydrawat01/4765bbc12d4650388357a02bcb023e7f to your computer and use it in GitHub Desktop.
Download tarball from github releases + smoke test script w/ siege
This file contains hidden or 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
| #!/bin/bash | |
| # Download tarball from github organization releases page | |
| # pre-req: You need to have a GitHub PAT with appropriate permissions on the organization for private repositories | |
| # usage: ./download-latest-tarball.sh <org-name> <repo-name> | |
| # ex: ./download-latest-tarball.sh pwncorp webapp-helm-chart | |
| # download the latest tarball and untar it | |
| VERSION="$(curl --silent -H "Authorization: token <github_pat_token>" \ | |
| "https://api.github.com/repos/$1/$2/releases/latest" | | |
| grep '"tag_name":' | | |
| sed -E 's/.*"([^"]+)".*/\1/')" | |
| echo "Downloading $1/$2:$VERSION..." | |
| curl -LO -H "Authorization: token <github_pat_token>" https://api.github.com/repos/"$1"/"$2"/tarball/"$VERSION" | |
| mv "$VERSION" "$2".tar.gz | |
| echo "opening up the tarball..." | |
| tar -xzvf "$2".tar.gz |
This file contains hidden or 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
| #!/bin/bash | |
| # Smoke test for load-testing healthz endpoint | |
| # pre-req: Siege must be installed [macOS: brew install siege] | |
| # * Remember to use 'http' or 'https', and not 'http(s)' | |
| # * Replace <ip-or-domain.tld> with the actual server IP address or the API domain | |
| # Options | |
| # -c : number of concurrent users | |
| # -d : delay in seconds between each requests | |
| # -r : number of requests to be sent to API endpoint | |
| # -f : file containing the API endpoints to be stress-tested | |
| touch smoke-links.txt | |
| echo "http(s)://<ip-or-domain.tld>/healthz" >> smoke-links.txt | |
| siege -c10 -d0.1 -r5000 -f smoke-links.txt | |
| rm -rf smoke-links.txt |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment