agnes-the-ai-analyst/connectors/jira/bin/update-jira-symlinks
Petr 86edd27655 Extract Jira into connectors/jira module
Move all Jira-specific code into a self-contained connector module:
- 22 files moved via git mv (transform, service, webhook, scripts,
  systemd units, tests, docs, bin helper)
- All imports updated to use connectors.jira.* paths
- Jira is now conditional: auto-detected via JIRA_DOMAIN env var
- Webapp registers Jira blueprint only when available
- Health service monitors Jira timers only when enabled
- Profiler loads Jira tables dynamically from filesystem
- Sync settings uses config-driven dependency validation
- Renamed keboola_platform_url -> custom_url in transform
- Updated deploy.sh, sudoers-deploy, backfill_gap.sh paths
- Fixed pytest.ini to skip live tests by default
2026-03-09 11:17:50 +01:00

49 lines
1.4 KiB
Bash
Executable file

#!/bin/bash
# Add Jira attachments symlink to all existing analyst home directories
# Run this once after enabling Jira integration
#
# Usage: sudo update-jira-symlinks
set -euo pipefail
if [[ $EUID -ne 0 ]]; then
echo "This script must be run as root (use sudo)"
exit 1
fi
JIRA_ATTACHMENTS="/data/src_data/raw/jira/attachments"
if [[ ! -d "$JIRA_ATTACHMENTS" ]]; then
echo "Jira attachments directory not found: $JIRA_ATTACHMENTS"
echo "Make sure Jira backfill has run at least once."
exit 1
fi
echo "Adding jira_attachments symlink to analyst home directories..."
# Find all users in dataread group (analysts)
for username in $(getent group dataread | cut -d: -f4 | tr ',' '\n'); do
home_dir="/home/${username}"
server_dir="${home_dir}/server"
symlink="${server_dir}/jira_attachments"
# Skip if home doesn't exist or server dir doesn't exist
if [[ ! -d "$server_dir" ]]; then
echo " Skipping $username (no server/ directory)"
continue
fi
# Skip if symlink already exists
if [[ -L "$symlink" ]]; then
echo " Skipping $username (symlink already exists)"
continue
fi
# Create symlink
ln -sf "$JIRA_ATTACHMENTS" "$symlink"
chown -h "${username}:${username}" "$symlink"
echo " Added symlink for $username"
done
echo ""
echo "Done. Analysts can now access Jira attachments at ~/server/jira_attachments/"