Skip to content

Commit 9f0403d

Browse files
rcourtmanclaude
andcommitted
feat: add tarball support to installation and release scripts
Installation Script Improvements: - Add tarball download and extraction functions - Prefer tarballs over git clone for version tag installations - Maintain git clone fallback for reliability and branch installations - Add intelligent CSS/dependency detection to skip builds when present - Fix non-interactive mode to handle fresh installations Release Script Improvements: - Include pre-built CSS and build configuration files - Add production npm dependencies to tarballs - Add verification for essential files in releases - Update instructions to promote automated installation - Ensure compatibility with tarball installation approach Benefits: - Faster installations (no npm install/CSS build required) - More reliable in constrained network environments - Backward compatible with existing workflows - Maintains full functionality for development branches 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 06e0ee8 commit 9f0403d

File tree

2 files changed

+383
-61
lines changed

2 files changed

+383
-61
lines changed

scripts/create-release.sh

Lines changed: 44 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@ mkdir -p "$STAGING_FULL_PATH"
3434
# --- Build Step ---
3535
echo "Building CSS..."
3636
npm run build:css
37-
if [ ! -f "src/public/output.css" ]; then
38-
echo "Error: src/public/output.css not found after build. Aborting."
37+
if [ ! -f "src/index.css" ]; then
38+
echo "Error: src/index.css not found after build. Aborting."
3939
exit 1
4040
fi
4141

@@ -46,11 +46,16 @@ echo "Copying application files to $STAGING_FULL_PATH..."
4646
echo "Copying server files..."
4747
rsync -av --progress server/ "$STAGING_FULL_PATH/server/" --exclude 'tests/'
4848

49-
# Public files (including built CSS and other assets)
50-
echo "Copying public files..."
49+
# Source files (including built CSS, Tailwind config, and public assets)
50+
echo "Copying source files..."
5151
mkdir -p "$STAGING_FULL_PATH/src" # Ensure parent directory exists
5252
rsync -av --progress src/public/ "$STAGING_FULL_PATH/src/public/"
5353

54+
# Copy CSS build files and config
55+
cp src/index.css "$STAGING_FULL_PATH/src/" 2>/dev/null || echo "Warning: src/index.css not found"
56+
cp src/tailwind.config.js "$STAGING_FULL_PATH/src/" 2>/dev/null || echo "Warning: src/tailwind.config.js not found"
57+
cp src/postcss.config.js "$STAGING_FULL_PATH/src/" 2>/dev/null || echo "Warning: src/postcss.config.js not found"
58+
5459
# Root files
5560
echo "Copying root files..."
5661
cp package.json "$STAGING_FULL_PATH/"
@@ -82,6 +87,22 @@ echo "Installing production dependencies in $STAGING_FULL_PATH..."
8287
# --ignore-scripts prevents any package's own postinstall scripts from running during this build phase.
8388
# If your production dependencies have essential postinstall scripts, you might remove --ignore-scripts.
8489

90+
# --- Verify Essential Files ---
91+
echo "Verifying essential files for tarball installation..."
92+
MISSING_FILES=""
93+
[ ! -f "$STAGING_FULL_PATH/package.json" ] && MISSING_FILES="$MISSING_FILES package.json"
94+
[ ! -f "$STAGING_FULL_PATH/.env.example" ] && MISSING_FILES="$MISSING_FILES .env.example"
95+
[ ! -f "$STAGING_FULL_PATH/server/index.js" ] && MISSING_FILES="$MISSING_FILES server/index.js"
96+
[ ! -f "$STAGING_FULL_PATH/src/index.css" ] && MISSING_FILES="$MISSING_FILES src/index.css"
97+
[ ! -d "$STAGING_FULL_PATH/node_modules" ] && MISSING_FILES="$MISSING_FILES node_modules/"
98+
99+
if [ -n "$MISSING_FILES" ]; then
100+
echo "Error: Missing essential files for tarball installation:$MISSING_FILES"
101+
echo "The install script expects these files to be present in the tarball."
102+
exit 1
103+
fi
104+
echo "✅ All essential files verified for tarball installation."
105+
85106
# --- Create Tarball ---
86107
echo "Creating tarball: $TARBALL_NAME..."
87108
# Go into the parent of the directory to be tarred to avoid leading paths in tarball
@@ -95,11 +116,23 @@ echo ""
95116
echo "----------------------------------------------------"
96117
echo "Release tarball created: $TARBALL_NAME"
97118
echo "----------------------------------------------------"
98-
echo "To use the tarball:"
99-
echo "1. Copy $TARBALL_NAME to the target server."
100-
echo "2. Extract: tar -xzf $TARBALL_NAME"
101-
echo "3. Navigate into the directory: cd $RELEASE_DIR_NAME"
102-
echo "4. Copy .env.example to .env and configure it: cp .env.example .env"
103-
echo "5. Start the application: npm start (or node server/index.js)"
104-
echo " (If scripts/install-pulse.sh is provided, consult it for specific setup steps)"
119+
echo "📦 This tarball includes:"
120+
echo " ✅ Pre-built CSS assets"
121+
echo " ✅ Production npm dependencies"
122+
echo " ✅ All server and client files"
123+
echo " ✅ Installation scripts"
124+
echo ""
125+
echo "🚀 Installation options:"
126+
echo "1. RECOMMENDED: Use the install script (faster, automated):"
127+
echo " curl -sLO https://raw.githubusercontent.com/rcourtman/Pulse/main/scripts/install-pulse.sh"
128+
echo " chmod +x install-pulse.sh"
129+
echo " sudo ./install-pulse.sh"
130+
echo " (The script will automatically use this tarball for faster installation)"
131+
echo ""
132+
echo "2. Manual installation:"
133+
echo " - Copy $TARBALL_NAME to target server"
134+
echo " - Extract: tar -xzf $TARBALL_NAME"
135+
echo " - Navigate: cd $RELEASE_DIR_NAME"
136+
echo " - Configure: cp .env.example .env && edit .env"
137+
echo " - Start: npm start"
105138
echo "----------------------------------------------------"

0 commit comments

Comments
 (0)