Skip to content

Commit

Permalink
Set version to draft in develop Dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
dodinh committed Mar 26, 2024
1 parent 5f81fb1 commit b93bbff
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

* [Codelist] Extend `plu:docType` to describe values from https://www.xrepository.de/details/urn:xoev-de:xplanverfahren:codeliste:verfahrensunterlagentyp
* [Website] Fix links to DCAT-AP.PLU documentation
* [Deployment] Set draft version for development

## 2024-02-28 - 0.1.4

Expand Down
2 changes: 1 addition & 1 deletion docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
FROM alpine:3.18.6

ENV LIGHTTPD_VERSION=1.4.73-r0
ENV DCATAPPLU_VERSION=0.1.4
ENV DCATAPPLU_VERSION=../drafts/0.0.1-draft-0.1

RUN addgroup -S --gid 1000 lighttpd \
&& adduser -S -G lighttpd --uid 1000 lighttpd
Expand Down
10 changes: 8 additions & 2 deletions drafts/0.0.1-draft-0.1/release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,8 @@ fi

# build new version number
git fetch --prune --tags
DRAFT_VERSION="../drafts/0.0.1-draft-0.1"
ESC_DRAFT_VERSION="\.\./drafts/0\.0\.1-draft-0\.1"
LATEST_VERSION=$(git describe --abbrev=0 --tags main)
VERSION_ARRAY=( ${LATEST_VERSION//./ } )
ESC_LATEST_VERSION="${VERSION_ARRAY[0]}\.${VERSION_ARRAY[1]}\.${VERSION_ARRAY[2]}"
Expand Down Expand Up @@ -135,7 +137,7 @@ sed -i "s@version: x.y.z@version: ${NEXT_VERSION}@g" releases/${NEXT_VERSION}/ap
# in the new version folder, change the version in `README.md`
sed -i "s@DCAT-AP\.PLU v\?${ESC_LATEST_VERSION}@DCAT-AP.PLU ${NEXT_VERSION}@g" releases/${NEXT_VERSION}/README.md
# update the `DCATAPPLU_VERSION` in the Dockerfile
sed -i "s@ENV DCATAPPLU_VERSION=${ESC_LATEST_VERSION}@ENV DCATAPPLU_VERSION=${NEXT_VERSION}@g" docker/Dockerfile
sed -i "s@ENV DCATAPPLU_VERSION=${ESC_DRAFT_VERSION}@ENV DCATAPPLU_VERSION=${NEXT_VERSION}@g" docker/Dockerfile

# commit, merge, tag new release
echo
Expand All @@ -147,9 +149,13 @@ git tag -a ${NEXT_VERSION} -m "Release ${NEXT_VERSION}"

# prepare next dev version
git checkout develop
echo -e "\nUpdating changelog ..."
sed -i "s@# Changelog@# Changelog\n\n## xxxx-xx-xx - dev\n\n...@g" CHANGELOG.md
git add CHANGELOG.md
git commit -m "Prepare changelog for development"
echo -e "\nUpdating version in Dockerfile ..."
sed -i "s@ENV DCATAPPLU_VERSION=${NEXT_VERSION}@ENV DCATAPPLU_VERSION=${DRAFT_VERSION}@g" docker/Dockerfile
git add docker/Dockerfile
git commit -m "Set next development version"

echo -e "\nThe new ${VERSION_TYPE} release ${NEXT_VERSION} has been created locally."
echo "Next steps:"
Expand Down

0 comments on commit b93bbff

Please sign in to comment.