diff --git a/bin/deploy_plugin b/bin/deploy_plugin new file mode 100755 index 0000000..eebfa66 --- /dev/null +++ b/bin/deploy_plugin @@ -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 diff --git a/bin/deploy_site b/bin/deploy_site index 1a52833..1c8b2ab 100755 --- a/bin/deploy_site +++ b/bin/deploy_site @@ -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