irish-monitor/release.sh

40 lines
1.1 KiB
Bash
Raw Normal View History

2024-06-26 14:40:06 +02:00
rm -f *.zip
# Portal
git clone https://code-repo.d4science.org/MaDgIK/irish-monitor.git
cd irish-monitor
git checkout master
git submodule update --init --recursive
cd src/app/openaireLibrary
git checkout master
cd ../../assets/common-assets
git checkout master
cd ../openaire-theme
git checkout master
cd ../../../
npm run after-build-clean
version=$(npm pkg get version | xargs)
2024-06-26 14:40:06 +02:00
cd ../
zip -r irish-monitor-$version.zip irish-monitor
rm -rf irish-monitor
2024-06-26 14:40:06 +02:00
# Service
git clone https://code-repo.d4science.org/MaDgIK/irish-monitor-service.git
cd irish-monitor-service
git checkout production
rm -rf .git*
version=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)
# Remove the '-SNAPSHOT' suffix
version=${version%-SNAPSHOT}
# Split the version string into major, minor, and patch components
IFS='.' read -r major minor patch <<EOF
$version
EOF
# Subtract one from the patch version
patch=$((patch - 1))
# Reconstruct the version string
version="$major.$minor.$patch"
cd ../
zip -r irish-monitor-service-$version.zip irish-monitor-service
rm -rf irish-monitor-service