File tree Expand file tree Collapse file tree
dib/repo-setup/pre-install.d Expand file tree Collapse file tree Original file line number Diff line number Diff line change 22
33set -eux
44
5+ # Pin repo-setup to a specific commit on the stable branch
6+ # To update: change REPO_SETUP_COMMIT, download the new archive, and update REPO_SETUP_SHA256
7+ REPO_SETUP_COMMIT=85321f7e0af502d7f06f845886058daf09da34f6
8+ REPO_SETUP_SHA256=1050e4ed0472098165c4bde84a9991a6a13171426d16862f6651e28635d1727f
9+
510pushd output
6- curl -sL https://github.com/openstack-k8s-operators/repo-setup/archive/refs/heads/main.tar.gz | tar xvz
7- pushd repo-setup-main
11+ curl -sL -o repo-setup.tar.gz \
12+ " https://github.com/openstack-k8s-operators/repo-setup/archive/${REPO_SETUP_COMMIT} .tar.gz"
13+ echo " ${REPO_SETUP_SHA256} repo-setup.tar.gz" | sha256sum -c -
14+ tar xzf repo-setup.tar.gz
15+ pushd " repo-setup-${REPO_SETUP_COMMIT} "
816python3 -m venv ./venv
917source ./venv/bin/activate
1018PBR_VERSION=0.0.0 python3 -m pip install ./
Original file line number Diff line number Diff line change 11#! /bin/bash
22
3- set -eux
3+ set -eu
44
55# Edit RHSM_ values for the subscription configuration
66RHSM_USER=unset
@@ -13,8 +13,19 @@ RHSM_REPOS=${RHSM_REPOS:-"--enable=rhoso-18.0-for-rhel-${RHEL_MAJOR}-x86_64-rpms
1313RHSM_POOL=" "
1414
1515rm -f /etc/yum.repos.d/* .repo
16- subscription-manager register --username=$RHSM_USER --password=$RHSM_PASSWORD
16+ # Disable subscription-manager container detection so that registration
17+ # works during container builds. subscription-manager checks for
18+ # /etc/rhsm-host (a symlink to ../run/secrets/rhsm) to detect
19+ # container mode.
20+ if [ -L /etc/rhsm-host ]; then
21+ rm -f /etc/rhsm-host
22+ fi
23+
24+ # Suppress xtrace to avoid leaking credentials to the build log
25+ set +x
26+ subscription-manager register --username=" $RHSM_USER " --password=" $RHSM_PASSWORD "
27+ set -x
1728if [ -n " ${RHSM_POOL} " ]; then
18- subscription-manager attach --pool=$RHSM_POOL
29+ subscription-manager attach --pool=" $RHSM_POOL "
1930fi
2031subscription-manager repos $RHSM_REPOS
Original file line number Diff line number Diff line change @@ -9,10 +9,16 @@ if [ -n "${DIB_YUM_REPO_CONF:-}" ] ; then
99 exit 0
1010fi
1111
12- # Install latest version of repo-setup without installing pip or git
12+ # Install repo-setup pinned to a specific commit on the stable branch
13+ # To update: change REPO_SETUP_COMMIT, download the new archive, and update REPO_SETUP_SHA256
14+ REPO_SETUP_COMMIT=85321f7e0af502d7f06f845886058daf09da34f6
15+ REPO_SETUP_SHA256=1050e4ed0472098165c4bde84a9991a6a13171426d16862f6651e28635d1727f
1316cd /tmp
14- curl -sL https://github.com/openstack-k8s-operators/repo-setup/archive/refs/heads/main.tar.gz | tar xvz
15- cd repo-setup-main
17+ curl -sL -o repo-setup.tar.gz \
18+ " https://github.com/openstack-k8s-operators/repo-setup/archive/${REPO_SETUP_COMMIT} .tar.gz"
19+ echo " ${REPO_SETUP_SHA256} repo-setup.tar.gz" | sha256sum -c -
20+ tar xzf repo-setup.tar.gz
21+ cd " repo-setup-${REPO_SETUP_COMMIT} "
1622python3 -m venv ./venv
1723source ./venv/bin/activate
1824PBR_VERSION=0.0.0 python3 -m pip install ./
You can’t perform that action at this time.
0 commit comments