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

Add db creation to demoservice #4497

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

hgy59
Copy link
Contributor

@hgy59 hgy59 commented Mar 14, 2021

Motivation: Demonstrate the creation of MySQL Database with resource configuration.
Linked issues:

Checklist

  • Build rule all-supported completed successfully
  • Package upgrade completed successfully
  • New installation of package completed successfully

Remarks

  • add demo of creating a mysql db by resource configuration
  • add uninstall wizard to optionally drop the database and/or the db user

@ymartin59
Copy link
Contributor

@hgy59 Would it be possible to also produce a database dump from a wizard checkbox before deletion? probably requesting for a dump destination folder, using an obvious file name like "mysql_schema_timestamp.dump.gz" for instance.

@hgy59
Copy link
Contributor Author

hgy59 commented Mar 14, 2021

@hgy59 Would it be possible to also produce a database dump from a wizard checkbox before deletion? probably requesting for a dump destination folder, using an obvious file name like "mysql_schema_timestamp.dump.gz" for instance.

As I am currently working on ffsync this would be a logical extension.
Another task is to test this with DSM7.

@DigitalBox98
Copy link
Contributor

For DSM7 if you need testers let me know.
I'm currently moving/testing some packages to this new DSM.

@publicarray
Copy link
Member

Hm so we have to create different json for DSM6 or DSM7...

You might like this bit, for removing the db only when the user wants to:

preuninst ()
{
echo "wizard_delete_data: $wizard_delete_data" >&2;
if [ "$wizard_delete_data" == "true" ]; then
resource_file="/var/packages/${SYNOPKG_PKGNAME}/conf/resource"
jq '."mariadb10-db"."drop-db-uninst" = true' $resource_file 1<> $resource_file
jq '."mariadb10-db"."drop-user-uninst" = true' $resource_file 1<> $resource_file
fi
exit 0
}

@hgy59
Copy link
Contributor Author

hgy59 commented Mar 18, 2021

You might like this bit, for removing the db only when the user wants to:

The current code has already implemented this behaviour, but does not need any code like you propose. The variables are already in the uninstall-wizard.
And you cannot only drop the db, there is a separate option (and wizard check box) to drop the user.

And AFAICS this is compatible with DSM 7.

@publicarray
Copy link
Member

Thanks @hgy59. From memory it did not work correctly on DSM7 (hence my workaround) but maybe it will be fixed before DSM7 is released. Woud be possable to have an example that works on both DSM6 and DSM7? Otherwise good job.

@publicarray publicarray self-requested a review April 4, 2021 01:00
@publicarray
Copy link
Member

The additional changes can be added in a follow-up PR

@hgy59 hgy59 mentioned this pull request Apr 11, 2021
2 tasks
- add demo of creating an mysql db with resource definition
- add uninstall wizard to optionally drop the database and/or the db user
@hgy59 hgy59 force-pushed the update_demoservice branch from 329b81b to 8f39109 Compare August 5, 2022 19:28
- use resource worker to create shared folder
- adjust wizards for shared folder creation
- create readme.html that can be opened in the browser
- create dummy file as for DSM7 we cannot create packages without content (since SynoCommunity#5163: Fully use DSM7 var directory)
@hgy59 hgy59 mentioned this pull request Dec 2, 2023
8 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants