mirror of
https://github.com/fsouza/fake-gcs-server.git
synced 2026-04-25 21:55:56 +03:00
[GH-ISSUE #619] Add an example to run the image in .gitlab-ci.yml #107
Labels
No labels
bug
compatibility-issue
docker
documentation
enhancement
help wanted
needs information
pull-request
question
stale
unfortunate
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/fake-gcs-server#107
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?
Originally created by @sorasful on GitHub (Nov 10, 2021).
Original GitHub issue: https://github.com/fsouza/fake-gcs-server/issues/619
Hello,
As I'm starting to use fake-gcs-server for one of my project, I'm trying to setup a service in my .gitlab-ci.yml file. So far I have some troubles to set it up. But once I figure it out, what would you think about adding a section in the documentation to show the configuration to be able to run it in Gitlab-CI ?
@fsouza commented on GitHub (Nov 11, 2021):
@sorasful hey, yeah we could add that to the documentation x)
Let me know if I can help in any way.
@sorasful commented on GitHub (Nov 11, 2021):
@fsouza Yeah, I think that a lot of people use this for their projects in their CI, I'm personnally using Gitlab-ci so I thought this would be a good idea. Could be great for other platforms too, but let's open an issue when that will be needed.
Also, I didn't manage to make it work yet, I have some troubles with :
And my Gitlab-ci looks like this :
@sorasful commented on GitHub (Nov 12, 2021):
Okay, so despite the warning saying
No HOST or PORT foundit seems that the service starts well and is working. Now just need to find out how to add volumes.@matthewbal commented on GitHub (Jun 14, 2023):
I'm also trying to get this to work, I'll post my gitlab-ci when I manage to get it connecting properly.
@matthewbal commented on GitHub (Jun 15, 2023):
We have a FastAPI project, using the async google cloud storage library gcloud.aio.storage.
This is what I had to do:
in gitlab-ci.yml
Then, when you want to connect to the container, you need to reference the hostname like this (gitlab by default maps service names to hostnames and replaces / with -)
You can't use volumes in gitlab, so there's no easy way to create your bucket and test files, so I used a pytest autouse fixture to do that.
Now from tests we are able to connect to the bucket
fake-bucket, and the filetest.txtis already loaded onto it.Locally, if you use docker compose, you would need to connect with
http://localhost:4443from outside the docker stack, but from within the docker stack you can also usehttp://fsouza-fake-gcs-server:4443as long as you set the service name up that way.Here's a docker-compose for completeness:
Hope this helps someone!