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

Feature: add support for "MONGODB_URI" environment variable #30

Merged
merged 10 commits into from
Jul 9, 2020

Conversation

skomma
Copy link
Member

@skomma skomma commented Jul 7, 2020

What I did

  • add support for "MONGODB_URI" variable(implementation/test)
  • update README.md
  • Incidentally
    • update alpine/google-cloud-sdk
    • add description of the available but not documented options in README.md
    • add test to restore using "MONGODB_DBNAME" variable

bin/backup.sh Show resolved Hide resolved
bin/restore.sh Show resolved Hide resolved
skaffold.yaml Show resolved Hide resolved
test/s3/e2e.sh Show resolved Hide resolved
- restore

# test for backup in command mode using "MONGODB_URI" environment variable
app_mongodb_uri: &app_mongodb_uri
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you don't use it for merge, &app_mongodb_uri is unnecessary.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed the anchor.

skaffold.yaml Show resolved Hide resolved
if [ "x${MONGODB_AUTHDB}" != "x" ]; then
MONGODUMP_OPTS="${MONGODUMP_OPTS} --authenticationDatabase ${MONGODB_AUTHDB}"
if [ "x${MONGODB_URI}" != "x" ]; then
MONGODUMP_OPTS="--uri=${MONGODB_URI} ${MONGODUMP_OPTS}"
Copy link
Contributor

@ryu-sato ryu-sato Jul 8, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't I quote MONGODB_URI in case it contains &?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested with a URI containing &, but it works as expected.

@skomma skomma merged commit a6c8726 into master Jul 9, 2020
@skomma skomma deleted the feat/add-uri-option branch July 9, 2020 02:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants