diff --git a/.github/workflows/build-and-test-ee.yml b/.github/workflows/build-and-test-ee.yml index 08102bf6..ae9bf0f0 100644 --- a/.github/workflows/build-and-test-ee.yml +++ b/.github/workflows/build-and-test-ee.yml @@ -1,18 +1,48 @@ name: Build and Test EE -on: [pull_request, workflow_dispatch] + +on: + workflow_dispatch: + inputs: + version: + description: 'Camunda enterprise version to be tested' + snapshot: + description: 'Whether the version is a snapshot' + pull_request: + jobs: build-and-test-ee: if: github.event.pull_request.head.repo.full_name == github.repository || github.event_name == 'workflow_dispatch' - runs-on: ubuntu-18.04 + runs-on: ubuntu-22.04 strategy: matrix: DISTRO: [tomcat, wildfly, run] + PLATFORM: [amd64, arm64] steps: - - uses: actions/checkout@v2 - - name: Execute pipeline + - name: Checkout + uses: actions/checkout@v4 + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + if: ${{ matrix.PLATFORM != 'amd64' }} + with: + platforms: ${{ matrix.PLATFORM }} + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + - name: Build run: ./pipeline.sh env: DISTRO: ${{ matrix.DISTRO }} EE: true + PLATFORM: ${{ matrix.PLATFORM }} NEXUS_PASS: ${{ secrets.NEXUS_PASS }} NEXUS_USER: ${{ secrets.NEXUS_USER }} + VERSION: ${{ github.event.inputs.version }} + SNAPSHOT: ${{ github.event.inputs.snapshot }} + - name: Test + run: ./test.sh + working-directory: test + env: + DISTRO: ${{ matrix.DISTRO }} + EE: true + PLATFORM: ${{ matrix.PLATFORM }} + VERSION: ${{ github.event.inputs.version }} + SNAPSHOT: ${{ github.event.inputs.snapshot }} diff --git a/.github/workflows/build-test-and-publish-ce.yml b/.github/workflows/build-test-and-publish-ce.yml index d8b12dc0..2c15ffea 100644 --- a/.github/workflows/build-test-and-publish-ce.yml +++ b/.github/workflows/build-test-and-publish-ce.yml @@ -2,22 +2,80 @@ name: Build, test, and publish CE on: [pull_request, push, workflow_dispatch] jobs: build-and-test: - runs-on: ubuntu-18.04 + runs-on: ubuntu-22.04 strategy: + fail-fast: false matrix: DISTRO: [tomcat, wildfly, run] + PLATFORM: [amd64, arm64] steps: - - uses: actions/checkout@v2 - - name: Execute pipeline + - name: Checkout + uses: actions/checkout@v4 + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + if: ${{ matrix.PLATFORM != 'amd64' }} + with: + platforms: ${{ matrix.PLATFORM }} + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + - name: Expose GitHub Runtime + uses: actions/github-script@v7 + with: + script: | + Object.keys(process.env).forEach(function (key) { + if (key.startsWith('ACTIONS_')) { + core.info(`${key}=${process.env[key]}`); + core.exportVariable(key, process.env[key]); + } + }); + - name: Build run: ./pipeline.sh env: DISTRO: ${{ matrix.DISTRO }} EE: false - - name: Publish image - if: ${{ github.ref == 'refs/heads/next' || startsWith(github.ref, 'refs/heads/7.') }} + PLATFORM: ${{ matrix.PLATFORM }} + NEXUS_PASS: ${{ secrets.NEXUS_PASS }} + NEXUS_USER: ${{ secrets.NEXUS_USER }} + - name: Test + run: ./test.sh + working-directory: test + env: + DISTRO: ${{ matrix.DISTRO }} + EE: false + PLATFORM: ${{ matrix.PLATFORM }} + publish: + runs-on: ubuntu-20.04 + needs: build-and-test + if: ${{ github.ref == 'refs/heads/next' || startsWith(github.ref, 'refs/heads/7.') }} + strategy: + matrix: + DISTRO: [tomcat, wildfly, run] + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + with: + platforms: arm64,amd64 + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + - name: Expose GitHub Runtime + uses: actions/github-script@v7 + with: + script: | + Object.keys(process.env).forEach(function (key) { + if (key.startsWith('ACTIONS_')) { + core.info(`${key}=${process.env[key]}`); + core.exportVariable(key, process.env[key]); + } + }); + - name: Publish multi-platform images run: ./release.sh env: DISTRO: ${{ matrix.DISTRO }} EE: false + PLATFORMS: linux/arm64,linux/amd64 DOCKER_HUB_PASSWORD: ${{ secrets.DOCKER_HUB_PASSWORD }} DOCKER_HUB_USERNAME: ${{ secrets.DOCKER_HUB_USERNAME }} + NEXUS_PASS: ${{ secrets.NEXUS_PASS }} + NEXUS_USER: ${{ secrets.NEXUS_USER }} diff --git a/.github/workflows/close-stale-issues.yml b/.github/workflows/close-stale-issues.yml new file mode 100644 index 00000000..8710f98c --- /dev/null +++ b/.github/workflows/close-stale-issues.yml @@ -0,0 +1,14 @@ +# This workflow warns and then closes issues and PRs that have had no activity for a specified amount of time. +# +# You can adjust the behavior by modifying this file. +# For more information, see: +# https://github.com/actions/stale +name: 'Close stale issues and PRs' +on: + schedule: + - cron: '0 2 * * 2-6' + workflow_dispatch: # can be used to trigger the workflow manually + +jobs: + call-reusable-flow: + uses: camunda/automation-platform-github-actions/.github/workflows/close-stale-issues.yml@main diff --git a/Dockerfile b/Dockerfile index ce84e5f8..33dee7ce 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,6 +1,6 @@ -FROM alpine:3.15 as builder +FROM alpine:3.18 as builder -ARG VERSION=7.19.0 +ARG VERSION=7.23.0 ARG DISTRO=tomcat ARG SNAPSHOT=true @@ -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 \ @@ -26,13 +29,14 @@ RUN apk add --no-cache \ COPY settings.xml download.sh camunda-run.sh camunda-tomcat.sh camunda-wildfly.sh /tmp/ RUN /tmp/download.sh +COPY camunda-lib.sh /camunda/ ##### FINAL IMAGE ##### -FROM alpine:3.15 +FROM alpine:3.18 -ARG VERSION=7.19.0 +ARG VERSION=7.23.0 ENV CAMUNDA_VERSION=${VERSION} ENV DB_DRIVER= @@ -62,7 +66,7 @@ RUN apk add --no-cache \ bash \ ca-certificates \ curl \ - openjdk11-jre-headless \ + openjdk17-jre-headless \ tzdata \ tini \ xmlstarlet \ diff --git a/README.md b/README.md index ab595d82..c17e9414 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,7 @@ # Camunda Platform Docker images -> :information_source: We will soon disable the GitHub issues on this repository. -> In the future, use our [JIRA issue tracker](https://jira.camunda.com/projects/CAM/issues/CAM-2099?filter=allopenissues) for bug reports or feature requests. -> For help requests, open a help request topic on the [Camunda forum](https://forum.camunda.org/) or [a help request support ticket](https://docs.camunda.org/enterprise/support/#how-to-create-a-support-issue) if you are an enterprise customer. +> Use our [GitHub issue tracker](https://github.com/camunda/camunda-bpm-platform/issues) for bug reports or feature requests. +> For help requests, open a help request topic on the [Camunda forum](https://forum.camunda.org/) or [a help request support ticket](https://camunda.com/services/enterprise-support-guide/#how-to-create-a-support-issue) if you are an enterprise customer. This Camunda project provides docker images of the latest Camunda Platform releases. The images can be used to demonstrate and test the @@ -141,14 +140,17 @@ disables Swagger UI by default. ### Java versions -Our docker images are using the latest LTS OpenJDK version supported by +Our docker images are using a LTS OpenJDK version supported by Camunda Platform. This currently means: - - Camunda 7.12 or later will be based on OpenJDK 11. + - Camunda 7.20 or later will be based on OpenJDK 17. + - Camunda 7.20 image for Camunda Run is supported only for JDK 17. + - Camunda 7.12 - 7.19 is based on OpenJDK 11. + - Camunda 7.19 image for WildFly is supported only for JDK 11 and JDK 17. - All previous versions are based on OpenJDK 8. -While all the OpenJDK versions supported by Camunda will work, we will not -provide a ready to use image for them. +While all the OpenJDK versions supported by Camunda will work with the exceptions specified above, +we will not provide ready to use images for them. #### Java options @@ -158,7 +160,7 @@ be set. ### Use docker memory limits Instead of specifying the Java memory settings it is also possible to instruct -the JVM to respect the docker memory settings. As the image uses Java 11 it does +the JVM to respect the docker memory settings. As the image uses Java 17 it does not have to be enabled explicitly using the `JAVA_OPTS` environment variable. If you want to set the memory limits manually you can restore the pre-Java-11-behavior by setting the following environment variable. @@ -190,8 +192,8 @@ variables: Make sure that `DB_PASSWORD` is not set when using this variable! - `SKIP_DB_CONFIG` skips the automated database configuration to use manual configuration -- `WAIT_FOR` wait for a `host:port` to be available over TCP before starting -- `WAIT_FOR_TIMEOUT` how long to wait for the service to be avaiable - defaults to 30 seconds +- `WAIT_FOR` wait for a `host:port` to be available over TCP before starting. Check [Waiting for database](#waiting-for-database) for details. +- `WAIT_FOR_TIMEOUT` how long to wait for the service to be avaiable - defaults to 30 seconds. Check [Waiting for database](#waiting-for-database) for details. For example, to use a `postgresql` docker image as database you can start the platform as follows: @@ -245,14 +247,19 @@ docker run -d --name camunda -p 8080:8080 -e SKIP_DB_CONFIG=true \ Starting the Camunda Platform Docker image requires the database to be already available. This is quite a challenge when the database and Camunda Platform are -both docker containers spawned simultaneously, for example, by `docker-compose` +both docker containers spawned simultaneously, for example, by `docker compose` or inside a Kubernetes Pod. To help with that, the Camunda Platform Docker image includes [wait-for-it.sh](https://github.com/vishnubob/wait-for-it) to allow the container to wait until a 'host:port' is ready. The mechanism can be configured by two environment variables: -- `WAIT_FOR`: the service `host:port` to wait for - `WAIT_FOR_TIMEOUT`: how long to wait for the service to be available in seconds +- `WAIT_FOR`: the service `host:port` to wait for. You can provide multiple +host-port pairs separated by a comma or an empty space (Example: +`"host1:port1 host2:port2"`). +The `WAIT_FOR_TIMEOUT` applies to each specified host, i.e. Camunda will wait for +`host1:port1` to become available and, if unavailable for the complete `WAIT_FOR_TIMEOUT` +duration, will wait for `host2:port2` for another `WAIT_FOR_TIMEOUT` period. Example with a PostgreSQL container: @@ -305,8 +312,11 @@ docker run -d --name camunda -p 8080:8080 \ ## Build -You can use the image to build a Docker image for a given Camunda Platform -version and distribution. +You can build a Docker image for a given Camunda Platform version and distribution yourself. +Make sure to adjust the [settings.xml](settings.xml) and remove the `camunda-nexus` mirror +(no matter if you are building a community or enterprise edition). +If you want to build the enterprise edition (EE), +check out [the dedicated README section](#build-an-enterprise-version). ### Build a released version @@ -341,8 +351,8 @@ docker build -t camunda-bpm-platform \ ### Build an enterprise version -If you are a Camunda enterprise customer, you can use this image to build -an enterprise version of the Docker image. Therefore, set the `VERSION` +If you are a Camunda enterprise customer, you can build +an enterprise version of the Docker image. Set the `VERSION` build argument to the Camunda version without the ee suffix, i.e. `7.16.1`, set the `EE` build argument to `true` and the `USER` and `PASSWORD` build argument to your enterprise credentials. @@ -386,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 diff --git a/camunda-lib.sh b/camunda-lib.sh new file mode 100644 index 00000000..7e93a7b1 --- /dev/null +++ b/camunda-lib.sh @@ -0,0 +1,18 @@ +wait_for_it() { + if [ -n "${WAIT_FOR}" ]; then + found=0 + for host_port in $(echo "${WAIT_FOR}" | tr ',' '\n'); do + if wait-for-it.sh "$host_port" -s -t ${WAIT_FOR_TIMEOUT} ; then + echo "$host_port available" + found=1 + break + else + echo "$host_port not available" + fi + done + if [ "$found" -eq 0 ] ; then + echo "No connection available in WAIT_FOR=$WAIT_FOR" + exit 1 + fi + fi +} diff --git a/camunda-run.sh b/camunda-run.sh index 85d8e3b6..803db9ec 100755 --- a/camunda-run.sh +++ b/camunda-run.sh @@ -3,6 +3,8 @@ set -Eeu trap 'Error on line $LINENO' ERR +source $(dirname "$0")/camunda-lib.sh + # Set Password as Docker Secrets for Swarm-Mode if [[ -z "${DB_PASSWORD:-}" && -n "${DB_PASSWORD_FILE:-}" && -f "${DB_PASSWORD_FILE:-}" ]]; then export DB_PASSWORD="$(< "${DB_PASSWORD_FILE}")" @@ -30,9 +32,7 @@ fi CMD="/camunda/internal/run.sh start" -if [ -n "${WAIT_FOR}" ]; then - CMD="wait-for-it.sh ${WAIT_FOR} -s -t ${WAIT_FOR_TIMEOUT} -- ${CMD}" -fi +wait_for_it # shellcheck disable=SC2086 exec ${CMD} "$@" diff --git a/camunda-tomcat.sh b/camunda-tomcat.sh index 51b1d5d2..c27c287a 100755 --- a/camunda-tomcat.sh +++ b/camunda-tomcat.sh @@ -3,6 +3,8 @@ set -Eeu trap 'Error on line $LINENO' ERR +source $(dirname "$0")/camunda-lib.sh + # Use existing tomcat distribution if present.. CATALINA_HOME="${CATALINA_HOME:-/camunda}" @@ -58,9 +60,7 @@ fi CMD+=" run" -if [ -n "${WAIT_FOR}" ]; then - CMD="wait-for-it.sh ${WAIT_FOR} -s -t ${WAIT_FOR_TIMEOUT} -- ${CMD}" -fi +wait_for_it # shellcheck disable=SC2086 exec ${CMD} diff --git a/camunda-wildfly.sh b/camunda-wildfly.sh index ded70e94..1c692c8f 100755 --- a/camunda-wildfly.sh +++ b/camunda-wildfly.sh @@ -3,6 +3,8 @@ set -Eeu trap 'Error on line $LINENO' ERR +source $(dirname "$0")/camunda-lib.sh + # Set default values for DB_ variables # Set Password as Docker Secrets for Swarm-Mode if [[ -z "${DB_PASSWORD:-}" && -n "${DB_PASSWORD_FILE:-}" && -f "${DB_PASSWORD_FILE:-}" ]]; then @@ -80,9 +82,7 @@ if [ "$JMX_PROMETHEUS" = "true" ] ; then export PREPEND_JAVA_OPTS="${PREPEND_JAVA_OPTS} -javaagent:/camunda/javaagent/jmx_prometheus_javaagent.jar=${JMX_PROMETHEUS_PORT}:${JMX_PROMETHEUS_CONF}" fi -if [ -n "${WAIT_FOR}" ]; then - CMD="wait-for-it.sh ${WAIT_FOR} -s -t ${WAIT_FOR_TIMEOUT} -- ${CMD}" -fi +wait_for_it # shellcheck disable=SC2086 exec ${CMD} diff --git a/download.sh b/download.sh index b75307a0..2d831219 100755 --- a/download.sh +++ b/download.sh @@ -82,12 +82,16 @@ 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 \ - -Dartifact="mysql:mysql-connector-java:${MYSQL_VERSION}:jar" \ + -Dartifact="com.mysql:mysql-connector-j:${MYSQL_VERSION}:jar" \ -DoutputDirectory=/tmp/ mvn dependency:copy -B \ $PROXY \ @@ -100,8 +104,8 @@ case ${DISTRO} in batch embed-server --std-out=echo -module add --name=mysql.mysql-connector-java --slot=main --resources=/tmp/mysql-connector-java-${MYSQL_VERSION}.jar --dependencies=javax.api,javax.transaction.api -/subsystem=datasources/jdbc-driver=mysql:add(driver-name="mysql",driver-module-name="mysql.mysql-connector-java",driver-xa-datasource-class-name=com.mysql.cj.jdbc.MysqlXADataSource) +module add --name=com.mysql.mysql-connector-j --slot=main --resources=/tmp/mysql-connector-j-${MYSQL_VERSION}.jar --dependencies=javax.api,javax.transaction.api +/subsystem=datasources/jdbc-driver=mysql:add(driver-name="mysql",driver-module-name="com.mysql.mysql-connector-j",driver-xa-datasource-class-name=com.mysql.cj.jdbc.MysqlXADataSource) module add --name=org.postgresql.postgresql --slot=main --resources=/tmp/postgresql-${POSTGRESQL_VERSION}.jar --dependencies=javax.api,javax.transaction.api /subsystem=datasources/jdbc-driver=postgresql:add(driver-name="postgresql",driver-module-name="org.postgresql.postgresql",driver-xa-datasource-class-name=org.postgresql.xa.PGXADataSource) @@ -112,11 +116,11 @@ EOF rm -rf /camunda/standalone/configuration/standalone_xml_history/current/* ;; run*) - cp /tmp/mysql-connector-java-${MYSQL_VERSION}.jar /camunda/configuration/userlib + cp /tmp/mysql-connector-j-${MYSQL_VERSION}.jar /camunda/configuration/userlib cp /tmp/postgresql-${POSTGRESQL_VERSION}.jar /camunda/configuration/userlib ;; tomcat*) - cp /tmp/mysql-connector-java-${MYSQL_VERSION}.jar /camunda/lib + cp /tmp/mysql-connector-j-${MYSQL_VERSION}.jar /camunda/lib cp /tmp/postgresql-${POSTGRESQL_VERSION}.jar /camunda/lib # remove default CATALINA_OPTS from environment settings echo "" > /camunda/bin/setenv.sh diff --git a/pipeline.sh b/pipeline.sh index 06cc6879..23bcad77 100755 --- a/pipeline.sh +++ b/pipeline.sh @@ -1,10 +1,32 @@ -#!/bin/bash - -docker build . \ - -t camunda/camunda-bpm-platform:${DISTRO} \ +#!/bin/bash -ex + +EE=${EE:-false} + +if [ -z "$SNAPSHOT" ]; then + SNAPSHOT_ARGUMENT="" +else + SNAPSHOT_ARGUMENT="--build-arg SNAPSHOT=${SNAPSHOT}" +fi + +if [ -z "$VERSION" ]; then + VERSION_ARGUMENT="" +else + VERSION_ARGUMENT="--build-arg VERSION=${VERSION}" +fi + +IMAGE_NAME=camunda/camunda-bpm-platform:${DISTRO}-${PLATFORM} + +docker buildx build . \ + -t "${IMAGE_NAME}" \ + --platform linux/${PLATFORM} \ --build-arg DISTRO=${DISTRO} \ --build-arg EE=${EE} \ --build-arg USER=${NEXUS_USER} \ - --build-arg PASSWORD=${NEXUS_PASS} + --build-arg PASSWORD=${NEXUS_PASS} \ + ${VERSION_ARGUMENT} \ + ${SNAPSHOT_ARGUMENT} \ + --cache-to type=gha,scope="$GITHUB_REF_NAME-$DISTRO-image" \ + --cache-from type=gha,scope="$GITHUB_REF_NAME-$DISTRO-image" \ + --load -./test/test.sh +docker inspect "${IMAGE_NAME}" | grep "Architecture" -A2 diff --git a/release.sh b/release.sh index 586e668b..915cb646 100755 --- a/release.sh +++ b/release.sh @@ -4,13 +4,27 @@ EE=${EE:-false} VERSION=${VERSION:-$(grep VERSION= Dockerfile | head -n1 | cut -d = -f 2)} DISTRO=${DISTRO:-$(grep DISTRO= Dockerfile | cut -d = -f 2)} SNAPSHOT=${SNAPSHOT:-$(grep SNAPSHOT= Dockerfile | cut -d = -f 2)} +PLATFORMS=${PLATFORMS:-linux/amd64} +NEXUS_USER=${NEXUS_USER:-} +NEXUS_PASS=${NEXUS_PASS:-} IMAGE=camunda/camunda-bpm-platform -function tag_and_push { - local tag=${1} - docker tag ${IMAGE}:${DISTRO} ${IMAGE}:${tag} - docker push ${IMAGE}:${tag} +function build_and_push { + local tags=("$@") + printf -v tag_arguments -- "--tag $IMAGE:%s " "${tags[@]}" + docker buildx build . \ + $tag_arguments \ + --build-arg DISTRO=${DISTRO} \ + --build-arg EE=${EE} \ + --build-arg USER=${NEXUS_USER} \ + --build-arg PASSWORD=${NEXUS_PASS} \ + --cache-from type=gha,scope="$GITHUB_REF_NAME-$DISTRO-image" \ + --platform $PLATFORMS \ + --push + + echo "Tags released:" >> $GITHUB_STEP_SUMMARY + printf -- "- $IMAGE:%s\n" "${tags[@]}" >> $GITHUB_STEP_SUMMARY } if [ "${EE}" = "true" ]; then @@ -26,31 +40,35 @@ fi docker login -u "${DOCKER_HUB_USERNAME}" -p "${DOCKER_HUB_PASSWORD}" +tags=() + if [ "${SNAPSHOT}" = "true" ]; then - tag_and_push "${DISTRO}-${VERSION}-SNAPSHOT" - tag_and_push "${DISTRO}-SNAPSHOT" + tags+=("${DISTRO}-${VERSION}-SNAPSHOT") + tags+=("${DISTRO}-SNAPSHOT") if [ "${DISTRO}" = "tomcat" ]; then - tag_and_push "${VERSION}-SNAPSHOT" - tag_and_push "SNAPSHOT" + tags+=("${VERSION}-SNAPSHOT") + tags+=("SNAPSHOT") fi else - tag_and_push "${DISTRO}-${VERSION}" + tags+=("${DISTRO}-${VERSION}") if [ "${DISTRO}" = "tomcat" ]; then - tag_and_push "${VERSION}" + tags+=("${VERSION}") fi fi # Latest Docker image is created and pushed just once when a new version is relased. # Latest tag refers to the latest minor release of Camunda Platform. # https://github.com/camunda/docker-camunda-bpm-platform/blob/next/README.md#supported-tagsreleases -# The 1st condition matches only when the version branch is the same as the main branch. +# The 1st condition matches only when the version branch is the same as the main branch. git fetch origin next if [ $(git rev-parse HEAD) = $(git rev-parse FETCH_HEAD) ] && [ "${SNAPSHOT}" = "false" ]; then # tagging image as latest - tag_and_push "${DISTRO}-latest" - tag_and_push "${DISTRO}" + tags+=("${DISTRO}-latest") + tags+=("${DISTRO}") if [ "${DISTRO}" = "tomcat" ]; then - tag_and_push "latest" + tags+=("latest") fi fi + +build_and_push "${tags[@]}" diff --git a/settings.xml b/settings.xml index 3124e7d6..604fb49e 100644 --- a/settings.xml +++ b/settings.xml @@ -10,4 +10,12 @@ ${env.PASSWORD} + + + camunda-nexus + camunda-nexus + Camunda Nexus + https://repository.nexus.camunda.cloud/content/groups/internal/ + + diff --git a/test/docker-compose.yml b/test/docker-compose.yml index 082e4899..25dd79f5 100644 --- a/test/docker-compose.yml +++ b/test/docker-compose.yml @@ -1,17 +1,19 @@ -version: '3' +version: '2.4' services: camunda: - image: camunda/camunda-bpm-platform:${DISTRO:-latest} + image: camunda/camunda-bpm-platform:${DISTRO}-${PLATFORM} + platform: linux/${PLATFORM} ports: - "8080:8080" restart: unless-stopped camunda-mysql: - image: camunda/camunda-bpm-platform:${DISTRO:-latest} + image: camunda/camunda-bpm-platform:${DISTRO}-${PLATFORM} + platform: linux/${PLATFORM} environment: - DB_DRIVER=com.mysql.cj.jdbc.Driver - - DB_URL=jdbc:mysql://mysql:3306/process-engine?sendFractionalSeconds=false + - DB_URL=jdbc:mysql://mysql:3306/process-engine?sendFractionalSeconds=false&sessionVariables=transaction_isolation='READ-COMMITTED' - DB_USERNAME=camunda - DB_PASSWORD=camunda - WAIT_FOR=mysql:3306 @@ -22,7 +24,8 @@ services: restart: unless-stopped camunda-postgres: - image: camunda/camunda-bpm-platform:${DISTRO:-latest} + image: camunda/camunda-bpm-platform:${DISTRO}-${PLATFORM} + platform: linux/${PLATFORM} environment: - DB_DRIVER=org.postgresql.Driver - DB_URL=jdbc:postgresql://postgres:5432/camunda @@ -36,7 +39,8 @@ services: restart: unless-stopped camunda-debug: - image: camunda/camunda-bpm-platform:${DISTRO:-latest} + image: camunda/camunda-bpm-platform:${DISTRO}-${PLATFORM} + platform: linux/${PLATFORM} environment: - DEBUG=true ports: @@ -45,7 +49,8 @@ services: restart: unless-stopped camunda-prometheus-jmx: - image: camunda/camunda-bpm-platform:${DISTRO:-latest} + image: camunda/camunda-bpm-platform:${DISTRO}-${PLATFORM} + platform: linux/${PLATFORM} environment: - JMX_PROMETHEUS=true ports: @@ -54,10 +59,11 @@ services: restart: unless-stopped camunda-password-file: - image: camunda/camunda-bpm-platform:${DISTRO:-latest} + image: camunda/camunda-bpm-platform:${DISTRO}-${PLATFORM} + platform: linux/${PLATFORM} environment: - DB_DRIVER=com.mysql.cj.jdbc.Driver - - DB_URL=jdbc:mysql://mysql:3306/process-engine?sendFractionalSeconds=false + - DB_URL=jdbc:mysql://mysql:3306/process-engine?sendFractionalSeconds=false&sessionVariables=transaction_isolation='READ-COMMITTED' - DB_USERNAME=camunda - DB_PASSWORD_FILE=/run/secrets/camunda_db_password - WAIT_FOR=mysql:3306 @@ -70,7 +76,7 @@ services: restart: unless-stopped mysql: - image: mysql:5.7 + image: mysql:8.0 environment: - MYSQL_ROOT_PASSWORD=camunda - MYSQL_USER=camunda @@ -78,7 +84,7 @@ services: - MYSQL_DATABASE=process-engine postgres: - image: postgres:9.6 + image: postgres:15 environment: - POSTGRES_USER=camunda - POSTGRES_PASSWORD=camunda diff --git a/test/test-wildfly.sh b/test/test-wildfly.sh index 46b6b388..2df7a47f 100755 --- a/test/test-wildfly.sh +++ b/test/test-wildfly.sh @@ -10,7 +10,7 @@ poll_log 'started in' 'started (with errors) in' || _exit 1 "Server not started" _log "Server started" -grep_log 'Deployed "camunda-example-invoice-7.' || _exit 2 "Process application not deployed" +grep_log 'Deployed "camunda-example-invoice-jakarta-7.' || _exit 2 "Process application not deployed" _log "Process application deployed" diff --git a/test/test.sh b/test/test.sh index 9bee51a8..bb8a4b9f 100755 --- a/test/test.sh +++ b/test/test.sh @@ -3,6 +3,9 @@ DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd ) cd ${DIR} + +source test_helper.sh + docker-compose up --force-recreate -d postgres mysql ./test-${DISTRO}.sh camunda ./test-${DISTRO}.sh camunda-mysql diff --git a/test/testEncoding.bpmn b/test/testEncoding.bpmn index d14d231b..deb7100a 100644 --- a/test/testEncoding.bpmn +++ b/test/testEncoding.bpmn @@ -1,6 +1,7 @@ - - + + SequenceFlow_0anotay diff --git a/test/test_helper.sh b/test/test_helper.sh index c56cc704..0a1e0925 100644 --- a/test/test_helper.sh +++ b/test/test_helper.sh @@ -1,6 +1,13 @@ #!/bin/bash -eu -RETRIES=20 +RETRIES=100 WAIT=5 + +GHA=${GITHUB_ACTIONS:-false} +if [ "${GHA}" = "true" ]; then + shopt -s expand_aliases + alias docker-compose="docker compose" +fi + function _log { >&2 echo $@ } @@ -57,9 +64,9 @@ function create_user { function test_login { logger "Attempting login to http://localhost:8080/camunda/api/admin/auth/user/default/login/${1}" rm -f dumped-headers.txt - curl --dump-header dumped-headers.txt --fail -s -o/dev/null http://localhost:8080/camunda/app/${1}/default/ + curl --dump-header dumped-headers.txt --fail -s -o/dev/null http://127.0.0.1:8080/camunda/app/${1}/default/ # dumped-headers.txt uses windows line endings, drop them - curl --cookie dumped-headers.txt -H "$(cat dumped-headers.txt | grep X-XSRF-TOKEN | tr -d '\r\n')" -H "Accept: application/json" --fail -s --data 'username=demo&password=demo' -o/dev/null http://localhost:8080/camunda/api/admin/auth/user/default/login/${1} + curl --cookie dumped-headers.txt -H "$(cat dumped-headers.txt | grep X-XSRF-TOKEN | tr -d '\r\n')" -H "Accept: application/json" --fail -s --data 'username=demo&password=demo' -o/dev/null http://127.0.0.1:8080/camunda/api/admin/auth/user/default/login/${1} } function test_encoding {