-
-
Notifications
You must be signed in to change notification settings - Fork 435
Expand file tree
/
Copy pathupgrade_geoserver_version.sh
More file actions
executable file
·32 lines (18 loc) · 882 Bytes
/
upgrade_geoserver_version.sh
File metadata and controls
executable file
·32 lines (18 loc) · 882 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#!/bin/bash
GS_VERSION=$1
if [ -f "${GS_VERSION}" ]; then
rm "${GS_VERSION}"
fi
GS_NEW_VERSION=$2
if [ -f "${GS_NEW_VERSION}" ]; then
rm "${GS_NEW_VERSION}"
fi
sed -i "s/${GS_VERSION}/${GS_NEW_VERSION}/g" "Dockerfile"
sed -i "s/${GS_VERSION}/${GS_NEW_VERSION}/g" "README.md"
sed -i "s/${GS_VERSION}/${GS_NEW_VERSION}/g" ".env"
sed -i "s/${GS_VERSION}/${GS_NEW_VERSION}/g" "clustering/docker-compose.yml"
sed -i "s/${GS_VERSION}/${GS_NEW_VERSION}/g" "clustering/docker-compose-external.yml"
IFS='.' read -r MAJOR MINOR BUGFIX <<<"$GS_NEW_VERSION"
sed -i "s/minor: .*/minor: $MINOR/g; s/patch: .*/patch: $BUGFIX/g" ".github/workflows/deploy-image.yaml"
sed -i "s/minor: .*/minor: $MINOR/g; s/patch: .*/patch: $BUGFIX/g" ".github/workflows//build-latest.yaml"
git commit -a -m "Upgraded the GeoServer instance from version ${GS_VERSION} to ${GS_NEW_VERSION}"