diff --git a/.github/workflows/ci-auth-checks.yml b/.github/workflows/ci-auth-checks.yml index 7c5b7a50..0541a462 100644 --- a/.github/workflows/ci-auth-checks.yml +++ b/.github/workflows/ci-auth-checks.yml @@ -13,13 +13,12 @@ jobs: steps: - uses: actions/checkout@v2 - name: Login SN docker hub - if: github.actor == 'streamnativebot' run: docker login -u="${{ secrets.DOCKER_USER }}" -p="${{ secrets.DOCKER_PASSWORD}}" - name: Run token tests run: scripts/run-integration-tests.sh token env: - PULSAR_IMAGE: ${{ github.actor == 'streamnativebot' && 'snstage/pulsar-all' || 'apachepulsar/pulsar-all' }} + PULSAR_IMAGE: snstage/pulsar-all - name: Run TLS tests run: scripts/run-integration-tests.sh tls env: - PULSAR_IMAGE: ${{ github.actor == 'streamnativebot' && 'snstage/pulsar-all' || 'apachepulsar/pulsar-all' }} + PULSAR_IMAGE: snstage/pulsar-all diff --git a/.github/workflows/ci-checks.yml b/.github/workflows/ci-checks.yml index fca8ca51..c10318f2 100644 --- a/.github/workflows/ci-checks.yml +++ b/.github/workflows/ci-checks.yml @@ -12,10 +12,9 @@ jobs: runs-on: ubuntu-latest steps: - name: Login SN docker hub - if: github.actor == 'streamnativebot' run: docker login -u="${{ secrets.DOCKER_USER }}" -p="${{ secrets.DOCKER_PASSWORD}}" - uses: actions/checkout@v2 - name: Run tests run: scripts/run-integration-tests.sh env: - PULSAR_IMAGE: ${{ github.actor == 'streamnativebot' && 'snstage/pulsar-all' || 'apachepulsar/pulsar-all' }} + PULSAR_IMAGE: snstage/pulsar-all diff --git a/.github/workflows/ci-functions-checks.yml b/.github/workflows/ci-functions-checks.yml index c3333b00..d4199c01 100644 --- a/.github/workflows/ci-functions-checks.yml +++ b/.github/workflows/ci-functions-checks.yml @@ -12,7 +12,6 @@ jobs: runs-on: ubuntu-latest steps: - name: Login SN docker hub - if: github.actor == 'streamnativebot' run: docker login -u="${{ secrets.DOCKER_USER }}" -p="${{ secrets.DOCKER_PASSWORD}}" - name: Set up Go 1.25.9 uses: actions/setup-go@v6 @@ -24,7 +23,7 @@ jobs: - name: Function tests run: scripts/run-integration-tests.sh function env: - PULSAR_IMAGE: ${{ github.actor == 'streamnativebot' && 'snstage/pulsar-all' || 'apachepulsar/pulsar-all' }} + PULSAR_IMAGE: snstage/pulsar-all - name: Setup tmate session if: failure() uses: mxschmitt/action-tmate@v3 @@ -32,7 +31,6 @@ jobs: runs-on: ubuntu-latest steps: - name: Login SN docker hub - if: github.actor == 'streamnativebot' run: docker login -u="${{ secrets.DOCKER_USER }}" -p="${{ secrets.DOCKER_PASSWORD}}" - name: Set up Go 1.25.9 uses: actions/setup-go@v6 @@ -44,12 +42,11 @@ jobs: - name: Sink tests run: scripts/run-integration-tests.sh sink env: - PULSAR_IMAGE: ${{ github.actor == 'streamnativebot' && 'snstage/pulsar-all' || 'apachepulsar/pulsar-all' }} + PULSAR_IMAGE: snstage/pulsar-all source-tests: runs-on: ubuntu-latest steps: - name: Login SN docker hub - if: github.actor == 'streamnativebot' run: docker login -u="${{ secrets.DOCKER_USER }}" -p="${{ secrets.DOCKER_PASSWORD}}" - name: Set up Go 1.25.9 uses: actions/setup-go@v6 @@ -61,4 +58,4 @@ jobs: - name: Source tests run: scripts/run-integration-tests.sh source env: - PULSAR_IMAGE: ${{ github.actor == 'streamnativebot' && 'snstage/pulsar-all' || 'apachepulsar/pulsar-all' }} + PULSAR_IMAGE: snstage/pulsar-all diff --git a/.github/workflows/ci-install-script-checks.yml b/.github/workflows/ci-install-script-checks.yml index 3bba5276..aba93c6a 100644 --- a/.github/workflows/ci-install-script-checks.yml +++ b/.github/workflows/ci-install-script-checks.yml @@ -11,7 +11,6 @@ jobs: runs-on: ubuntu-latest steps: - name: Login SN docker hub - if: github.actor == 'streamnativebot' run: docker login -u="${{ secrets.DOCKER_USER }}" -p="${{ secrets.DOCKER_PASSWORD}}" - name: Check out code into the Go module directory uses: actions/checkout@v2 diff --git a/.github/workflows/ci-packages-checks.yml b/.github/workflows/ci-packages-checks.yml index c2b69b9c..3b7277d5 100644 --- a/.github/workflows/ci-packages-checks.yml +++ b/.github/workflows/ci-packages-checks.yml @@ -12,7 +12,6 @@ jobs: runs-on: ubuntu-latest steps: - name: Login SN docker hub - if: github.actor == 'streamnativebot' run: docker login -u="${{ secrets.DOCKER_USER }}" -p="${{ secrets.DOCKER_PASSWORD}}" - name: Set up Go 1.25.9 uses: actions/setup-go@v5 @@ -24,7 +23,7 @@ jobs: - name: Packages tests run: scripts/run-integration-tests.sh packages env: - PULSAR_IMAGE: ${{ github.actor == 'streamnativebot' && 'snstage/pulsar-all' || 'apachepulsar/pulsar-all' }} + PULSAR_IMAGE: snstage/pulsar-all - name: Setup tmate session if: failure() uses: mxschmitt/action-tmate@v3 diff --git a/scripts/entrypoint.sh b/scripts/entrypoint.sh index 629f4ebb..2a229a2d 100755 --- a/scripts/entrypoint.sh +++ b/scripts/entrypoint.sh @@ -5,6 +5,31 @@ set -e readonly PULSARCTL_HOME=${PULSARCTL_HOME:-"/pulsarctl"} readonly TEST_ARGS=${TEST_ARGS:-""} +function ensureJavaInPath() { + if command -v java >/dev/null 2>&1; then + return + fi + + for dir in \ + /opt/jvm/bin \ + /opt/java/openjdk/bin \ + /usr/local/openjdk-17/bin \ + /usr/local/openjdk-11/bin \ + /usr/lib/jvm/default-jvm/bin \ + /usr/lib/jvm/java-17-openjdk/bin \ + /usr/lib/jvm/java-11-openjdk/bin + do + if [[ -x "${dir}/java" ]]; then + export PATH="${dir}:${PATH}" + export JAVA_HOME="${dir%/bin}" + return + fi + done + + echo "java executable not found in PATH or common JDK locations" + exit 1 +} + function checkFunctionWorker() { failed=0 until curl --silent localhost:8080/admin/v2/persistent/public/functions/coordinate/stats; do @@ -20,6 +45,7 @@ function checkFunctionWorker() { } pushd ${PULSARCTL_HOME} +ensureJavaInPath # startup pulsar service scripts/pulsar-service-startup.sh diff --git a/scripts/run-integration-tests.sh b/scripts/run-integration-tests.sh index 9d60043e..e0c5a3c7 100755 --- a/scripts/run-integration-tests.sh +++ b/scripts/run-integration-tests.sh @@ -3,7 +3,7 @@ set -e readonly PROJECT_ROOT=`cd $(dirname $0)/..; pwd` readonly IMAGE_NAME=pulsarctl-test -readonly PULSAR_DEFAULT_VERSION="4.1.3" +readonly PULSAR_DEFAULT_VERSION="4.3.0-SNAPSHOT" readonly PULSAR_VERSION=${PULSAR_VERSION:-${PULSAR_DEFAULT_VERSION}} readonly PULSAR_IMAGE=${PULSAR_IMAGE:-"apachepulsar/pulsar-all"}