Skip to content

Instantly share code, notes, and snippets.

View nickboldt's full-sized avatar

Nick Boldt nickboldt

View GitHub Profile
@nickboldt
nickboldt / icsp-quay.io.sh
Created September 19, 2023 15:11
Apply an Image Content Source Policy for registry.redhat.io --> quay.io for installing RH DH unreleased CI builds
TMPDIR=/tmp
for ICSP_URL in quay.io/rhdh/; do
ICSP_URL_PRE=${ICSP_URL%%/*}
# echo "[DEBUG] ${ICSP_URL_PRE}, ${ICSP_URL_PRE//./-}, ${ICSP_URL}"
echo "apiVersion: operator.openshift.io/v1alpha1
kind: ImageContentSourcePolicy
metadata:
name: ${ICSP_URL_PRE//./-}
spec:
@nickboldt
nickboldt / oc-pull-secret-update-global.sh
Last active February 26, 2024 13:55
add tokens/pwds for quay.io (and/or for registry.redhat.io) to your openshift's global (if admin) or per-project (if not admin) pull secret
#!/bin/bash
# set your own logins!
QUAY_USER="****"
QUAY_TOKEN="****"
RRIO_USERNAME="****"
RRIO_PASSWORD="****"
# login to quay.io
REGISTRY="quay.io"
@nickboldt
nickboldt / verify.rhpib.pullable.sh
Created September 18, 2023 20:46
verify RHPIB bundles are pullable from RH registry
yarn config set "@redhat:registry" https://npm.registry.redhat.com
rm -fr /tmp/rhpib; mkdir /tmp/rhpib; cd /tmp/rhpib
for d in \
@redhat/backstage-plugin-acr @redhat/backstage-plugin-argo-cd @redhat/backstage-plugin-argo-cd-backend \
@redhat/backstage-plugin-jfrog-artifactory @redhat/backstage-plugin-keycloak-backend \
@redhat/backstage-plugin-quay @redhat/backstage-plugin-tekton @redhat/backstage-plugin-topology\
@redhat/shared-react; do \
yarn add $d 2> >(grep -v warning 1>&2); \
done
# for incorrectly taggged images:
brew untag devspaces-3.9-rhel-8-container-candidate \
devspaces-configbump-rhel8-container-3.10-4 \
devspaces-imagepuller-rhel8-container-3.10-2 \
devspaces-machineexec-rhel8-container-3.10-2 \
devspaces-traefik-rhel8-container-3.10-2
@nickboldt
nickboldt / git.rebase.noninteractive.sh
Created August 22, 2023 17:03
non-interactive interactive rebase to squash or fixup
# squash this commit into the previous one, using non-interactive interactive rebase
# https://stackoverflow.com/questions/12394166/how-do-i-run-git-rebase-interactive-in-non-interactive-manner
# merge commits but keep comments
GIT_EDITOR="sed -i -e 's/BAD/BAD/g'" GIT_SEQUENCE_EDITOR="sed -i -re '2,\$s/^pick /s /'" git rebase -i
# merge commits and drop comment
GIT_EDITOR="sed -i -e 's/BAD/BAD/g'" GIT_SEQUENCE_EDITOR="sed -i -re '2,\$s/^pick /f /'" git rebase -i
@nickboldt
nickboldt / brew-for-rhpkg.sh
Last active December 20, 2023 21:47
wrapper for brew as replacement for borked rhpkg
#!/bin/bash
# requires
# dnf install -y brewkoji python3-koji-containerbuild-cli \
# openldap-clients python3-rpkg python3-kobo python3-bugzilla \
# gcc openssl-devel bzip2-devel sqlite-devel
# brew container-build rhdh-1.0-rhel-9-containers-candidate
# git+https://pkgs.devel.redhat.com/git/containers/rhdh-operator#5459112551259a7f5a194227e7b3537be38afdf0 \
# --git-branch rhdh-1.0-rhel-9
@nickboldt
nickboldt / gist:8e3d47c35e5c9e9e084d0d14759547cc
Created May 16, 2023 02:40
FB groups for crossposting MTA stuff
Residents of West Petpeswick: https://www.facebook.com/groups/1408442299320003/
Residents Of East Petpeswick: https://www.facebook.com/groups/190127918090806/
Musquodoboit Harbour: https://www.facebook.com/groups/musquodoboitharbour
Friends of the Gaetz Brook Greenway: https://www.facebook.com/groups/ATShore/
What's Happening in Meaghers Grant: https://www.facebook.com/groups/320143741498650
Musquodoboit Harbour, Jeddore and Porters Lake: https://www.facebook.com/groups/226092338183269/
Porters Lake Community Connection: https://www.facebook.com/groups/porterslakecommunity/
HIKING WITH DOGS IN NOVA SCOTIA: https://www.facebook.com/groups/380761668726933/
East Coast hiking Adventures group: https://www.facebook.com/groups/1171449999881399/
Halifax Trail Talk - Nova Scotia Hiking, Biking & Paddling Enthusiasts: https://www.facebook.com/groups/hfxtrailtalk/
@nickboldt
nickboldt / getbundle.sh
Last active May 10, 2023 19:45
olm catalog source - get bundle for channel
podman run -p 50051:50051 brew.registry.redhat.io/rh-osbs/iib:$IIB_NUMBER &
oc login --server=https://api.$YOUR_CLUSTER.com:6443 -u=$YOUR_USER -p=$YOUR_PWD --insecure-skip-tls-verify
oc port-forward $(oc get pods -n openshift-marketplace -l olm.catalogSource=$YOUR_CATALOG_SOURCE -o name) -n openshift-marketplace 50051 &
# grpcurl is needed to be installed locally
go install github.com/fullstorydev/grpcurl/cmd/grpcurl@latest
GO_BIN=~/go
export PATH=${PATH%":${GO_BIN}/bin"}:${GO_BIN}/bin
#!/bin/bash
if [[ $1 ]]; then
DSC_VERSION="${1}-CI"
else
DSC_VERSION="3.7.0-CI"
fi
DSC_ARCH="linux-x64"
DSC_HOME=${HOME}/.dsc; mkdir -p "${DSC_HOME}"
DSC_TGZ_URL="https://github.com/redhat-developer/devspaces-chectl/releases/download/${DSC_VERSION}-dsc-assets/devspaces-${DSC_VERSION%-*}-dsc-${DSC_ARCH}.tar.gz"
@nickboldt
nickboldt / render-bundle.sh
Created May 4, 2023 15:29
render an IIB as json to see what's in it
#!/bin/bash
cd "$(mktemp -d)" || exit
echo "Working in $(pwd)"
IMG=${IMG:-registry.redhat.io/redhat/redhat-operator-index:v4.12}
echo "Processing $IMG"
opm render "$IMG" > render.json