Git Product home page Git Product logo

Comments (7)

Philmod avatar Philmod commented on July 28, 2024 2

Hey!

We don’t have an integrated solution as of today, but here are a few solutions coming from users:

  1. Create a Github token with “repo” scope, then use this syntax in the package.json:

"my-private-module": "git+https://<github_token>:[email protected]/<user>/<repo>.git"

  1. Use a Deploy or User Key that you could store in GCS for example, and pull it as a previous build step.

I hope this helps.

from cloud-builders.

bendory avatar bendory commented on July 28, 2024 2

This newly-published doc on Using Encrypted Files in your build should be helpful.

from cloud-builders.

DocBradfordSoftware avatar DocBradfordSoftware commented on July 28, 2024

I have a "hack" not what I would call a "solution" to this problem. It involves,

  1. Make a copy of package.json
  2. Download private repo, using either gcloud builder or git buider.
  3. remove private repo from package.json
  4. run npm install.
  5. copy private repo to node_modules.
  6. replace package.json with original.
  7. run npm rebuild.
  8. build image.

It's not elegant.

from cloud-builders.

DocBradfordSoftware avatar DocBradfordSoftware commented on July 28, 2024

Thanks, @Philmod, the only problem with that approach, is that if you don't commit the url including the github token to GitHub, you will have to do some kind of "sed" like replacement in package.json. You would have to do it both on the developer side and the builder side, or .gitignore package.json and copy package.json.builder to package.json, all of which is messy. I think i'll need to do the same thing that i did with kubectl bring the git auth in from GCS and configure git. Like it is on my dev box.

from cloud-builders.

DocBradfordSoftware avatar DocBradfordSoftware commented on July 28, 2024

Wow, thanks @bendory, that is simple and effective. Way better than storing the account.json file in gs//.

from cloud-builders.

bendory avatar bendory commented on July 28, 2024

Great! So glad you like it!
Shall we close this issue?

from cloud-builders.

bendory avatar bendory commented on July 28, 2024

I'm closing this issue with the assumption that our doc on Using Encrypted Files resolves this issue. Please re-open if that does not provide you with what you need.

from cloud-builders.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.