#!/usr/bin/env bash

set -eExo pipefail

ARCH=$(if [ "$1" == "ppc64le" ]; then echo "ppc64el"; else echo "$1"; fi)

microdnf ${DNF_OPTS_ROOT} update -y
microdnf ${DNF_OPTS_ROOT} install -y openssl curl git tar
rpm --install --root "${DNF_INSTALL_ROOT-/}" "/tmp/gitlab-runner_${ARCH}-fips.rpm"
microdnf ${DNF_OPTS_ROOT} clean all
rm -rf "${DNF_INSTALL_ROOT}/var/cache/dnf"
rm "/tmp/gitlab-runner_${ARCH}-fips.rpm"
