-
Notifications
You must be signed in to change notification settings - Fork 17
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
Improvement: Add time string to filename #19
Conversation
4d42c6f
to
4433f5e
Compare
4433f5e
to
9398c1e
Compare
@@ -152,7 +152,7 @@ TODAY=`/bin/date +%Y%m%d` # It is used to generate file name to restore | |||
echo "=== $0 started at `/bin/date "+%Y/%m/%d %H:%M:%S"` ===" | |||
|
|||
# Validate environment variables | |||
REQUIRED_ENVS=("GCP_ACCESS_KEY_ID" "GCP_SECRET_ACCESS_KEY" "GCP_PROJECT_ID" "TARGET_BUCKET_URL" "DOT_BOTO_OAUTH") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
GCP_ACCESS_KEY_ID
と GCP_SECRET_ACCESS_KEY
があれば、必ずしも必要には見えなかったので削った。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
GCS 用のテストでは GCP_ACCESS_KEY_ID と GCP_SECRET_ACCESS_KEY を使って mab を実行するケースと、
DOT_BOTO_OAUTH で指定された OAuth 設定ファイルを使って mab を実行するケースの 2 パターンをテストするので、 DOT_BOTO_OAUTH
も必須項目です。(下記で使っている)
mongodb-awesome-backup/test/gcs/e2e.sh
Line 54 in 54b7cd5
echo -e "$DOT_BOTO_OAUTH" > 'conf/.boto_oauth' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ここに書いてることと矛盾しない?
この手順の通りだと、 DOT_BOTO_OAUTH
なんて環境変数は指定しないでテストを実行するように言ってるし、実際 test/gcs/e2e.sh
は REQUIRED_ENVS
から削ったうえで、 conf/.boto_oauth
が存在していれば DOT_BOTO_OAUTH
環境変数はなくても動いた。
(= 必ずしもテストを動かすのには必須じゃないと思ってる)
CircleCI で環境変数指定で渡すために使ってるとか?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
確かに手順と矛盾しますね。
必須ではなく、「config/.boto_oauth
ファイルを作成するか、環境変数 DOT_BOTO_OAUTH
を指定する必要がある」が正しいですね。
そうなると必須ではないので除外すべきだと思います。 👍
bin/functions.sh
Outdated
create_current_yyyymmddhhmmss() { | ||
echo `/bin/date +%Y%m%d%H%M%S` | ||
} | ||
|
||
# Create today's date string(YYYYmmdd) | ||
create_today_yyyymmdd() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
テスト時に使うので、today は引き続き取っておいてある。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
使ってませんでした orz
機会があれば test で function.sh を取り込んで create_today_yyyymmdd
を使うように修正ですかね。
mongodb-awesome-backup/test/s3/e2e.sh
Line 40 in 54b7cd5
TODAY=`/bin/date +%Y%m%d` # It is used to generate file name to restore |
mongodb-awesome-backup/test/gcs/e2e.sh
Line 150 in 54b7cd5
TODAY=`/bin/date +%Y%m%d` # It is used to generate file name to restore |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ほんまや。
機会があれば test で function.sh を取り込んで create_today_yyyymmdd を使うように修正ですかね。
テストが本体側のコードを参照するのはなんかおかしい気もするので、いったん消した。
bin/functions.sh
Outdated
create_current_yyyymmddhhmmss() { | ||
echo `/bin/date +%Y%m%d%H%M%S` | ||
} | ||
|
||
# Create today's date string(YYYYmmdd) | ||
create_today_yyyymmdd() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
使ってませんでした orz
機会があれば test で function.sh を取り込んで create_today_yyyymmdd
を使うように修正ですかね。
mongodb-awesome-backup/test/s3/e2e.sh
Line 40 in 54b7cd5
TODAY=`/bin/date +%Y%m%d` # It is used to generate file name to restore |
mongodb-awesome-backup/test/gcs/e2e.sh
Line 150 in 54b7cd5
TODAY=`/bin/date +%Y%m%d` # It is used to generate file name to restore |
@@ -152,7 +152,7 @@ TODAY=`/bin/date +%Y%m%d` # It is used to generate file name to restore | |||
echo "=== $0 started at `/bin/date "+%Y/%m/%d %H:%M:%S"` ===" | |||
|
|||
# Validate environment variables | |||
REQUIRED_ENVS=("GCP_ACCESS_KEY_ID" "GCP_SECRET_ACCESS_KEY" "GCP_PROJECT_ID" "TARGET_BUCKET_URL" "DOT_BOTO_OAUTH") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
GCS 用のテストでは GCP_ACCESS_KEY_ID と GCP_SECRET_ACCESS_KEY を使って mab を実行するケースと、
DOT_BOTO_OAUTH で指定された OAuth 設定ファイルを使って mab を実行するケースの 2 パターンをテストするので、 DOT_BOTO_OAUTH
も必須項目です。(下記で使っている)
mongodb-awesome-backup/test/gcs/e2e.sh
Line 54 in 54b7cd5
echo -e "$DOT_BOTO_OAUTH" > 'conf/.boto_oauth' |
@@ -152,7 +152,7 @@ TODAY=`/bin/date +%Y%m%d` # It is used to generate file name to restore | |||
echo "=== $0 started at `/bin/date "+%Y/%m/%d %H:%M:%S"` ===" | |||
|
|||
# Validate environment variables | |||
REQUIRED_ENVS=("GCP_ACCESS_KEY_ID" "GCP_SECRET_ACCESS_KEY" "GCP_PROJECT_ID" "TARGET_BUCKET_URL" "DOT_BOTO_OAUTH") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
確かに手順と矛盾しますね。
必須ではなく、「config/.boto_oauth
ファイルを作成するか、環境変数 DOT_BOTO_OAUTH
を指定する必要がある」が正しいですね。
そうなると必須ではないので除外すべきだと思います。 👍
No description provided.