The content in this post may be outdated. For the most recent post concerning private Git repositories, please visit the Private Git Repositories series.
But do not worry, there is a solution.
You can upload some private key to OpenShift and authorize its public counterpart at the git hosting, and with those in place, OpenShift will be able to access your private git repository. I do not want to go into too many details here, you can read more in the documentation linked earlier.
First, generate an RSA key that is going to be uploaded to OpenShift (be careful not to overwrite your current keys)
<code>ssh-keygen -t rsa -C "my_secret_key_for_OpenShift"</code>
Then, you upload the key to OpenShift:
<code>oc secrets new-sshauth sshsecret --ssh-privatekey=$HOME/.ssh/id_rsa</code>
After that, you provide this key to the builder service account:
<code>oc secrets add serviceaccount/builder secrets/sshsecret</code>
Finally, you need to update your build configuration:
<code>oc patch buildConfig myapp -p '{"spec":{"source":{"sourceSecret":{"name":"sshsecret"}}}}'</code>
And that’s it! Authorize the public key for your repository and you are ready to go!
À propos de l'auteur
Plus de résultats similaires
Looking ahead to 2026: Red Hat’s view across the hybrid cloud
Red Hat to acquire Chatterbox Labs: Frequently Asked Questions
Edge computing covered and diced | Technically Speaking
Parcourir par canal
Automatisation
Les dernières nouveautés en matière d'automatisation informatique pour les technologies, les équipes et les environnements
Intelligence artificielle
Actualité sur les plateformes qui permettent aux clients d'exécuter des charges de travail d'IA sur tout type d'environnement
Cloud hybride ouvert
Découvrez comment créer un avenir flexible grâce au cloud hybride
Sécurité
Les dernières actualités sur la façon dont nous réduisons les risques dans tous les environnements et technologies
Edge computing
Actualité sur les plateformes qui simplifient les opérations en périphérie
Infrastructure
Les dernières nouveautés sur la plateforme Linux d'entreprise leader au monde
Applications
À l’intérieur de nos solutions aux défis d’application les plus difficiles
Virtualisation
L'avenir de la virtualisation d'entreprise pour vos charges de travail sur site ou sur le cloud