diff --git a/.vscode/tasks.json b/.vscode/tasks.json index 4ddd7f3..4ff331d 100644 --- a/.vscode/tasks.json +++ b/.vscode/tasks.json @@ -43,6 +43,13 @@ "command": "sudo cp access.yml /home/infilytics/ && sudo chown -R infilytics:infilytics /home/infilytics/access.yml", "problemMatcher": [], "detail": "Copy access.yml to /home/infilytics" + }, + { + "label": "Create home tarball", + "type": "shell", + "command": "${workspaceFolder}/create-home-tarball.sh", + "problemMatcher": [], + "detail": "create home.tar.gz from .config .local .ssh start.sh" } ], "inputs": [] diff --git a/create-home-tarball.sh b/create-home-tarball.sh new file mode 100755 index 0000000..f858ff6 --- /dev/null +++ b/create-home-tarball.sh @@ -0,0 +1,9 @@ +#!/usr/bin/env bash +set -euo pipefail + +if [ "$(basename "$(pwd -P)")" != "workspaces" ]; then + echo "Error: this script must be run from a directory named 'workspaces', not '$(basename "$(pwd -P)")'" >&2 + exit 1 +fi + +tar -czf home.tar.gz --owner root --group secproc --xform "s,$PWD,/home/devuser," .config .local .ssh start.sh