Skip to content

Commit

Permalink
feat(database): add mysql and postgresql version arguments (#296)
Browse files Browse the repository at this point in the history
  • Loading branch information
punitdarira authored May 6, 2024
1 parent 24d3a33 commit 4769f12
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 2 deletions.
3 changes: 3 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ ARG MAVEN_PROXY_PORT
ARG MAVEN_PROXY_USER
ARG MAVEN_PROXY_PASSWORD

ARG POSTGRESQL_VERSION
ARG MYSQL_VERSION

ARG JMX_PROMETHEUS_VERSION=0.12.0

RUN apk add --no-cache \
Expand Down
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -396,6 +396,17 @@ docker build -t camunda-bpm-platform \
--build-arg MAVEN_PROXY_PASSWORD=${PROXY_PASSWORD} \
.
```
### Override MySQL and PostgreSQL driver versions.
By default, the driver versions are fetched from https://github.com/camunda/camunda-bpm-platform/blob/master/database/pom.xml. That can be overriden by passing `MYSQL_VERSION` and `POSTGRESQL_VERSION` build args

```
docker build -t camunda-bpm-platform \
--build-arg DISTRO=${DISTRO} \
--build-arg VERSION=${VERSION} \
--build-arg POSTGRESQL_VERSION=${POSTGRESQL_VERSION} \
--build-arg MYSQL_VERSION=${MYSQL_VERSION} \
.
```

## Use cases

Expand Down
8 changes: 6 additions & 2 deletions download.sh
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,12 @@ mvn dependency:get -U -B --global-settings /tmp/settings.xml \
-DgroupId="org.camunda.bpm" -DartifactId="camunda-database-settings" \
-Dversion="${ARTIFACT_VERSION}" -Dpackaging="pom" -Dtransitive=false
cambpmdbsettings_pom_file=$(find /m2-repository -name "camunda-database-settings-${ARTIFACT_VERSION}.pom" -print | head -n 1)
MYSQL_VERSION=$(xmlstarlet sel -t -v //_:version.mysql $cambpmdbsettings_pom_file)
POSTGRESQL_VERSION=$(xmlstarlet sel -t -v //_:version.postgresql $cambpmdbsettings_pom_file)
if [ -z "$MYSQL_VERSION" ]; then
MYSQL_VERSION=$(xmlstarlet sel -t -v //_:version.mysql $cambpmdbsettings_pom_file)
fi
if [ -z "$POSTGRESQL_VERSION" ]; then
POSTGRESQL_VERSION=$(xmlstarlet sel -t -v //_:version.postgresql $cambpmdbsettings_pom_file)
fi

mvn dependency:copy -B \
$PROXY \
Expand Down

0 comments on commit 4769f12

Please sign in to comment.