0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-01-21 06:02:32 -05:00

Improve deployment related scripts on exporter.

This commit is contained in:
Andrey Antukh 2020-07-02 10:42:01 +02:00
parent f8881b3c72
commit ef0330502b
6 changed files with 40 additions and 6 deletions

View file

@ -26,7 +26,7 @@ tmux send-keys -t uxbox 'cd uxbox/exporter' enter C-l
tmux send-keys -t uxbox 'npx shadow-cljs watch main' enter
tmux split-window -v
tmux send-keys -t uxbox 'cd uxbox/exporter' enter C-l
tmux send-keys -t uxbox './bin/wait-and-start' enter
tmux send-keys -t uxbox './scripts/wait-and-start.sh' enter
tmux new-window -t uxbox:3 -n 'backend'
tmux select-window -t uxbox:3

19
exporter/scripts/build.sh Executable file
View file

@ -0,0 +1,19 @@
#!/usr/bin/env bash
source ~/.bashrc
set -ex
npm ci
rm -rf target
export NODE_ENV=production;
# Build the application
npx shadow-cljs release main
# Remove source
rm -rf target/app
# Copy package*.json files
cp package-lock.json target/
cp package.json target/

View file

@ -13,10 +13,8 @@
{:main
{:target :node-script
:main app.core/main
:output-to "target/exporter.js"
:output-dir "target/exporter/"
:asset-path "/js"
:output-to "target/app.js"
:output-dir "target/app/"
:devtools {:before-load-async app.core/stop
:after-load app.core/start}

View file

@ -12,7 +12,7 @@ export NODE_ENV=production;
# Clean the output directory
npx gulp clean || exit 1;
shadow-cljs release main --config-merge "{:release-version \"${TAG}\"}"
npx shadow-cljs release main --config-merge "{:release-version \"${TAG}\"}"
npx gulp build || exit 1;
npx gulp dist:clean || exit 1;
npx gulp dist:copy || exit 1;

View file

@ -64,6 +64,19 @@ function build-frontend {
$IMAGE ./scripts/build-app.sh
}
function build-exporter {
build-devenv-if-not-exists;
local IMAGE=$DEVENV_IMGNAME:latest;
echo "Running development image $IMAGE to build frontend."
docker run -t --rm \
--mount source=`pwd`,type=bind,target=/home/uxbox/uxbox \
--mount source=${HOME}/.m2,type=bind,target=/home/uxbox/.m2 \
-w /home/uxbox/uxbox/exporter \
$IMAGE ./scripts/build.sh
}
function build-backend {
rm -rf ./backend/target/dist
mkdir -p ./backend/target/dist
@ -145,6 +158,10 @@ case $1 in
build-backend
;;
build-exporter)
build-exporter
;;
*)
usage
;;