1abf61a05f
- Introduced PostgresSubprocessException to handle errors during PostgreSQL subprocess execution. - Refactored PostgresDatabaseProvider to improve schema initialization script discovery. - Enhanced error handling for psql command execution, including logging of output and errors. - Implemented methods to find the schema initialization script and the psql executable path.
46 lines
1.4 KiB
Bash
46 lines
1.4 KiB
Bash
#!/bin/bash
|
|
|
|
# Exit immediately if a command exits with a non-zero status.
|
|
set -e
|
|
|
|
# --- Configuration ---
|
|
# Gitea credentials should be set as environment variables for security
|
|
# export GITEA_USERNAME="your_gitea_username"
|
|
# export GITEA_TOKEN="your_gitea_token"
|
|
# or use .netrc file for authentication
|
|
|
|
# Gitea repository URL
|
|
GITEA_REPO_URL="https://gitea.wpjones.com/wjones/pgsql-jellyfin.git"
|
|
|
|
# Branch to use
|
|
BRANCH="main"
|
|
|
|
# .NET Solution file
|
|
SOLUTION_FILE="Jellyfin.sln"
|
|
|
|
# Publish directory
|
|
PUBLISH_DIR="/opt/jellyfin"
|
|
|
|
# --- Script ---
|
|
|
|
echo "Logging in to Gitea and fetching latest changes..."
|
|
|
|
# Use Git to pull the latest changes.
|
|
# This assumes you have already cloned the repository and are in the repo directory.
|
|
# For authentication, Git can use a .netrc file, or you can configure Git to use a credential helper.
|
|
# For simplicity, this script assumes that your environment is already configured to authenticate with Gitea.
|
|
git checkout "$BRANCH"
|
|
git pull origin "$BRANCH"
|
|
|
|
echo "Latest changes fetched successfully."
|
|
|
|
echo "Building and publishing the .NET project..."
|
|
|
|
# Restore, build, and publish the .NET project
|
|
dotnet restore "$SOLUTION_FILE"
|
|
dotnet build "$SOLUTION_FILE" --configuration Release --no-restore
|
|
dotnet publish "$SOLUTION_FILE" --configuration Release --no-build --output "$PUBLISH_DIR"
|
|
|
|
echo "Project built and published successfully to the '$PUBLISH_DIR' directory."
|
|
|