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

Passing database name 1 #13

Merged

Conversation

tnelson-doghouse
Copy link
Contributor

@tnelson-doghouse tnelson-doghouse commented Aug 29, 2024

Purpose

  • To allow the passing of the MTK_DUMP_* variables into the task in one
    way or another, rather than assuming that the database is going to be
    the one in the Lagoon service

  • Also instead allow the passing of the name of a variable that contains
    the MTK_DUMP_* value. For example,

    MTK_DUMP_HOSTNAME_NAME=DB_HOSTNAME_CENTRAL
    

    ... means that MTK_DUMP_HOSTNAME will be set to the value of
    DB_HOSTNAME_CENTRAL

Primary Changes

  • Added calc_MTK_variable function which sets up one MTK_DUMP_* variable
  • Set all the MTK_DUMP_* variables using the above function (and replaced
    existing code that set them)
  • Changed GraphQL example to allow for the new variables

Other changes

  • Removed san_db_tarfile line since it's not used
  • A few tweaks based on the output of https://www.shellcheck.net/ (which
    you can install locally)
  • Added a little more to the README

closes #14

Purpose
-------
-	To allow the passing of the MTK_DUMP_* variables into the task in one
	way or another, rather than assuming that the database is going to be
	the one in the Lagoon service
-	Also instead allow the passing of the name of a variable that contains
	the MTK_DUMP_* value.  For example,

		MTK_DUMP_HOSTNAME_NAME=DB_HOSTNAME_CENTRAL

	... means that MTK_DUMP_HOSTNAME will be set to the value of
	DB_HOSTNAME_CENTRAL

Primary Changes
---------------
-	Added calc_MTK_variable function which sets up one MTK_DUMP_* variable
-	Set all the MTK_DUMP_* variables using the above function (and replaced
	existing code that set them)
-	Changed GraphQL example to allow for the new variables

Other changes
-------------
-	Removed san_db_tarfile line since it's not used
-	A few tweaks based on the output of https://www.shellcheck.net/ (which
	you can install locally)
@tnelson-doghouse
Copy link
Contributor Author

For the record, this one was discussed with Sean. Our plan is that:

  • The new variables will only be used for Captivate and similar projects that have a multi-tenant setup
  • Most of the variables will be hardcoded somewhere; I'm thinking the task GQL would be a good place
  • We can have the Dev or Ops team pass in the database name so that we can dump a sanitised database which /isn't/ configured in Lagoon

HTH,

Copy link
Member

@shreddedbacon shreddedbacon left a comment

Choose a reason for hiding this comment

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

I'm fine with this. I'd just like the example graphql command split to its own example file.

@tnelson-doghouse
Copy link
Contributor Author

Hi @shreddedbacon , have updated the PR as requested.

Thanks!

@shreddedbacon shreddedbacon merged commit 2ace668 into uselagoon:main Nov 22, 2024
1 check failed
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.

Make it support the passing in of a database name
2 participants