diff --git a/.github/workflows/build-and-test-ee.yml b/.github/workflows/build-and-test-ee.yml index ae9bf0f0..bd8d3596 100644 --- a/.github/workflows/build-and-test-ee.yml +++ b/.github/workflows/build-and-test-ee.yml @@ -12,27 +12,25 @@ on: jobs: build-and-test-ee: if: github.event.pull_request.head.repo.full_name == github.repository || github.event_name == 'workflow_dispatch' - runs-on: ubuntu-22.04 + runs-on: ${{ matrix.PLATFORM }} strategy: matrix: DISTRO: [tomcat, wildfly, run] - PLATFORM: [amd64, arm64] + PLATFORM: [ubuntu-22.04, aws-arm-core-4-default] steps: - name: Checkout uses: actions/checkout@v4 - - name: Set up QEMU - uses: docker/setup-qemu-action@v3 - if: ${{ matrix.PLATFORM != 'amd64' }} + - name: Login to Docker Hub + uses: docker/login-action@v3 + if: ${{ matrix.PLATFORM == 'aws-arm-core-4-default' }} with: - platforms: ${{ matrix.PLATFORM }} - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v3 + username: ${{ secrets.DOCKER_HUB_USERNAME }} + password: ${{ secrets.DOCKER_HUB_PASSWORD }} - 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 }} @@ -43,6 +41,5 @@ jobs: 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 2c15ffea..9a01948d 100644 --- a/.github/workflows/build-test-and-publish-ce.yml +++ b/.github/workflows/build-test-and-publish-ce.yml @@ -2,38 +2,26 @@ name: Build, test, and publish CE on: [pull_request, push, workflow_dispatch] jobs: build-and-test: - runs-on: ubuntu-22.04 + runs-on: ${{ matrix.PLATFORM }} strategy: fail-fast: false matrix: DISTRO: [tomcat, wildfly, run] - PLATFORM: [amd64, arm64] + PLATFORM: [ubuntu-22.04, aws-arm-core-4-default] steps: - name: Checkout uses: actions/checkout@v4 - - name: Set up QEMU - uses: docker/setup-qemu-action@v3 - if: ${{ matrix.PLATFORM != 'amd64' }} + - name: Login to Docker Hub + uses: docker/login-action@v3 + if: ${{ matrix.PLATFORM == 'aws-arm-core-4-default' }} 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]); - } - }); + username: ${{ secrets.DOCKER_HUB_USERNAME }} + password: ${{ secrets.DOCKER_HUB_PASSWORD }} - name: Build run: ./pipeline.sh env: DISTRO: ${{ matrix.DISTRO }} EE: false - PLATFORM: ${{ matrix.PLATFORM }} NEXUS_PASS: ${{ secrets.NEXUS_PASS }} NEXUS_USER: ${{ secrets.NEXUS_USER }} - name: Test @@ -42,25 +30,22 @@ jobs: env: DISTRO: ${{ matrix.DISTRO }} EE: false - PLATFORM: ${{ matrix.PLATFORM }} publish: - runs-on: ubuntu-20.04 + runs-on: aws-arm-core-4-default needs: build-and-test - if: ${{ github.ref == 'refs/heads/next' || startsWith(github.ref, 'refs/heads/7.') }} + #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 + with: + platforms: linux/arm64,linux/amd64 - name: Expose GitHub Runtime - uses: actions/github-script@v7 + uses: actions/github-script@v6 with: script: | Object.keys(process.env).forEach(function (key) { diff --git a/pipeline.sh b/pipeline.sh index 23bcad77..d1ea0973 100755 --- a/pipeline.sh +++ b/pipeline.sh @@ -14,19 +14,19 @@ else VERSION_ARGUMENT="--build-arg VERSION=${VERSION}" fi -IMAGE_NAME=camunda/camunda-bpm-platform:${DISTRO}-${PLATFORM} +IMAGE_NAME=camunda/camunda-bpm-platform:${DISTRO} -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} \ - ${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 +echo "Runner architecture: $(uname -m)" + +echo "::group::Docker build" +docker build . \ + -t "${IMAGE_NAME}" \ + --build-arg DISTRO=${DISTRO} \ + --build-arg EE=${EE} \ + --build-arg USER=${NEXUS_USER} \ + --build-arg PASSWORD=${NEXUS_PASS} \ + ${VERSION_ARGUMENT} \ + ${SNAPSHOT_ARGUMENT} +echo "::endgroup::" docker inspect "${IMAGE_NAME}" | grep "Architecture" -A2 diff --git a/release.sh b/release.sh index 915cb646..b2a008c8 100755 --- a/release.sh +++ b/release.sh @@ -11,20 +11,22 @@ NEXUS_PASS=${NEXUS_PASS:-} IMAGE=camunda/camunda-bpm-platform function build_and_push { + echo "::group::Docker build 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 + docker buildx build . \ + $tag_arguments \ + --build-arg DISTRO=${DISTRO} \ + --build-arg EE=${EE} \ + --build-arg USER=${NEXUS_USER} \ + --build-arg PASSWORD=${NEXUS_PASS} \ + --cache-to type=gha,scope="$GITHUB_REF_NAME-$DISTRO-image" \ + --cache-from type=gha,scope="$GITHUB_REF_NAME-$DISTRO-image" \ + --platform $PLATFORMS + echo "::endgroup::" - echo "Tags released:" >> $GITHUB_STEP_SUMMARY - printf -- "- $IMAGE:%s\n" "${tags[@]}" >> $GITHUB_STEP_SUMMARY + echo "Tags released:" >> $GITHUB_STEP_SUMMARY + printf -- "- $IMAGE:%s\n" "${tags[@]}" >> $GITHUB_STEP_SUMMARY } if [ "${EE}" = "true" ]; then @@ -38,7 +40,7 @@ if [ $(docker manifest inspect $IMAGE:${DISTRO}-${VERSION} > /dev/null ; echo $? exit 0 fi -docker login -u "${DOCKER_HUB_USERNAME}" -p "${DOCKER_HUB_PASSWORD}" +#docker login -u "${DOCKER_HUB_USERNAME}" -p "${DOCKER_HUB_PASSWORD}" tags=() diff --git a/test/docker-compose.yml b/test/docker-compose.yml index 91fd8585..9ad33f06 100644 --- a/test/docker-compose.yml +++ b/test/docker-compose.yml @@ -2,15 +2,13 @@ version: '2.4' services: camunda: - image: camunda/camunda-bpm-platform:${DISTRO}-${PLATFORM} - platform: linux/${PLATFORM} + image: camunda/camunda-bpm-platform:${DISTRO} ports: - "8080:8080" restart: unless-stopped camunda-mysql: - image: camunda/camunda-bpm-platform:${DISTRO}-${PLATFORM} - platform: linux/${PLATFORM} + image: camunda/camunda-bpm-platform:${DISTRO} environment: - DB_DRIVER=com.mysql.cj.jdbc.Driver - DB_URL=jdbc:mysql://mysql:3306/process-engine?sendFractionalSeconds=false @@ -24,8 +22,7 @@ services: restart: unless-stopped camunda-postgres: - image: camunda/camunda-bpm-platform:${DISTRO}-${PLATFORM} - platform: linux/${PLATFORM} + image: camunda/camunda-bpm-platform:${DISTRO} environment: - DB_DRIVER=org.postgresql.Driver - DB_URL=jdbc:postgresql://postgres:5432/camunda @@ -39,8 +36,7 @@ services: restart: unless-stopped camunda-debug: - image: camunda/camunda-bpm-platform:${DISTRO}-${PLATFORM} - platform: linux/${PLATFORM} + image: camunda/camunda-bpm-platform:${DISTRO} environment: - DEBUG=true ports: @@ -49,8 +45,7 @@ services: restart: unless-stopped camunda-prometheus-jmx: - image: camunda/camunda-bpm-platform:${DISTRO}-${PLATFORM} - platform: linux/${PLATFORM} + image: camunda/camunda-bpm-platform:${DISTRO} environment: - JMX_PROMETHEUS=true ports: @@ -59,8 +54,7 @@ services: restart: unless-stopped camunda-password-file: - image: camunda/camunda-bpm-platform:${DISTRO}-${PLATFORM} - platform: linux/${PLATFORM} + image: camunda/camunda-bpm-platform:${DISTRO} environment: - DB_DRIVER=com.mysql.cj.jdbc.Driver - DB_URL=jdbc:mysql://mysql:3306/process-engine?sendFractionalSeconds=false diff --git a/test/test.sh b/test/test.sh index 9bee51a8..5d1ae9dc 100755 --- a/test/test.sh +++ b/test/test.sh @@ -2,13 +2,19 @@ DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd ) +function run_test { + echo "::group::Test '$2'" + "$@" + echo "::endgroup::" +} + cd ${DIR} docker-compose up --force-recreate -d postgres mysql -./test-${DISTRO}.sh camunda -./test-${DISTRO}.sh camunda-mysql -./test-${DISTRO}.sh camunda-postgres -./test-${DISTRO}.sh camunda-password-file -./test-prometheus-jmx-${DISTRO}.sh camunda-prometheus-jmx -./test-debug.sh camunda-debug +run_test ./test-${DISTRO}.sh camunda +run_test ./test-${DISTRO}.sh camunda-mysql +run_test ./test-${DISTRO}.sh camunda-postgres +run_test ./test-${DISTRO}.sh camunda-password-file +run_test ./test-prometheus-jmx-${DISTRO}.sh camunda-prometheus-jmx +run_test ./test-debug.sh camunda-debug docker-compose down -v cd -