Skip to content

Instantly share code, notes, and snippets.

@echang0929
Last active April 12, 2021 14:35
Show Gist options
  • Save echang0929/c4bcfcd027c31138ca6ea1725621d092 to your computer and use it in GitHub Desktop.
Save echang0929/c4bcfcd027c31138ca6ea1725621d092 to your computer and use it in GitHub Desktop.
GITHUB_USER="foo"
GITHUB_TOKN="1111111111222222222233333333334444444444"
GITHUB_REPO="https://xxx/foo/yyy.git"
cat <<EOF | kubectl apply -f -
apiVersion: v1
kind: Secret
metadata:
name: github-secrets
type: Opaque
data:
git-user: $(echo -n ${GITHUB_USER} | base64)
git-token: $(echo -n ${GITHUB_TOKN} | base64)
EOF
repo_url="https://\$(git-user):\$(git-token)@${GITHUB_REPO#'https://'}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment