Skip to content

Commit

Permalink
Merge pull request #18 from maticnetwork/djpolygon/DEVOPS-2592
Browse files Browse the repository at this point in the history
Changes for rpm
  • Loading branch information
djpolygon authored Oct 9, 2024
2 parents 72998b7 + 8cb2847 commit b3562cb
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 15 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
.idea/
.idea*
31 changes: 16 additions & 15 deletions heimdall.sh
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,10 @@ if [ ! -z "$1" ]; then
fi

if [ ! -z "$2" ]; then
if [ "$2" = "mainnet" ] || [ "$2" = "mumbai" ] || [ "$2" = "amoy" ]; then
if [ "$2" = "mainnet" ] || [ "$2" = "amoy" ]; then
network="$2"
else
echo "Invalid network: $2, choose from 'mainnet' or 'mumbai' or 'amoy'"
echo "Invalid network: $2, choose from 'mainnet' or 'amoy'"
exit 1
fi
fi
Expand All @@ -82,6 +82,7 @@ fi
if [[ $version > "0.3" ]]; then
tag=${version}
profileInfo=${network}-${nodetype}-config_v${version}
profileInforpm=${network}-${nodetype}-config-v${version}
else
echo "Version is less than 0.3, ignoring network and node type"
tag=${version}
Expand All @@ -96,18 +97,18 @@ case "$(uname -s).$(uname -m)" in
if command -v dpkg &> /dev/null; then
type="deb"
if [[ $version > "0.3" ]]; then
binary="heimdalld-v${tag}-amd64.deb"
profile="heimdalld-${profileInfo}-amd64.deb"
binary="heimdall-v${tag}-amd64.deb"
profile="heimdall-${profileInfo}-all.deb"
else
binary="heimdalld_v${tag}_linux_amd64.deb"
binary="heimdall_v${tag}_linux_amd64.deb"
fi
elif command -v rpm &> /dev/null; then
type="rpm"
if [[ $version > "0.3" ]]; then
binary="heimdalld-v${tag}-amd64.rpm"
profile="heimdalld-${profileInfo}-amd64.rpm"
binary="heimdall-v${tag}.x86_64.rpm"
profile="heimdall-${profileInforpm}.noarch.rpm"
else
binary="heimdalld_v${tag}_linux_amd64.rpm"
binary="heimdall_v${tag}_linux_amd64.rpm"
fi
elif command -v apk &> /dev/null; then
if [[ $version > "0.3" ]]; then
Expand All @@ -127,25 +128,25 @@ case "$(uname -s).$(uname -m)" in
if command -v dpkg &> /dev/null; then
type="deb"
if [[ $version > "0.3" ]]; then
binary="heimdalld-v${tag}-arm64.deb"
profile="heimdalld-${profileInfo}-arm64.deb"
binary="heimdall-v${tag}-arm64.deb"
profile="heimdall-${profileInfo}-all.deb"
else
binary="heimdalld_v${tag}_linux_arm64.deb"
binary="heimdall_v${tag}_linux_arm64.deb"
fi
elif command -v rpm &> /dev/null; then
type="rpm"
if [[ $version > "0.3" ]]; then
binary="heimdalld-v${tag}-arm64.rpm"
profile="heimdalld-${profileInfo}-arm64.rpm"
binary="heimdall-v${tag}.aarch64.rpm"
profile="heimdall-${profileInforpm}.noarch.rpm"
else
binary="heimdalld_v${tag}_linux_arm64.rpm"
binary="heimdall_v${tag}_linux_arm64.rpm"
fi
elif command -v apk &> /dev/null; then
if [[ $version > "0.3" ]]; then
oops "sorry, there is no binary distribution for your platform"
fi
type="apk"
binary="heimdalld_v${tag}_linux_arm64.apk"
binary="heimdall_v${tag}_linux_arm64.apk"
else
if [[ $version > "0.3" ]]; then
oops "sorry, there is no binary distribution for your platform"
Expand Down

0 comments on commit b3562cb

Please sign in to comment.