Skip to content

Commit

Permalink
Fix private test repository access [DI-236] (#221)
Browse files Browse the repository at this point in the history
In [DI-222](https://hazelcast.atlassian.net/browse/DI-222) the test
repositories were made private, but that caused [build
failures](https://github.com/hazelcast/hazelcast-packaging/actions/runs/10365877156/job/28693937495).

While the _initial_ connection to the repositories to get metadata was
authenticated, the ultimate `install` was not and failed.

Fixed by adding the credentials to the URL as advised by [JFrog
documentation](https://jfrog.com/help/r/jfrog-artifactory-documentation/configure-authenticated-access-to-debian-servers)

Fixes: [DI-236](https://hazelcast.atlassian.net/browse/DI-236)

[DI-222]:
https://hazelcast.atlassian.net/browse/DI-222?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ
[DI-236]:
https://hazelcast.atlassian.net/browse/DI-236?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ

---------

Co-authored-by: Łukasz Dziedziul <[email protected]>

(cherry picked from commit d12e3f1)
  • Loading branch information
JackPGreen committed Aug 16, 2024
1 parent 50c80de commit 16298e1
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 5 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/publish-brew-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ on:
description: 'Version of the package e.g. 5.1.1, 5.1.1-1, defaults to HZ_VERSION'
type: string

env:
JFROG_USERNAME: ${{ secrets.JFROG_USERNAME }}
JFROG_TOKEN: ${{ secrets.JFROG_TOKEN }}

concurrency:
group: 'brew-${{ github.job }}-${{ inputs.HZ_VERSION }}-${{ inputs.HZ_DISTRIBUTION}}'

Expand Down
1 change: 1 addition & 0 deletions .github/workflows/publish-deb-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ on:
type: string

env:
JFROG_USERNAME: ${{ secrets.JFROG_USERNAME }}
JFROG_TOKEN: ${{ secrets.JFROG_TOKEN }}

concurrency:
Expand Down
9 changes: 7 additions & 2 deletions .github/workflows/publish-rpm-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ on:
type: string

env:
JFROG_USERNAME: ${{ secrets.JFROG_USERNAME }}
JFROG_TOKEN: ${{ secrets.JFROG_TOKEN }}
DEVOPS_PRIVATE_KEY: ${{ secrets.DEVOPS_PRIVATE_KEY }}
BINTRAY_PASSPHRASE: ${{ secrets.BINTRAY_PASSPHRASE }}
Expand Down Expand Up @@ -79,11 +80,15 @@ jobs:
HZ_LICENSEKEY: ${{ secrets.HZ_LICENSEKEY }}
run: |
source ./common.sh
# Bake authentication into the returned URLs
wget \
${RPM_REPO_BASE_URL}/${PACKAGE_REPO}/hazelcast-rpm-${PACKAGE_REPO}.repo \
--header "Authorization: Bearer ${{ env.JFROG_TOKEN }}" \
--output-document hazelcast-rpm-${PACKAGE_REPO}.repo
mv hazelcast-rpm-${PACKAGE_REPO}.repo /etc/yum.repos.d/
--output-document - | \
sed "s#https://#https://${{ env.JFROG_USERNAME }}:${{ env.JFROG_TOKEN }}@#g" > \
/etc/yum.repos.d/hazelcast-rpm-${PACKAGE_REPO}.repo
yum install -y ${{ env.HZ_DISTRIBUTION}}-${RPM_HZ_VERSION}
HAZELCAST_CONFIG="$(pwd)/config/integration-test-hazelcast.yaml" hz-start > hz.log 2>&1 &
Expand Down
7 changes: 4 additions & 3 deletions common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,8 @@ export BREW_PACKAGE_VERSION
if [ "${USE_TEST_REPO}" == "true" ]; then
# PRs publish to test repositories and install the packages from there
export DEBIAN_REPO=debian-test-local
export DEBIAN_REPO_BASE_URL="https://repository.hazelcast.com/${DEBIAN_REPO}"
export DEBIAN_REPO_BASE_URL="https://${JFROG_USERNAME}:${JFROG_TOKEN}@repository.hazelcast.com/${DEBIAN_REPO}"
export RPM_REPO=rpm-test-local
export RPM_REPO_BASE_URL="https://repository.hazelcast.com/${RPM_REPO}"

# This is a clone of the hazelcast/homebrew-hz repository
export BREW_GIT_REPO_NAME="hazelcast/homebrew-hz-test"
Expand All @@ -72,8 +71,10 @@ else
export DEBIAN_REPO=debian-local
export DEBIAN_REPO_BASE_URL="https://repository.hazelcast.com/${DEBIAN_REPO}"
export RPM_REPO=rpm-local
export RPM_REPO_BASE_URL="https://repository.hazelcast.com/${RPM_REPO}"

export BREW_GIT_REPO_NAME="hazelcast/homebrew-hz"
export BREW_TAP_NAME="hazelcast/hz"
fi

export RPM_REPO_BASE_URL="https://repository.hazelcast.com/${RPM_REPO}"
export HZ_DISTRIBUTION_FILE=distribution.tar.gz

0 comments on commit 16298e1

Please sign in to comment.