commit
a617492f5a
|
|
@ -0,0 +1 @@
|
||||||
|
build/
|
||||||
16
README.md
16
README.md
|
|
@ -225,3 +225,19 @@ Push to osgeo repository:
|
||||||
```shell
|
```shell
|
||||||
docker push geoserver-docker.osgeo.org/geoserver:2.21.1
|
docker push geoserver-docker.osgeo.org/geoserver:2.21.1
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### How to automate release?
|
||||||
|
|
||||||
|
For CI purposes, the script in the `build` folder is used to simplify those steps.
|
||||||
|
|
||||||
|
The variables `DOCKERUSER` and `DOCKERPASSWORD` have to be set with valid credentials before this script can push the image to the osgeo repo.
|
||||||
|
|
||||||
|
You need to pass the version as first and the type as second argument, where type has to be one of `build`, `publish` or `buildandpublish`.
|
||||||
|
|
||||||
|
Examples:
|
||||||
|
|
||||||
|
`./release.sh 2.22.1 build`
|
||||||
|
|
||||||
|
`./release.sh 2.22.0 publish`
|
||||||
|
|
||||||
|
`./release.sh 2.22.1 buildandpublish`
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,34 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# error out if any statements fail
|
||||||
|
set -e
|
||||||
|
|
||||||
|
function usage() {
|
||||||
|
echo "$0 [options] <version>"
|
||||||
|
echo " version : The released version to build an docker image for (eg: 2.1.4)"
|
||||||
|
echo " mode : The mode. Choose one of 'build', 'publish' or 'buildandpublish'"
|
||||||
|
}
|
||||||
|
|
||||||
|
if [ -z $1 ] || [ -z $2 ] || [[ $2 != "build" && $2 != "publish" && $2 != "buildandpublish" ]]; then
|
||||||
|
usage
|
||||||
|
exit
|
||||||
|
fi
|
||||||
|
|
||||||
|
VERSION=$1
|
||||||
|
TAG=geoserver-docker.osgeo.org/geoserver:$VERSION
|
||||||
|
|
||||||
|
# Go up one level to the Dockerfile
|
||||||
|
cd ".."
|
||||||
|
|
||||||
|
if [ $2 != "publish" ]; then
|
||||||
|
echo "Building GeoServer Docker Image..."
|
||||||
|
echo "docker build --build-arg GS_VERSION=$VERSION -t $TAG ."
|
||||||
|
docker build --build-arg GS_VERSION=$VERSION -t $TAG .
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ $2 != "build" ]; then
|
||||||
|
echo "Publishing GeoServer Docker Image..."
|
||||||
|
echo $DOCKERPASSWORD | docker login -u $DOCKERUSER --password-stdin geoserver-docker.osgeo.org
|
||||||
|
echo "docker push $TAG"
|
||||||
|
docker push $TAG
|
||||||
|
fi
|
||||||
Loading…
Reference in New Issue