Specify a different git location for a recipe #533

Open
opened 2023-11-10 09:39:19 +00:00 by p4u1 · 4 comments
Member

Use Case:

I find a bug in a recipe or create a new feature and make those changes in the ~/.abra/recipes/<myrecipe>, so I can directly deploy the fix or the new feature. Next I push the changes to a fork and upstream the changes. While waiting for the changes to land upstream all other people managing the same server must manually change the recipe to my fork and checkout the correct branch. This is quite error prone, since I need to inform them manually and they need to do the correct git operations manually.

Feature Request:
It would be nice to optionally specify a git repository for a recipe. I can think of two places where this could be specified:

  1. In the apps .env file using e.g. a GIT_REPO env variable
  2. By overriding the catalogue somehow (#139)

With either method it would be nice to have a command for it (but not required). But it must be easy to add this information to a git repository managing the server.

**Use Case:** I find a bug in a recipe or create a new feature and make those changes in the `~/.abra/recipes/<myrecipe>`, so I can directly deploy the fix or the new feature. Next I push the changes to a fork and upstream the changes. While waiting for the changes to land upstream all other people managing the same server must manually change the recipe to my fork and checkout the correct branch. This is quite error prone, since I need to inform them manually and they need to do the correct git operations manually. **Feature Request:** It would be nice to optionally specify a git repository for a recipe. I can think of two places where this could be specified: 1. In the apps `.env` file using e.g. a `GIT_REPO` env variable 2. By overriding the catalogue somehow (#139) With either method it would be nice to have a command for it (but not required). But it must be easy to add this information to a git repository managing the server.
p4u1 added the
enhancement
label 2023-11-10 09:39:19 +00:00
p4u1 changed title from Specify a differnt git location for a recipe to Specify a different git location for a recipe 2023-11-10 09:59:11 +00:00
Owner

Thanks for raising, important one!

In the apps .env file using e.g. a GIT_REPO env variable

I wonder could this feed into: https://docs.coopcloud.tech/federation/resolutions/in-progress/013/ somehow 🤔 Generally, the simplest solution to replace your now laborious work-around is probably the one we'd want to go with. So, please feel free to sketch out something that you think will practically work for yourselves.

So, abra would honour a GIT_REPO=... remote URL in a .env file and then use that to clone the recipe if not present? Otherwise, it respects the remote and pulls from there, so that would be fine. It would try to check out tags from the catalogue tho and if those are not present in your forked recipe, that might be an isssue. However, I believe local tags are also respected and a "fetch all tags" is arranged by abra. Maybe if GIT_REPO=... is set, we ignore the (centralised) catalogue for now? Unsure, this would need some testing.

Probably you want to have a way to specify a branch in that env var? There might be something standard we can parse.

Thanks for raising, important one! > In the apps .env file using e.g. a GIT_REPO env variable I wonder could this feed into: https://docs.coopcloud.tech/federation/resolutions/in-progress/013/ somehow 🤔 Generally, the simplest solution to replace your now laborious work-around is probably the one we'd want to go with. So, please feel free to sketch out something that you think will practically work for yourselves. So, `abra` would honour a `GIT_REPO=...` remote URL in a `.env` file and then use that to clone the recipe if not present? Otherwise, it respects the remote and pulls from there, so that would be fine. It would try to check out tags from the catalogue tho and if those are not present in your forked recipe, that might be an isssue. However, I believe local tags are also respected and a "fetch all tags" is arranged by `abra`. Maybe if `GIT_REPO=...` is set, we ignore the (centralised) catalogue for now? Unsure, this would need some testing. Probably you want to have a way to specify a branch in that env var? There might be something standard we can parse.
Author
Member

I have an idea, to combine the two proposals:

We define a new Variable RECIPE which can consist of two parts:
a recipe definition and a version separated by a colon. Some examples:

RECIPE=wordpress # wordpress recipe from catalog
RECIPE=wordpress:1.2 # specific version

RECIPE=https://git.coopcloud.tech/p4u1/wordpress # recipe from git repo
RECIPE=https://git.coopcloud.tech/p4u1/wordpress:my-branch # using a specific branch

Recipe Definition
A recipe definition can be one of the following

  • a recipe name from the catalogue (with #139 the default catalogue can be overridden)
  • a git repository url starting with https://
  • (a local directory)

Version
A version can be any git ref. This includes tags, branches and commits.
When RECIPE contains a version, it gets updated when using the abra app upgrade and related commands.

I can further refine this proposal, If you think this is right direction.

I have an idea, to combine the two proposals: We define a new Variable `RECIPE` which can consist of two parts: a `recipe definition` and a `version` separated by a colon. Some examples: ``` RECIPE=wordpress # wordpress recipe from catalog RECIPE=wordpress:1.2 # specific version RECIPE=https://git.coopcloud.tech/p4u1/wordpress # recipe from git repo RECIPE=https://git.coopcloud.tech/p4u1/wordpress:my-branch # using a specific branch ``` **Recipe Definition** A recipe definition can be one of the following - a recipe name from the catalogue (with #139 the default catalogue can be overridden) - a git repository url starting with `https://` - (a local directory) **Version** A version can be any git ref. This includes tags, branches and commits. When `RECIPE` contains a version, it gets updated when using the `abra app upgrade` and related commands. I can further refine this proposal, If you think this is right direction.
Owner

Oh yeh, that looks pretty damn solid to me @p4u1 🎉

It seems also like a smaller stepping stone towards OPERATOR_SYNC_VERSION like functionality in https://docs.coopcloud.tech/federation/resolutions/in-progress/013/#details-budget-007 without the syncronisation? Maybe more people can agree to this first step.

@moritz any thoughts on this one?

Oh yeh, that looks pretty damn solid to me @p4u1 🎉 It seems also like a smaller stepping stone towards `OPERATOR_SYNC_VERSION` like functionality in https://docs.coopcloud.tech/federation/resolutions/in-progress/013/#details-budget-007 without the syncronisation? Maybe more people can agree to this first step. @moritz any thoughts on this one?
Member

Love this idea.
I would like to add the git commit as version for a specific chaos deployment #517:

RECIPE=wordpress:2.5.1+6.3.0
RECIPE=https://git.coopcloud.tech/p4u1/wordpress:2.5.1+6.3.0
RECIPE=wordpress:1c70a89ed42de
RECIPE=https://git.coopcloud.tech/p4u1/wordpress:1c70a89ed42de
Love this idea. I would like to add the git commit as version for a specific chaos deployment #517: ``` RECIPE=wordpress:2.5.1+6.3.0 RECIPE=https://git.coopcloud.tech/p4u1/wordpress:2.5.1+6.3.0 RECIPE=wordpress:1c70a89ed42de RECIPE=https://git.coopcloud.tech/p4u1/wordpress:1c70a89ed42de ```
decentral1se added the
abra
label 2024-03-27 06:22:48 +00:00
Sign in to join this conversation.
No Milestone
No project
No Assignees
3 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: coop-cloud/organising#533
No description provided.