-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Multi-repo using environment-variables ability #9209
Comments
@ibrah3m Interesting. Could you provide an example of how you'd want to use this concretely? 🤔 |
Sure, instead of injecting this env var in a shell script to clone the repo and rearrange the directories like the example below uses a shell script to achieve that as you can see I'm passing the repo link as an encoded URL to pass it again in the script from the init parameter inside YAML in this repo https://github.com/ibrah3m/IQdevs To make it short we can add one line inside. gitpod.yml by using both Multi-repo & environment-variables |
I'd like to see this more generally. For example, in the For For example, some open source project you'd like to contribute to. In my case, Bitcoin Core. It is not ideal at all to check in those files to your own fork because they have to be in whatever branch you're working on - so you have to keep them there in each and every short-lived branch you want to create/use. Instead, I'm using the great multi-repo feature. Gitpod configuration files and anything else I want to have over there in my own repo, and it points to my fork of the repo I'm working with. Part of the Trouble is, I'd like to share my Bitcoin Core Gitpod setup - but right now since I can only embed a hard string for the Expanding project-specific environment variables in N.B.: This following idea might actually already work but I haven't tested it yet, because dockerfiles support "environment replacement". I'll update the next paragraph once I test this, if it works.) And there are other uses for project-specific environment var expansion elsewhere too, for example, in |
HI thanks for your contribute.
so my solution already works and desgined for that purpose , but until now its only for web developers and the frameworks that ddev support it and needs to add more options like running custom commands and stuff like that in the next versions |
Thank you @ibrah3m and @david-bakin for sharing. Do I understand correctly that you're using the multi-repo feature to emulate ".gitpod.yml injection" of sorts? |
it's kinda similar but not exactly the same , I think in that case they need to pass 2 arguments #1 is the Gitpod.yml #2 the repo this my face lack of resources in case they need shell script / custom docker image were in my case you have 2 repos , you can put everything and after the prebuild the origin of the git will be replaced automatically to the targeted project |
@geropl - yes, injection of Here, by the way, is my main repo that I'm currently doing this with: https://gitlab.com/bakins-bits/gitpod-setup-for-bitcoin-core-dev Works great! Except I can't directly trigger prebuilds of the main repo when committing/pushing to the sub repo (because the sub repo doesn't _point back to the main one because the A problem with the definitely-gp approach, as I understand it, is that the basic gitpod approach (and open source generally) is to do all work in a (very) temporary branch, resulting in a PR then a merge. This means that mostly you want to do the prebuild in the temporary branch you're working in at that moment. You can do that by editing Unless you can suggest a way to do it? |
@ibrah3m I'm still struggling to understand what this is more about: Is it:
Honestly I don't think we'll introduce something like variables in .gitpod.yml, because it opens up too many degrees of freedom, and it still feels we could solve all of this in easier ways. 🤔 |
> 1. injecting/overlaying a certain config (.gitpod.yml + Dockerfile) into a repository you don't have control overHi again, for me we don't need to Dockerfile but the main goal was this one, yes to be able to work on a public repository which not prepared to run in both gitpod and ddev (doesn't contain any yml & docker & ddev configs), we achieve that by mix the public repo with repo we already made contains all config needed such as right now we use the environment variables and we pass the URL of the public repo into the shell file
the difference is the definitely-gp pass only the (.gitpod.yml + Dockerfile) directly to the public repo |
>2- or sharing a certain config between multiple repos: that's what multi-repo support is for. Except that atm, it's limited to a 1-n connection, and the only way we can make prebuilds work. that's actually what we do we need to merge our configs in the public repo as I explained above . :) |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
@geropl - any further ideas on how to solve this use case "in easier ways"? My use case in particular is: Working with bitcoin core, which I can't add a .gitpod.yml or custom dockerfile to - so I created a repo which sets up a multi repo with it and with a fork of bitcoin core. Now that repo must of necessity point to the fork in the As time passes I update this repo so it has the latest dev tools including additional bitcoin-specific tools. Now this should work for anyone wanted to work with bitcoin core, and I'd like to encourage it's adoption by other people wishing to work with bitcoin core. (And you would like to encourage its adoption too because it uses gitpod.io!) If such a dev wants to use the current setup he has to clone not only bitcoin core but also my "main" repo here. And then change the .gitpod.yml to point to his fork. And then, as time passes, remember occasionally to sync his fork of my "main" repo to get the latest and greatest stuff. Kind of tedious, and all overhead, when all he really wants to do is work seamlessly with bitcoin core, using the awesome gitpod.io cloud dev facility. If instead the Env var expansion in .gitpod.yml seem good to me but you had concerns that it opens up too much. So I'm not fixated on it. It's just what seemed available. Note that I also have a reason to want some kind of external customization of the |
Is your feature request related to a problem? Please describe
Inside .gitpod.yml
The multi-repo parameter does not support any type of environment variables now
Describe the behavior you'd like
I recommend providing an option to make us able to pass/get the main configuration from
environment-variables like the example below
mainConfiguration: $MY_VAR // should already exist or be passed by the URL
The text was updated successfully, but these errors were encountered: