Skip to content

Commit

Permalink
feat: theming script
Browse files Browse the repository at this point in the history
  • Loading branch information
blt950 committed Oct 2, 2023
1 parent 96eb178 commit f481e7f
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions container/theme/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#!/bin/bash

echo "Starting theme building process..."

# Install
apt update
apt install -y ca-certificates curl gnupg
mkdir -p /etc/apt/keyrings
curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg

NODE_MAJOR=20
echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_$NODE_MAJOR.x nodistro main" | tee /etc/apt/sources.list.d/nodesource.list

apt update
apt install nodejs -y

# Build
npm ci --omit dev
su www-data -s npm run build

# Cleanup
npm cache clean --force
apt purge curl gnupg nodejs -y
apt autoremove -y
rm -r /etc/apt/sources.list.d/nodesource.list
rm -r /etc/apt/keyrings/nodesource.gpg

rm -rf /app/node_modules/

echo "Theme building process complete. Cleaned up all dependecies to save space."

0 comments on commit f481e7f

Please sign in to comment.