Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -90,3 +90,4 @@ jobs:
actions: read # Needed for GitHub API call to get workflow version
packages: write # Needed to publish to GitHub Container Registry
contents: write # Needed to create git tags
security-events: write # Needed by rocks-publish.yaml Trivy SARIF upload
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,15 @@ mongodb-artifacts/
│ └── mongodb-server-sharded/ # Snap for a full MongoDB sharded deployment that includes both `mongod` and `mongos`.
└── rocks/
└── slim/
├── mongodb-server-replicaset/ # Rock for a MongoDB replica set deployment.
└── mongodb-server-sharded/ # Rock for a full MongoDB sharded deployment that includes both `mongod` and `mongos`.
└── mongos/
├── snaps/
│ └── slim/
│ └── mongos/ # Snap for the MongoDB sharded cluster query router only (`mongos`).
└── rocks/ # future mongos rocks
└── rocks/
│ └── slim/
└── mongos/ # Rock for the MongoDB sharded cluster query router only (`mongos`).
```

## Getting started
Expand Down
64 changes: 64 additions & 0 deletions mongodb/rocks/slim/mongodb-server-replicaset/CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
# Contributing

## Install prerequisites
```bash
sudo snap install rockcraft --classic
sudo snap install docker
```

By default, Docker is only accessible with root privileges (sudo). We want to be able to use Docker commands as a regular user:

```bash
sudo addgroup --system docker
sudo adduser $USER docker
newgrp docker
```

Restart Docker

```bash
sudo snap disable docker
sudo snap enable docker
```

## Clone repository
```bash
git clone https://github.com/canonical/mongodb-artifacts.git
cd mongodb-artifacts/mongodb/rocks/slim/mongodb-server-replicaset
```

## Packing the rock
```bash
rockcraft pack
```

## Run lint
```bash
tox -e lint
```

## Testing

The integration tests are [spread](https://github.com/canonical/spread) tasks
that exercise the rock through Docker. `rockcraft test` packs the rock, loads it
into Docker, and runs every task under `spread/tests/`.

Run all tests:
```bash
rockcraft test
```

Run a single suite (for example only the smoke task):
```bash
rockcraft test craft:ubuntu-24.04:spread/tests/smoke
```

The suites are:

- `spread/tests/smoke` — fast checks: mongod starts and accepts connections,
the keyfile is auto-generated, `get-keyfile` / `set-keyfile` work, and the
config / PID-file paths are correct.
- `spread/tests/replicaset` — a replicaset test with authentication.

Each task manages its own containers and cleans them up in its `restore`
section, so they do not interfere with any cluster you run by hand.
Loading
Loading