Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add link command to create versioned binaries #73

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

dgomezferro
Copy link
Contributor

@dgomezferro dgomezferro commented Dec 22, 2021

This is useful for multiversion tests, but feel free to suggest alternative ways of doing it (for instance during installation)

$ ls ~/.local/bin -l
total 28
[...]
lrwxrwxrwx 1 ubuntu ubuntu   56 Dec 22 15:04 install_compass -> /home/ubuntu/.local/m/versions/5.0.3/bin/install_compass
lrwxrwxrwx 1 ubuntu ubuntu   46 Dec 22 15:04 mongo -> /home/ubuntu/.local/m/versions/5.0.3/bin/mongo
lrwxrwxrwx 1 ubuntu ubuntu   46 Dec 22 15:15 mongo-5.0 -> /home/ubuntu/.local/m/versions/5.0.5/bin/mongo
lrwxrwxrwx 1 ubuntu ubuntu   46 Dec 22 15:15 mongo-5.1 -> /home/ubuntu/.local/m/versions/5.1.1/bin/mongo
lrwxrwxrwx 1 ubuntu ubuntu   50 Dec 22 15:15 mongo-5.2 -> /home/ubuntu/.local/m/versions/5.2.0-rc2/bin/mongo
lrwxrwxrwx 1 ubuntu ubuntu   47 Dec 22 15:04 mongod -> /home/ubuntu/.local/m/versions/5.0.3/bin/mongod
lrwxrwxrwx 1 ubuntu ubuntu   47 Dec 22 15:15 mongod-5.0 -> /home/ubuntu/.local/m/versions/5.0.5/bin/mongod
[...]

@stennie
Copy link
Collaborator

stennie commented Jan 13, 2022

@dgomezferro FYI you can select an installed mongod/mongos/mongo version with m <binary> <version>:

m mongod 5.0  --version
db version v5.0.5

Would that work for your testing use case or would you prefer symlinks so you can test if a file exists?

You may also find the JSON output of installed versions and paths helpful for test integration: m lls --json.

Cheers,
Stennie

@dgomezferro
Copy link
Contributor Author

@stennie I used this for multiversion tests, they expect multiple versions of the mongod binaries available in the PATH with format mongod-X.Y.

If the feature doesn't belong in m that's fine by me though. I've just learned about db-contrib-tool that should take care of setting up the environment for tests, haven't tried it yet though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants