Skip to content

Comments

add script for rebuilding dev environment #7256#7363

Merged
kcondon merged 3 commits intodevelopfrom
7256-dev-rebuild
Oct 30, 2020
Merged

add script for rebuilding dev environment #7256#7363
kcondon merged 3 commits intodevelopfrom
7256-dev-rebuild

Conversation

@pdurbin
Copy link
Member

@pdurbin pdurbin commented Oct 27, 2020

What this PR does / why we need it:

Sometimes developers benefit from dropping their database. This script does that and the subsequent setup so that API test can run.

Which issue(s) this PR closes:

Closes #7256

Special notes for your reviewer:

As mentioned in the issue and tech hours today, I've been using a variation of this script for years. That script was also in use on the phoenix server for years.

Suggestions on how to test this:

  • Set up a dev environment, create a dataset or two.
  • Run the script.
  • The dev environment should be clear and empty (no datasets, etc.).

Does this PR introduce a user interface change? If mockups are available, please link/include them here:

No.

Is there a release notes update needed for this change?:

Probably not worth mentioning.

Additional documentation:

Just the included dev guide update.

@coveralls
Copy link

coveralls commented Oct 27, 2020

Coverage Status

Coverage increased (+0.02%) to 19.445% when pulling d3778f3 on 7256-dev-rebuild into e26e4e0 on develop.

rm -rf $PAYARA_DIR/glassfish/domains/domain1/generated

echo "Deleting ALL DATA FILES uploaded to Dataverse..."
rm -rf $PAYARA_DIR/glassfish/domains/domain1/files
Copy link
Contributor

Choose a reason for hiding this comment

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

since you can change this location, can this be determined from the jvm option instead of hardcoded?

Copy link
Member Author

Choose a reason for hiding this comment

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

I had that thought, that perhaps some devs keep their data files somewhere other than default (domain1/files). I figured I'd wait until there's demand to make this configurable. We could either add a variable to the top called something like DATA_FILES_DIR or yes, perhaps pull it out from asadmin list-jvm-options.

Copy link
Contributor

Choose a reason for hiding this comment

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

OK, I'm fine with pushing that to later. Could you a) add that as a todo comment and b) add a note in the docs to point out that files would have to be in the default location?

Copy link
Member Author

Choose a reason for hiding this comment

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

Sure, fixed in ecde956.

echo "Deleting ALL DATA FILES uploaded to Dataverse..."
rm -rf $PAYARA_DIR/glassfish/domains/domain1/files

echo "Terminating database settings so we can drop the database..."
Copy link
Contributor

Choose a reason for hiding this comment

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

just because I'm curious, what does this do?

Copy link
Member Author

Choose a reason for hiding this comment

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

I'm assuming you mean the pg_terminate_backend stuff. It's just a SQL statement I found online somewhere. I didn't dig into it. In practice, it's sometimes necessary to terminate all sessions because you've got a session or two left over from pgAdmin or a terminal. In my experience, you can drop a database with open sessions.

Copy link
Contributor

Choose a reason for hiding this comment

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

Ah, makes sense. I was confused by "Terminating database settings". I think that's a typo and should be "sessions".

Copy link
Member Author

Choose a reason for hiding this comment

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

Oh, a typo. I meant sessions, not settings. Fixed in d3778f3.

@kcondon kcondon self-assigned this Oct 30, 2020
@kcondon kcondon merged commit 0b268ca into develop Oct 30, 2020
@kcondon kcondon deleted the 7256-dev-rebuild branch October 30, 2020 14:50
@djbrooke djbrooke added this to the 5.2 milestone Oct 30, 2020
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.

scripts for rebuilding a dev environment (with sample data)

5 participants