Refactor build script for version handling and execution
Simplifies version extraction using npm, improves string quoting, and adds support for configurable TELOSYS_HOME. Also updates echo statements for consistency and improves command execution.
This commit is contained in:
16
build-all.sh
16
build-all.sh
@@ -1,8 +1,6 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
latest=$(npm view @infinimotion/model-frontend --registry https://git.chequeo.de/api/packages/infinimotion/npm/ | grep latest)
|
version=$(npm view @infinimotion/model-frontend version --registry https://git.chequeo.de/api/packages/infinimotion/npm/)
|
||||||
latest=($latest)
|
|
||||||
version=${latest[1]}
|
|
||||||
|
|
||||||
major=$(cut -d'.' -f1 <<<"$version")
|
major=$(cut -d'.' -f1 <<<"$version")
|
||||||
minor=$(cut -d'.' -f2 <<<"$version")
|
minor=$(cut -d'.' -f2 <<<"$version")
|
||||||
@@ -12,15 +10,17 @@ new_patch=$((patch+1))
|
|||||||
new_version=$major.$minor.$new_patch
|
new_version=$major.$minor.$new_patch
|
||||||
|
|
||||||
version_cfg="ProjectVariable\.PROJECT_VERSION=[0-9]*\.[0-9]*\.[0-9]*$"
|
version_cfg="ProjectVariable\.PROJECT_VERSION=[0-9]*\.[0-9]*\.[0-9]*$"
|
||||||
new_version_cfg="ProjectVariable.PROJECT_VERSION="$new_version
|
new_version_cfg="ProjectVariable.PROJECT_VERSION=$new_version"
|
||||||
|
|
||||||
echo "Changing version..."
|
echo "Changing version..."
|
||||||
sed -i -E -e "s/"$version_cfg"/"$new_version_cfg"/g" ./TelosysTools/telosys-tools.cfg
|
sed -i -E -e "s/$version_cfg/$new_version_cfg/g" ./TelosysTools/telosys-tools.cfg
|
||||||
echo $version" -> "$new_version
|
echo "$version -> $new_version"
|
||||||
|
|
||||||
|
TELOSYS_HOME=${TELOSYS_HOME:-/c/Program\ Files/telosys-cli}
|
||||||
|
java -jar "$TELOSYS_HOME/telosys-cli-4.2.0-001.jar" -h . -i input-telosys-cli.txt
|
||||||
|
|
||||||
java -jar /c/Program\ Files/telosys-cli/telosys-cli-4.2.0-001.jar -h . -i input-telosys-cli.txt
|
|
||||||
(cd frontend && npm install && tsup && npm publish)
|
(cd frontend && npm install && tsup && npm publish)
|
||||||
(cd backend && mvn package deploy)
|
(cd backend && mvn package deploy)
|
||||||
(cd persistence && mvn package deploy)
|
(cd persistence && mvn package deploy)
|
||||||
|
|
||||||
echo "Published new version "$new_version
|
echo "Published new version $new_version"
|
||||||
|
|||||||
Reference in New Issue
Block a user