Skip to content

Commit

Permalink
Add install and update example scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
nileane committed Oct 19, 2024
1 parent f42d69d commit cdd9e77
Show file tree
Hide file tree
Showing 2 changed files with 62 additions and 0 deletions.
35 changes: 35 additions & 0 deletions install.sh.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
#!/bin/bash

# Ensure the script exits if any command fails
set -e

# Set the repository and Mastodon paths
TANGERINEUI="/home/mastodon/TangerineUI"
MASTODON="/home/mastodon/live"

# Navigate to the repository
cd "$TANGERINEUI" || { echo "Tangerine UI repository directory not found: $REPO"; exit 1; }

# Pull the latest changes from the repository
git pull || { echo "Failed to pull latest changes from the Tangerine UI repository"; exit 1; }

# Copy styles from the Mastodon repository to the target directory
cp -r "./mastodon/app/javascript/styles/"* "$MASTODON/app/javascript/styles"

# Add Tangerine UI to themes.yml
{
echo "tangerineui: styles/tangerineui.scss"
echo "tangerineui-purple: styles/tangerineui-purple.scss"
echo "tangerineui-cherry: styles/tangerineui-cherry.scss"
echo "tangerineui-lagoon: styles/tangerineui-lagoon.scss"
} >> "$MASTODON/config/themes.yml"

# Navigate to the Mastodon directory
cd "$MASTODON" || { echo "Mastodon directory not found: $MASTODON"; exit 1; }

# Precompile assets in production mode
RAILS_ENV=production bundle exec rails assets:precompile

echo ""
echo "Tangerine UI was successfully installed."
echo "Restart all Mastodon services for the changes to take effect."
27 changes: 27 additions & 0 deletions update.sh.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#!/bin/bash

# Ensure the script exits if any command fails
set -e

# Set the repository and Mastodon paths
TANGERINEUI="/home/mastodon/TangerineUI"
MASTODON="/home/mastodon/live"

# Navigate to the repository
cd "$TANGERINEUI" || { echo "Tangerine UI repository directory not found: $REPO"; exit 1; }

# Pull the latest changes from the repository
git pull || { echo "Failed to pull latest changes from the Tangerine UI repository"; exit 1; }

# Copy styles from the Mastodon repository to the target directory
cp -r "./mastodon/app/javascript/styles/"* "$MASTODON/app/javascript/styles"

# Navigate to the Mastodon directory
cd "$MASTODON" || { echo "Mastodon directory not found: $MASTODON"; exit 1; }

# Precompile assets in production mode
RAILS_ENV=production bundle exec rails assets:precompile

echo ""
echo "Tangerine UI was successfully updated."
echo "Restart all Mastodon services for the changes to take effect."

0 comments on commit cdd9e77

Please sign in to comment.