summaryrefslogtreecommitdiff
path: root/deploy
diff options
context:
space:
mode:
authorbookcorner <git@bookcorner.ge>2026-07-26 02:25:33 +0400
committerbookcorner <git@bookcorner.org>2026-07-26 02:26:08 +0400
commit3ccf0e454f535d4c1b5787727e9e1d06be471e85 (patch)
tree7eb609021e5f3d91b30465c0e6aa3071cf0f97a4 /deploy
downloadinfra-3ccf0e454f535d4c1b5787727e9e1d06be471e85.tar
infra-3ccf0e454f535d4c1b5787727e9e1d06be471e85.tar.gz
infra-3ccf0e454f535d4c1b5787727e9e1d06be471e85.tar.bz2
infra-3ccf0e454f535d4c1b5787727e9e1d06be471e85.tar.lz
infra-3ccf0e454f535d4c1b5787727e9e1d06be471e85.tar.xz
infra-3ccf0e454f535d4c1b5787727e9e1d06be471e85.tar.zst
infra-3ccf0e454f535d4c1b5787727e9e1d06be471e85.zip
Initial commit
Diffstat (limited to 'deploy')
-rwxr-xr-xdeploy67
1 files changed, 67 insertions, 0 deletions
diff --git a/deploy b/deploy
new file mode 100755
index 0000000..bf3cab3
--- /dev/null
+++ b/deploy
@@ -0,0 +1,67 @@
+#!/bin/sh
+
+set -e
+
+REPO="$(dirname "$(realpath "$0")")"
+
+. "$REPO/script/delete_dir.sh"
+. "$REPO/script/delete_file.sh"
+. "$REPO/script/install_dir.sh"
+. "$REPO/script/install_file.sh"
+
+usage() {
+ echo ' -?, -h, --help print help'
+ echo ' -d, --dry dry run'
+ echo '--delete-obsolete delete obsolete files and dirs'
+}
+
+DRY=''
+
+while [[ "$1" == -* ]]; do
+ case "$1" in
+ -h|--help|-\?)
+ usage
+ exit
+ ;;
+ -d|--dry)
+ DRY='YES'
+ ;;
+ --delete-obsolete)
+ DELETE_OBSOLETE='YES'
+ ;;
+ *)
+ echo "invalid option: $1" >&2
+ exit 1
+ ;;
+ esac
+
+ shift
+done
+
+if [ "$DRY" != 'YES' ]; then
+ echo '==='
+ pkg_add \
+ bzip2 lzip xz zstd \
+ curl git gnupg vim--no_x11 wget \
+ cgit gitolite
+fi
+
+. "$REPO/files.sh"
+
+if [ "$DRY" != 'YES' ]; then
+ echo '==='
+ echo 'Apply packet filter rules'
+ pfctl -f /etc/pf.conf && echo 'OK' || echo 'FAIL'
+
+ echo '==='
+ rcctl restart portmap
+ rcctl restart httpd nfsd slowcgi sshd
+
+ kill -KILL `cat /var/run/mountd.pid` || true
+ rcctl start mountd
+
+ echo '==='
+ mount -av
+fi
+
+echo '==='