Sha256: 33dfeb6b5ef09827f5dd9069725cffd00d6d97075a62bc3178bcc131788ef47f

Contents?: true

Size: 1 KB

Versions: 3

Compression:

Stored size: 1 KB

Contents

#!/usr/bin/env bash

# This script verifies integrity of the Pro license
# Run it before bundle install to ensure, that what you are fetching is what you expect
# Run it after bundle install to ensure that the local artefact was not compromised

#!/usr/bin/env bash

set -e

if [ "$MODE" != "after" ]; then
  # Check the remote license prior to bundle installing
  curl \
    --fail \
    -u $KARAFKA_PRO_USERNAME:$KARAFKA_PRO_PASSWORD \
    https://gems.karafka.io/gems/karafka-license-$KARAFKA_PRO_VERSION.gem \
    -o ./karafka-license.gem
else
  # Check the local cached one after bundle install
  cache_path=`ruby -e 'puts "#{Gem.dir}/cache/"'`
  cp "$cache_path/karafka-license-$KARAFKA_PRO_VERSION.gem" ./karafka-license.gem
fi

detected=`sha256sum ./karafka-license.gem | awk '{ print $1 }'`

rm ./karafka-license.gem

echo -n "Karafka Pro license artifact checksum verification result: "

if [ "$detected" = "$KARAFKA_PRO_LICENSE_CHECKSUM" ]; then
  echo "Success"
else
  echo -e "\033[0;31mFailure!\033[0m"
  exit 1
fi

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
karafka-2.0.28 bin/verify_license_integrity
karafka-2.0.27 bin/verify_license_integrity
karafka-2.0.26 bin/verify_license_integrity