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

cleanup of bash scripts #802

Merged
merged 8 commits into from
Aug 23, 2019
Merged

cleanup of bash scripts #802

merged 8 commits into from
Aug 23, 2019

Conversation

kolbe
Copy link
Contributor

@kolbe kolbe commented Aug 21, 2019

What problem does this PR solve?

This PR resolves several bash mistakes and brings the scripts in-line with best practices, while adding some new features.

What is changed and how does it work?

Variable expansions are quotes, lowercase variable names are used, tests are cleaned up.

Check List

Tests

  • Manual test (add detailed scripts or steps below)
    I manually tested a number of permutations, including changes to project, removing credentials files, etc.

Does this PR introduce a user-facing change?:

NONE

@kolbe kolbe requested a review from gregwebs August 21, 2019 22:32
@CLAassistant
Copy link

CLAassistant commented Aug 21, 2019

CLA assistant check
All committers have signed the CLA.

fi

GCLOUD="gcloud --project $PROJECT"
if ! [[ -d .terraform ]]; then
Copy link
Contributor

Choose a reason for hiding this comment

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

The way the docs are written now, someone would run this before running terraform init. https://pingcap.com/docs/v3.0/tidb-in-kubernetes/deploy/gcp-gke/

Copy link
Contributor

Choose a reason for hiding this comment

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

This new approach uses terraform console which is much more reliable. We can update the code snippet in the docs to have terraform init before running this.

fi

GCLOUD="gcloud --project $PROJECT"
if ! [[ -d .terraform ]]; then
echo "no .terraform directory, perhaps you need to run ''terraform init''?" >&2
Copy link
Contributor

Choose a reason for hiding this comment

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

All the quoting looked a little odd to me, but no big deal.

@gregwebs
Copy link
Contributor

I ran this myself. I already have the service account and it properly recognized that.

@gregwebs gregwebs merged commit cbaa8a2 into pingcap:master Aug 23, 2019
yahonda pushed a commit that referenced this pull request Dec 27, 2021
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.

3 participants