-
Notifications
You must be signed in to change notification settings - Fork 1
33 lines (27 loc) · 1.15 KB
/
Copy pathexampleAll.yml
File metadata and controls
33 lines (27 loc) · 1.15 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# mongotools example to install all
name: action-mongo-tools-exampleAll
on:
workflow_dispatch: # allow manual trigger only for example
jobs:
mongo-tools-example-steps:
# The type of runner that the job will run on https://github.com/actions/runner-images/tree/main/images/linux
runs-on: ubuntu-22.04
services:
mongodb:
image: mongo
ports:
- 27017:27017
steps:
# action-mongo-tools without parameters install both : mongo-tools and mongo-shell
- name: Setup mongo tools - mongo-tools and mongo-shell
uses: boly38/action-mongo-tools@stable
- name: Mongo-shell usage - setup mongo user
# doc: https://docs.mongodb.com/manual/reference/built-in-roles/ "Backup and Restoration Roles"
# doc: https://docs.mongodb.com/manual/reference/method/db.createUser/
run: |
mongosh --version
mongosh admin --eval 'db.createUser({user:"root",pwd:"mypass",roles:[{"role":"readWrite","db":"myDbForTest"}, "restore"]});'
- name: Mongo-tools usage
run: |
mongodump --version
mongorestore --version