-
Notifications
You must be signed in to change notification settings - Fork 12
Update docs and scripts for installation from COPR #196
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,40 +1,45 @@ | ||
| #!/bin/bash | ||
| set -euo pipefail | ||
|
|
||
| USHIFT_LOCAL_REPO_FILE=/etc/yum.repos.d/microshift-local.repo | ||
| OCP_MIRROR_REPO_FILE=/etc/yum.repos.d/openshift-mirror-beta.repo | ||
| YUM_REPOS_D=/etc/yum.repos.d | ||
| USHIFT_LOCAL_REPO_FILE=microshift-local.repo | ||
| OCP_MIRROR_REPO_FILE_PREFIX=microshift-deps | ||
|
|
||
| function usage() { | ||
| echo "Usage: $(basename "$0") [-create <repo_path>] | [-delete]" | ||
| echo "Usage: $(basename "$0") [-create <repo_path>] | [-rhocp-mirror <version>] | [-delete]" | ||
| exit 1 | ||
| } | ||
|
|
||
| function create_repos() { | ||
| local -r repo_path=$1 | ||
| local -r repo_version=$2 | ||
| function create_rhocp_repo() { | ||
| local -r repo_version=$1 | ||
|
|
||
| cat > "${USHIFT_LOCAL_REPO_FILE}" <<EOF | ||
| [microshift-local] | ||
| name=MicroShift Local Repository | ||
| baseurl=${repo_path} | ||
| local -r file="${YUM_REPOS_D}/${OCP_MIRROR_REPO_FILE_PREFIX}-${repo_version}.repo" | ||
| cat > "${file}" <<EOF | ||
| [openshift-mirror-beta] | ||
| name=OpenShift Mirror Beta Repository | ||
| baseurl=https://mirror.openshift.com/pub/openshift-v4/$(uname -m)/dependencies/rpms/${repo_version}-el9-beta/ | ||
| enabled=1 | ||
| gpgcheck=0 | ||
| skip_if_unavailable=0 | ||
| EOF | ||
| } | ||
|
Comment on lines
+13
to
+25
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chain🏁 Script executed: # First, find README and documentation about OS requirements
find . -type f \( -name "README*" -o -name "*.md" \) | head -20Repository: microshift-io/microshift Length of output: 328 🏁 Script executed: # Search for references to OS version or RHEL/CentOS requirements
rg -i "RHEL|CentOS|Fedora|OS.version|el[0-9]" --type md --type txt | head -20Repository: microshift-io/microshift Length of output: 1307 🏁 Script executed: # Check for other el9-beta references
rg "el9-beta" --type shRepository: microshift-io/microshift Length of output: 357 🏁 Script executed: # Check the context of create_repos.sh - where is it used?
rg "create_repos\.sh|create_rhocp_repo" --type shRepository: microshift-io/microshift Length of output: 493 🏁 Script executed: # Look for OS version detection in build scripts
rg "uname|version_id|os.release" --type sh -A 2 | head -30Repository: microshift-io/microshift Length of output: 1290 Hardcoded The baseurl hardcodes Note: The same issue exists in |
||
|
|
||
| cat > "${OCP_MIRROR_REPO_FILE}" <<EOF | ||
| [openshift-mirror-beta] | ||
| name=OpenShift Mirror Beta Repository | ||
| baseurl=https://mirror.openshift.com/pub/openshift-v4/$(uname -m)/dependencies/rpms/${repo_version}-el9-beta/ | ||
| function create_local_microshift_repo() { | ||
| local -r repo_path=$1 | ||
|
|
||
| cat > "${YUM_REPOS_D}/${USHIFT_LOCAL_REPO_FILE}" <<EOF | ||
| [microshift-local] | ||
| name=MicroShift Local Repository | ||
| baseurl=${repo_path} | ||
| enabled=1 | ||
| gpgcheck=0 | ||
| skip_if_unavailable=0 | ||
| EOF | ||
| } | ||
|
|
||
| function delete_repos() { | ||
| rm -vf /etc/yum.repos.d/microshift-local.repo | ||
| rm -vf /etc/yum.repos.d/openshift-mirror-beta.repo | ||
| rm -vf "${YUM_REPOS_D}/${USHIFT_LOCAL_REPO_FILE}" | ||
| find "${YUM_REPOS_D}/" -iname "${OCP_MIRROR_REPO_FILE_PREFIX}*" -delete -print | ||
| } | ||
|
|
||
| if [ $# -lt 1 ] ; then | ||
|
|
@@ -54,6 +59,7 @@ case $1 in | |
| echo "ERROR: The RPM repository path '${repo_path}' does not exist" | ||
| exit 1 | ||
| fi | ||
| create_local_microshift_repo "${repo_path}" | ||
|
|
||
| repo_version="$(dnf --quiet --disablerepo="*" \ | ||
| --repofrompath=ushift,file://"${repo_path}" \ | ||
|
|
@@ -62,7 +68,16 @@ case $1 in | |
| echo "ERROR: Could not determine the MicroShift version from the RPM repository at '${repo_path}'" | ||
| exit 1 | ||
| fi | ||
| create_repos "${repo_path}" "${repo_version}" | ||
| create_rhocp_repo "${repo_version}" | ||
| ;; | ||
|
|
||
| -rhocp-mirror) | ||
| repo_version=$(dnf repoquery --qf '%{VERSION}' --latest-limit=1 microshift 2>/dev/null | cut -d. -f1,2) | ||
| if [ -z "${repo_version}" ] ; then | ||
| echo "ERROR: Failed to find version of MicroShift available in the repositories" | ||
| usage | ||
| fi | ||
| create_rhocp_repo "${repo_version}" | ||
| ;; | ||
|
|
||
| -delete) | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.