Skip to content

Instantly share code, notes, and snippets.

@csrwng
Created July 28, 2020 21:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save csrwng/b984c687a67821067d959daba8395895 to your computer and use it in GitHub Desktop.
Save csrwng/b984c687a67821067d959daba8395895 to your computer and use it in GitHub Desktop.
#!/bin/bash
set -e
oc registry login
CI_PULL_SECRET="$(cat ~/.docker/config.json | jq -r '.auths["registry.svc.ci.openshift.org"].auth')"
EXISTING="$(cat ~/.pull-secret)"
NEW="$(echo "${EXISTING}" | jq --arg a "${CI_PULL_SECRET}" -c '.auths["registry.svc.ci.openshift.org"].auth = $a')"
echo "${NEW}" > ~/.pull-secret
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment