Open adrians5j opened 1 year ago
A similar approach might be also useful for when you create new tenants in Tenant Manager. Often times when you create a tenant you don’t want to go through the installation steps, but have a tenant that’s ready to use out of the box.
I think, providing a specific installation mutation per app and having the script run at the client grants to user excellent control. He/she can easily decide to, e.g. skip unnecessary apps or add own custom apps to the installation process.
Yet another solution would be, to provide one single mutation that takes all data needed (we could even include the list of apps we want to install) and the actual steps of creating the user and installing apps are performed server-side. This feels more user-friendly and less error-prone as only one initial trigger has to be send and the rest can run on it's own in the cloud.
The Issue
At the moment, it's not easy to run any kind of tests tests against ephemeral Webiny project environments. This is because every time we deploy a new Webiny project, it first needs to be installed.
Proposed Solution
Ideally, whenever a new ephemeral environment is spun up, it would be useful to have a script that will run the installation steps before any tests are being executed. The following is a list of all the steps that would need to happen in the suggested script. Once completed, the tests should be allowed to be executed.
Steps
1. Run
InstallSecurity
GraphQL Mutation2. Run
InstallAdminUsers
GraphQL MutationExample variables:
3. Login
With the first user created in the previous step, we now need to log in. We log in directly against Amazon Cognito, using
amazon-cognito-identity-js
package (example).With this step completed, we'll be able to retrieve user's auth token, and, by attaching it as
Authorization
header to upcoming GraphQL mutations, be able to finish the installation.4. Run
InstallI18N
GraphQL MutationExample variables:
5. Run
InstallFileManager
GraphQL MutationExample variables (
srcPrefix
should be the URL to deployedapps/api
project application's Amazon CloudFront distribution):6. Run
InstallPageBuilder
GraphQL MutationExample variables:
7. Run
InstallPageBuilder
GraphQL MutationExample variables (
srcPrefix
should be the URL to deployedapps/api
project application's Amazon CloudFront distribution):8. Run
InstallPageBuilder
GraphQL Mutation