diff --git a/.github/workflows/ci-auth-checks.yml b/.github/workflows/ci-auth-checks.yml index 87925236..7c5b7a50 100644 --- a/.github/workflows/ci-auth-checks.yml +++ b/.github/workflows/ci-auth-checks.yml @@ -13,8 +13,13 @@ 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' }} - name: Run TLS tests run: scripts/run-integration-tests.sh tls + env: + PULSAR_IMAGE: ${{ github.actor == 'streamnativebot' && 'snstage/pulsar-all' || 'apachepulsar/pulsar-all' }} diff --git a/.github/workflows/ci-checks.yml b/.github/workflows/ci-checks.yml index 1c6ad006..fca8ca51 100644 --- a/.github/workflows/ci-checks.yml +++ b/.github/workflows/ci-checks.yml @@ -12,7 +12,10 @@ 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' }} diff --git a/.github/workflows/ci-functions-checks.yml b/.github/workflows/ci-functions-checks.yml index cfdc4a61..c2553d6e 100644 --- a/.github/workflows/ci-functions-checks.yml +++ b/.github/workflows/ci-functions-checks.yml @@ -12,6 +12,7 @@ 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.8 uses: actions/setup-go@v6 @@ -22,6 +23,8 @@ jobs: uses: actions/checkout@v2 - name: Function tests run: scripts/run-integration-tests.sh function + env: + PULSAR_IMAGE: ${{ github.actor == 'streamnativebot' && 'snstage/pulsar-all' || 'apachepulsar/pulsar-all' }} - name: Setup tmate session if: failure() uses: mxschmitt/action-tmate@v3 @@ -29,6 +32,7 @@ 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.8 uses: actions/setup-go@v6 @@ -39,10 +43,13 @@ jobs: uses: actions/checkout@v2 - name: Sink tests run: scripts/run-integration-tests.sh sink + env: + PULSAR_IMAGE: ${{ github.actor == 'streamnativebot' && 'snstage/pulsar-all' || 'apachepulsar/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.8 uses: actions/setup-go@v6 @@ -53,3 +60,5 @@ jobs: uses: actions/checkout@v2 - name: Source tests run: scripts/run-integration-tests.sh source + env: + PULSAR_IMAGE: ${{ github.actor == 'streamnativebot' && 'snstage/pulsar-all' || 'apachepulsar/pulsar-all' }} diff --git a/.github/workflows/ci-install-script-checks.yml b/.github/workflows/ci-install-script-checks.yml index aba93c6a..3bba5276 100644 --- a/.github/workflows/ci-install-script-checks.yml +++ b/.github/workflows/ci-install-script-checks.yml @@ -11,6 +11,7 @@ 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 20392ff7..a31acfc6 100644 --- a/.github/workflows/ci-packages-checks.yml +++ b/.github/workflows/ci-packages-checks.yml @@ -12,6 +12,7 @@ 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.8 uses: actions/setup-go@v5 @@ -22,6 +23,8 @@ jobs: uses: actions/checkout@v2 - name: Packages tests run: scripts/run-integration-tests.sh packages + env: + PULSAR_IMAGE: ${{ github.actor == 'streamnativebot' && 'snstage/pulsar-all' || 'apachepulsar/pulsar-all' }} - name: Setup tmate session if: failure() uses: mxschmitt/action-tmate@v3 diff --git a/scripts/run-integration-tests.sh b/scripts/run-integration-tests.sh index 1ce71ba2..9d60043e 100755 --- a/scripts/run-integration-tests.sh +++ b/scripts/run-integration-tests.sh @@ -3,10 +3,12 @@ set -e readonly PROJECT_ROOT=`cd $(dirname $0)/..; pwd` readonly IMAGE_NAME=pulsarctl-test -readonly PULSAR_DEFAULT_VERSION="4.1.0.10" +readonly PULSAR_DEFAULT_VERSION="4.1.3" readonly PULSAR_VERSION=${PULSAR_VERSION:-${PULSAR_DEFAULT_VERSION}} +readonly PULSAR_IMAGE=${PULSAR_IMAGE:-"apachepulsar/pulsar-all"} docker build --build-arg PULSAR_VERSION=${PULSAR_VERSION} \ + --build-arg PULSAR_IMAGE=${PULSAR_IMAGE} \ -t ${IMAGE_NAME} \ -f ${PROJECT_ROOT}/scripts/test-docker/Dockerfile ${PROJECT_ROOT} case ${1} in diff --git a/scripts/test-docker/Dockerfile b/scripts/test-docker/Dockerfile index 3a0dc1c8..ed962cc5 100644 --- a/scripts/test-docker/Dockerfile +++ b/scripts/test-docker/Dockerfile @@ -1,5 +1,6 @@ +ARG PULSAR_IMAGE=apachepulsar/pulsar-all ARG PULSAR_VERSION -FROM snstage/pulsar-all:$PULSAR_VERSION +FROM ${PULSAR_IMAGE}:${PULSAR_VERSION} # use root user USER root