1
0
mirror of https://github.com/laurent22/joplin.git synced 2025-03-20 20:55:18 +02:00
joplin/packages/tools/release-website.sh

58 lines
1.4 KiB
Bash
Raw Permalink Normal View History

2021-12-19 08:30:32 +01:00
#!/bin/bash
set -e
2021-12-19 08:47:30 +01:00
# ------------------------------------------------------------------------------
2021-12-19 08:30:32 +01:00
# Setup environment
2021-12-19 08:47:30 +01:00
# ------------------------------------------------------------------------------
2021-12-19 08:30:32 +01:00
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
SCRIPT_NAME=`basename "$0"`
JOPLIN_ROOT_DIR="$SCRIPT_DIR/../.."
JOPLIN_WEBSITE_ROOT_DIR="$JOPLIN_ROOT_DIR/../joplin-website"
2021-12-19 08:47:30 +01:00
# ------------------------------------------------------------------------------
# Update the Markdown files inside the Joplin directory. This is for example the
# download links README.md or the desktop app changelog.
# ------------------------------------------------------------------------------
2021-12-19 08:30:32 +01:00
cd "$JOPLIN_ROOT_DIR"
2021-12-19 08:47:30 +01:00
# Will fail if there's any local change in the repo, which is what we want
git pull --rebase
2021-12-19 08:30:32 +01:00
npm install
2021-12-19 08:47:30 +01:00
# Clean up npm's mess
2021-12-19 08:30:32 +01:00
git reset --hard
npm run updateMarkdownDoc
2021-12-19 08:47:30 +01:00
# We commit and push the change. It will be a noop if nothing was actually
# changed
2021-12-19 08:30:32 +01:00
git add -A
git commit -m "Doc: Updated Markdown files
Auto-updated using $SCRIPT_NAME"
git push
2021-12-19 08:47:30 +01:00
# ------------------------------------------------------------------------------
2021-12-19 08:30:32 +01:00
# Build and deploy the website
2021-12-19 08:47:30 +01:00
# ------------------------------------------------------------------------------
2021-12-19 08:30:32 +01:00
cd "$JOPLIN_WEBSITE_ROOT_DIR"
git pull --rebase
cd "$JOPLIN_ROOT_DIR"
npm run buildWebsite
cd "$JOPLIN_WEBSITE_ROOT_DIR"
git add -A
2021-12-19 08:36:36 +01:00
git commit -m "Updated website
Auto-updated using $SCRIPT_NAME"
2021-12-19 08:30:32 +01:00
git push