Private Bundle Repos - padogrid/padogrid GitHub Wiki
◀️ User Bundle Catalogs :link: Running Bundles in Container ▶️
If you have private bundle repos then you can access them using your personal access token or ssh
public key.
Personal Access Token
Generating a personal access token
- Log into GitHub
- Click on your avatar icon in the upper right corner to display the pulldown menu.
- Select Settings
- Select Develper settings at the bottom of the left pane.
- Select Personal access tokens in the left pane.
- Select the Generate new token button.
- Copy the newly generated token.
See detailed instructions in the following link.
Caching your GitHub credentials in Git
You can cache your GitHub credentials to prevent repeatedly entering them when you access private repos.
git config credential.helper
1. Use Run the following command to temporarily cache your credentials. You can change the timeout value accordingly.
# Cache for 1 day (86400 seconds)
git config --global credential.helper 'cache --timeout=86400'
2. Use GitHub CLI to cache credentials. Follow the instructions in the link below to install GitHub CLI for your OS.
https://github.com/cli/cli#installation
Once installed, run the interactive command, gh
, as follows.
gh auth login
- When prompted for your preferred Git Operations, select
HTTPS
. - When asked if you would like to authenticate to Git with your GitHub credentials, enter 'Y'.
- Select Paste an authentication token and paste your token.
3. Alternatively, on macOS, you can install GCM (Git Credential Manager). Please refer to the link below.
The GCM repo also provides installation instructions for macOS, Linux, and Windows. For example, on Linux, you can execute the following command to install GCM.
curl -LO https://aka.ms/gcm/linux-install-source.sh &&
sh ./linux-install-source.sh &&
git-credential-manager-core configure
ssh
Public Key
ssh
Public Keys in GitHub
Adding If you prefer to use ssh
instead of https
then you need to enter your public key in GitHub as follows.
- Generate
ssh
keys.
ssh-keygen -t rsa
- When prompted for Enter passphrase (empty for no passphrase):, leave blank, i.e., empty.
- Copy the generated
~/.ssh/id_rsa.pub
contents.
cat `~/.ssh/id_rsa.pub`
- From your browser, go to your GitHub repo.
- Select the Settings tab.
- Select the Deploy keys option from the left pane.
- Select the Add deploy key button.
- Enter a name for your key in the Title field.
- Paste the key contents in the Key field.
- Select the Add key button to save the key.
You can also allow other users to access your private repos by adding their public keys.
ssh
as Default
Configuring GitHub If you want to default to ssh
for connecting to GitHub then set the GITHUB_PRIVATE_REPO_ENABLED
environment variable to "true"
in the ~/.padogrid/setenv.sh
file as follows.
vi ~/.padogrid/setenv.sh
Added the following in ~/.padogrid/setenv.sh
:
#
# Enter "true" to use ssh to clone GitHub repos, "false" to use https.
#
GITHUB_PRIVATE_REPO_ENABLED="true"
install_bundle
with the option, -connect ssh
Running You can also use the -connect ssh
option to connect to GitHub via ssh
instead of setting the GITHUB_PRIVATE_REPO_ENABLED
environment variable. For example, the following downloads and installs the specified bundle via ssh
from the user1
's GitHub account.
install_bundle -connect ssh -user user1 -download bundle-hazelcast-4-k8s-minishift
◀️ User Bundle Catalogs :link: Running Bundles in Container ▶️