plugin deployment script, upload distributabkes mode for site deploy script

This commit is contained in:
Sergey Chernov 2026-01-12 12:25:12 +01:00
parent 9924d02cb4
commit 474293cfe3
2 changed files with 64 additions and 26 deletions

26
bin/deploy_plugin Executable file
View File

@ -0,0 +1,26 @@
#!/bin/sh
#
# Copyright 2026 Sergey S. Chernov real.sergeych@gmail.com
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
#
set -e
echo
echo "Creating plugin"
echo
./gradlew buildInstallablePlugin
deploy_site -u

View File

@ -1,7 +1,7 @@
#!/bin/bash
#
# Copyright 2025 Sergey S. Chernov real.sergeych@gmail.com
# Copyright 2026 Sergey S. Chernov real.sergeych@gmail.com
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@ -17,6 +17,14 @@
#
#
upload_only=false
for arg in "$@"; do
if [[ "$arg" == "-u" || "$arg" == "--upload-only" ]]; then
upload_only=true
break
fi
done
function checkState() {
if [[ $? != 0 ]]; then
echo
@ -24,9 +32,10 @@ function checkState() {
echo
exit 100
fi
}
# Update docs/idea_plugin.md to point to the latest built IDEA plugin zip
# from ./distributables before building the site. The change is temporary and
# the original file is restored right after the build.
@ -107,28 +116,28 @@ function refreshTextmateZip() {
(cd editors && zip -rq ../distributables/lyng-textmate.zip .)
}
# Update the IDEA plugin download link in docs (temporarily), then build, then restore the doc
refreshTextmateZip
updateIdeaPluginDownloadLink || echo "WARN: proceeding without updating IDEA plugin download link"
./gradlew site:jsBrowserDistribution
BUILD_RC=$?
if [[ "$upload_only" == false ]]; then
# Update the IDEA plugin download link in docs (temporarily), then build, then restore the doc
refreshTextmateZip
updateIdeaPluginDownloadLink || echo "WARN: proceeding without updating IDEA plugin download link"
# Always restore original doc if backup exists
if [[ -f "$DOC_IDEA_PLUGIN_BACKUP" ]]; then
mv -f "$DOC_IDEA_PLUGIN_BACKUP" "$DOC_IDEA_PLUGIN"
./gradlew site:jsBrowserDistribution
BUILD_RC=$?
# Always restore original doc if backup exists
if [[ -f "$DOC_IDEA_PLUGIN_BACKUP" ]]; then
mv -f "$DOC_IDEA_PLUGIN_BACKUP" "$DOC_IDEA_PLUGIN"
fi
if [[ $BUILD_RC -ne 0 ]]; then
echo
echo -- build failed. deploy aborted.
echo
exit 100
fi
fi
if [[ $BUILD_RC -ne 0 ]]; then
echo
echo -- build failed. deploy aborted.
echo
exit 100
fi
#exit 0
# Prepare working dir
ssh -p ${SSH_PORT} ${SSH_HOST} "
cd ${ROOT}
@ -143,12 +152,15 @@ ssh -p ${SSH_PORT} ${SSH_HOST} "
fi
";
# sync files
SRC=./site/build/dist/js/productionExecutable
rsync -e "ssh -p ${SSH_PORT}" -avz -r -d --delete ${SRC}/* ${SSH_HOST}:${ROOT}/build/dist
checkState
#rsync -e "ssh -p ${SSH_PORT}" -avz ./static/* ${SSH_HOST}:${ROOT}/build/dist
#checkState
if [[ "$upload_only" == false ]]; then
# sync files
SRC=./site/build/dist/js/productionExecutable
rsync -e "ssh -p ${SSH_PORT}" -avz -r -d --delete ${SRC}/* ${SSH_HOST}:${ROOT}/build/dist
checkState
#rsync -e "ssh -p ${SSH_PORT}" -avz ./static/* ${SSH_HOST}:${ROOT}/build/dist
#checkState
fi
rsync -e "ssh -p ${SSH_PORT}" -avz -r -d --delete distributables/* ${SSH_HOST}:${ROOT}/build/dist/distributables
checkState