Accessing Codeberg repos from Google Cloud Build #990
Labels
No labels
accessibility
bug
bug
infrastructure
Codeberg
contributions welcome
docs
duplicate
enhancement
infrastructure
legal
licence / ToS
please chill
we are volunteers
public relations
question
question
user support
s/Forgejo
s/Forgejo/migration
s/Pages
s/Weblate
s/Woodpecker
security
service
upstream
wontfix
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Codeberg/Community#990
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Thanks for creating and maintaining Codeberg! I've been exploring the possibility of moving over some of my repositories from GitHub, but I've gotten stuck when trying to figure out how CI/CD will work.
I'm currently using Google Cloud Build to test and deploy my code. I'd like to explore moving away from GCP eventually, but in the short term, it'd be much easier if I could continue using my existing Cloud Build configs and triggers to build and deploy code from Codeberg-hosted repositories.
I haven't found any way to do this yet, though. I was thinking I could use webhooks to trigger builds in response to commits (apparently supported by Cloud Build), but I'm not sure how to convince Cloud Build to fetch the code from Codeberg in the first place. Per Google's Cloud Build repositories page, it seems like only GitHub, GitLab, and Bitbucket are supported, and the UX seems to confirm this.
It sounds like there's another GCP thing called Cloud Source Repositories. I was hopeful that I could mirror Codeberg repositories to Cloud Source Repositories and then build from CSR, but per the docs:
I haven't explored whether there's some way to manually sync a Codeberg repository to CSR periodically.
I suspect that this is just a GCP shortcoming, but I figured I'd create an issue since I couldn't find any existing discussion online.
I managed to create a convoluted/awful/shameful system to get code from Codeberg to Cloud Build by way of Cloud Source Repositories. I created a Cloud Function that's triggered by a Gitea webhook to clone a repo from Codeberg and then run
git push --mirrorto shove the code into a CSR repo (Google makes the auth at this step super-painful). Then the Cloud Build trigger sees the change in the CSR repo and kicks off a new build. I don't know if this will be useful to anyone else, but I can try to clean up the code if there's any interest.My code and some instructions are at https://codeberg.org/derat/cloud-source-mirror, in case they help anyone.
Just as an update, Cloud Source Repositories seems like it's unavailable to new customers as of 2024-06-17 (official messaging, Reddit discussion), so the webhook workaround that I described above may no longer be an option.
Thanks for the update, and I guess sorry for the radio silence since... Is this something that is still actionable on the Codeberg / Forgejo end? @derat
@n0toose: I think that there's sadly nothing that Codeberg can do about this (maybe short of emulating whatever protocols are used for Cloud Build's existing GitHub Enterprise or GitLab Enterprise Edition support, but I have no idea what that would involve or if it's even possible).
I filed https://issuetracker.google.com/issues/354234739 requesting that Cloud Build support either Codeberg or arbitrary public git repositories, but I won't hold my breath waiting for that to happen.
Please feel free to close this issue if this tracker should only be used for things that can be addressed by Codeberg. :-)