Skip to content

Commit

Permalink
feat(opa): Add version 0.61.0 (#538)
Browse files Browse the repository at this point in the history
* feat(opa): Add version 0.61.0

* changelog
  • Loading branch information
sbernauer authored Jan 30, 2024
1 parent a51da74 commit adb3750
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 31 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ All notable changes to this project will be documented in this file.
- testing-tools: Add krb5-user library for Kerberos tests ([#531]).
- testing-tools: Add the Python library Beautiful Soup 4 ([#536]).
- java-base: Add `openjdk-devel` package for tool such as `jps` or `jmap` ([#537]).
- opa: Add version `0.61.0` ([#538]).

### Changed

Expand All @@ -31,6 +32,7 @@ All notable changes to this project will be documented in this file.
[#531]: https://github.com/stackabletech/docker-images/pull/531
[#536]: https://github.com/stackabletech/docker-images/pull/536
[#537]: https://github.com/stackabletech/docker-images/pull/537
[#538]: https://github.com/stackabletech/docker-images/pull/538

## [23.11.0] - 2023-11-30

Expand Down
7 changes: 7 additions & 0 deletions conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,13 @@
"vector": "0.33.0",
"bundle_builder_version": "1.1.0",
},
# 2024-01-30: We only added 0.61.0 to be able to write Rego rules v1.
# The regular product version update process must take care of removing unsupported versions and bumping vector
{
"product": "0.61.0",
"vector": "0.33.0",
"bundle_builder_version": "1.1.0",
},
],
},
{
Expand Down
63 changes: 32 additions & 31 deletions opa/upload_new_opa_version.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,34 +29,35 @@ trap cleanup EXIT

cd "$WORK_DIR" || exit

bin_file=opa_linux_amd64_static
download_url="https://openpolicyagent.org/downloads/v${VERSION}/${bin_file}"

echo "Downloading OPA from ${download_url}"
curl --fail -L -o "${bin_file}" "${download_url}"
echo "Downloading OPA checksum from ${download_url}.sha256"
curl --fail -L -o "${bin_file}".sha256 "${download_url}".sha256

echo "Validating SHA256 Checksum"
if ! (sha256sum "${bin_file}" | diff - "${bin_file}".sha256); then
echo "ERROR: One of the SHA256 sums does not match"
exit 1
fi

versioned_bin_file=${bin_file}_${VERSION}
echo "Tag bin file and SHA with version ${bin_file} -> ${versioned_bin_file}"
mv "${bin_file}" "${versioned_bin_file}"
mv "${bin_file}".sha256 "${versioned_bin_file}".sha256

echo "Uploading everything to Nexus"
EXIT_STATUS=0
curl --fail -u "$NEXUS_USER:$NEXUS_PASSWORD" --upload-file "${versioned_bin_file}" 'https://repo.stackable.tech/repository/packages/opa/' || EXIT_STATUS=$?
curl --fail -u "$NEXUS_USER:$NEXUS_PASSWORD" --upload-file "${versioned_bin_file}".sha256 'https://repo.stackable.tech/repository/packages/opa/' || EXIT_STATUS=$?

if [ $EXIT_STATUS -ne 0 ]; then
echo "ERROR: Upload failed"
exit 1
fi

echo "Successfully uploaded version $VERSION of OPA to Nexus"
echo "https://repo.stackable.tech/service/rest/repository/browse/packages/opa/"
for bin_file in opa_linux_amd64_static opa_linux_arm64_static; do
download_url="https://openpolicyagent.org/downloads/v${VERSION}/${bin_file}"

echo "Downloading OPA from ${download_url}"
curl --fail -L -o "${bin_file}" "${download_url}"
echo "Downloading OPA checksum from ${download_url}.sha256"
curl --fail -L -o "${bin_file}".sha256 "${download_url}".sha256

echo "Validating SHA256 Checksum"
if ! (sha256sum "${bin_file}" | diff - "${bin_file}".sha256); then
echo "ERROR: One of the SHA256 sums does not match"
exit 1
fi

versioned_bin_file=${bin_file}_${VERSION}
echo "Tag bin file and SHA with version ${bin_file} -> ${versioned_bin_file}"
mv "${bin_file}" "${versioned_bin_file}"
mv "${bin_file}".sha256 "${versioned_bin_file}".sha256

echo "Uploading everything to Nexus"
EXIT_STATUS=0
curl --fail -u "$NEXUS_USER:$NEXUS_PASSWORD" --upload-file "${versioned_bin_file}" 'https://repo.stackable.tech/repository/packages/opa/' || EXIT_STATUS=$?
curl --fail -u "$NEXUS_USER:$NEXUS_PASSWORD" --upload-file "${versioned_bin_file}".sha256 'https://repo.stackable.tech/repository/packages/opa/' || EXIT_STATUS=$?

if [ $EXIT_STATUS -ne 0 ]; then
echo "ERROR: Upload failed"
exit 1
fi

echo "Successfully uploaded version $VERSION of OPA to Nexus"
echo "https://repo.stackable.tech/service/rest/repository/browse/packages/opa/"
done

0 comments on commit adb3750

Please sign in to comment.