Example for mongodb? #8
Comments
Any plans for this request ? |
Not sure if this is best practice... but would something like this be useful to you?
|
@cjwiseman11 Thanks for message, Yea that we are using as of now and install mongo as 0 step. But I guess as this is so common use, rather than writing whole isntallation steps better to just make an action call. We actually wrote these steps in a install.sh script and call to keep it clean. |
I am just running mongo as docker which is enough for me to test my stuff with minimal steps to install/run dependency.
|
I'm using such setup as well |
Yeah, this is probably the "straight" way to do it, however, having to do this each time is kind of time consuming. I would like to look for base images that contains mongodb, like what circle-ci provides, . |
I just created an Action based on docker and published, my first attempt, Basically starts mongodb specific version as detach docker container. Nothing fancy just a utility https://github.com/marketplace/actions/start-mongodb-as-docker |
You can use GitHub Actions Services within your jobs, like this services:
mongodb:
image: mongo:3.4.23
ports:
- 27017:27017 Basically, you can add any service in a container using any docker image (I think). More info here https://help.github.com/en/actions/automating-your-workflow-with-github-actions/workflow-syntax-for-github-actions#jobsjob_idservices |
Any chance to make it work on Windows? |
I was able to get
It seems there is ~8GB of space available on the runner and the mongo docker container only takes up ~400MB of space... |
@ktutnik Thanks, Yes we figure it out and using services now. Its cool allows to express multiple versions as well. vhttps://github.com/opencb/cellbase/blob/next/.github/workflows/main.yml#L37 |
What if I would like to add a command to mongodb using services? services:
mongo:
image: mongo
command: --serviceExecutor adaptive I get this error:
|
Try env instead of command because there is no command option like docker compose under services : https://help.github.com/en/actions/automating-your-workflow-with-github-actions/workflow-syntax-for-github-actions#jobsjob_idcontainerenv |
What env var should I use to add options to mongod command? I can’t find it
Daniel
… On 28 Jan 2020, at 12:16, wbari ***@***.***> wrote:
Try env instead of command because there is no command option like docker compose under services : https://help.github.com/en/actions/automating-your-workflow-with-github-actions/workflow-syntax-for-github-actions#jobsjob_idcontainerenv
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub, or unsubscribe.
|
I just submitted #21 for anyone interested in a mongo example. |
I've been using the basic implementation suggested above (using the |
I haven't had this issue, but you could try using the healthcheck-enabled image: mongo to image: healthcheck/mongo |
MongoDB is widely used in personal projects and enterprise products, but there virtually no documentation or example of using it in GitHub-action.
The addition of a workflow involving MongoDB would be great.
The text was updated successfully, but these errors were encountered: