plugin deployment script, upload distributabkes mode for site deploy script
This commit is contained in:
parent
9924d02cb4
commit
474293cfe3
26
bin/deploy_plugin
Executable file
26
bin/deploy_plugin
Executable 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
|
||||||
@ -1,7 +1,7 @@
|
|||||||
#!/bin/bash
|
#!/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");
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
# you may not use this file except in compliance with 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() {
|
function checkState() {
|
||||||
if [[ $? != 0 ]]; then
|
if [[ $? != 0 ]]; then
|
||||||
echo
|
echo
|
||||||
@ -24,9 +32,10 @@ function checkState() {
|
|||||||
echo
|
echo
|
||||||
exit 100
|
exit 100
|
||||||
fi
|
fi
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# Update docs/idea_plugin.md to point to the latest built IDEA plugin zip
|
# 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
|
# from ./distributables before building the site. The change is temporary and
|
||||||
# the original file is restored right after the build.
|
# the original file is restored right after the build.
|
||||||
@ -107,28 +116,28 @@ function refreshTextmateZip() {
|
|||||||
(cd editors && zip -rq ../distributables/lyng-textmate.zip .)
|
(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
|
if [[ "$upload_only" == false ]]; then
|
||||||
BUILD_RC=$?
|
# 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
|
./gradlew site:jsBrowserDistribution
|
||||||
if [[ -f "$DOC_IDEA_PLUGIN_BACKUP" ]]; then
|
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"
|
mv -f "$DOC_IDEA_PLUGIN_BACKUP" "$DOC_IDEA_PLUGIN"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ $BUILD_RC -ne 0 ]]; then
|
if [[ $BUILD_RC -ne 0 ]]; then
|
||||||
echo
|
echo
|
||||||
echo -- build failed. deploy aborted.
|
echo -- build failed. deploy aborted.
|
||||||
echo
|
echo
|
||||||
exit 100
|
exit 100
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
#exit 0
|
|
||||||
|
|
||||||
# Prepare working dir
|
# Prepare working dir
|
||||||
ssh -p ${SSH_PORT} ${SSH_HOST} "
|
ssh -p ${SSH_PORT} ${SSH_HOST} "
|
||||||
cd ${ROOT}
|
cd ${ROOT}
|
||||||
@ -143,12 +152,15 @@ ssh -p ${SSH_PORT} ${SSH_HOST} "
|
|||||||
fi
|
fi
|
||||||
";
|
";
|
||||||
|
|
||||||
# sync files
|
if [[ "$upload_only" == false ]]; then
|
||||||
SRC=./site/build/dist/js/productionExecutable
|
# sync files
|
||||||
rsync -e "ssh -p ${SSH_PORT}" -avz -r -d --delete ${SRC}/* ${SSH_HOST}:${ROOT}/build/dist
|
SRC=./site/build/dist/js/productionExecutable
|
||||||
checkState
|
rsync -e "ssh -p ${SSH_PORT}" -avz -r -d --delete ${SRC}/* ${SSH_HOST}:${ROOT}/build/dist
|
||||||
#rsync -e "ssh -p ${SSH_PORT}" -avz ./static/* ${SSH_HOST}:${ROOT}/build/dist
|
checkState
|
||||||
#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
|
rsync -e "ssh -p ${SSH_PORT}" -avz -r -d --delete distributables/* ${SSH_HOST}:${ROOT}/build/dist/distributables
|
||||||
checkState
|
checkState
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user