Last active
October 2, 2021 17:18
-
-
Save nakal/7967f83c85dc0c668cddbfeddb030930 to your computer and use it in GitHub Desktop.
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/sh | |
| SCRIPTNAME=`basename "$0"` | |
| PORTSTREE="local" | |
| POUDRIERE="/usr/local/bin/poudriere" | |
| URL="https://host.example.org/poudriere/" | |
| poudriere_build() { | |
| for REPO in $REPOS; do | |
| echo "Started $REPO ("`/bin/date | /usr/bin/tr -d '\n'`")" | |
| "$POUDRIERE" bulk -j "$JAIL" -p "$PORTSTREE" -z "$REPO" -f "${JAIL}"-"${PORTSTREE}"-"${REPO}"-pkglist > /dev/null | |
| echo " Cleaning $REPO ("`/bin/date | /usr/bin/tr -d '\n'`")" | |
| "$POUDRIERE" pkgclean -j "$JAIL" -p "$PORTSTREE" -z "$REPO" -f "${JAIL}"-"${PORTSTREE}"-"${REPO}"-pkglist -y > /dev/null | |
| echo " Finished $REPO ("`/bin/date | /usr/bin/tr -d '\n'`")" | |
| done | |
| } | |
| echo "This is a log of poudriere. Details: $URL" | |
| echo "" | |
| echo "[$SCRIPTNAME] Updating ports tree..." | |
| "$POUDRIERE" ports -p "$PORTSTREE" -u > /dev/null | |
| if [ $? -ne 0 ]; then | |
| echo " Error updating ports tree." | |
| exit 1 | |
| fi | |
| echo " Ports tree has been updated." | |
| # distribute INDEX-* files for pkg-status (periodic) | |
| # (for remote servers) | |
| # /bin/cp /usr/ports/INDEX-* /jails/jail1/usr/ports/ | |
| #/usr/bin/scp /usr/ports/INDEX-* user@server1:/usr/ports/ | |
| ## for 10.x | |
| #cd /usr/local/etc/poudriere.d | |
| #JAIL="10amd64" | |
| #REPOS="server1 jail1" | |
| #poudriere_build | |
| # for 11.x | |
| JAIL="11amd64" | |
| REPOS="server1 jail1" | |
| poudriere_build | |
| echo "[$SCRIPTNAME] Cleaning distfiles..." | |
| "$POUDRIERE" distclean -p "$PORTSTREE" -y | |
| echo "[$SCRIPTNAME] Finished. ("`/bin/date | /usr/bin/tr -d '\n'`")" | |
| exit 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment