If you have decided to use the custom cloud bundle variant, your site is hosted in Magnolia Cloud and you, or your cloud partner, must create and deploy the custom bundle.
To successfully deploy custom bundles to Magnolia Cloud, certain best practices must be followed when creating your project and when deploying it the first time or continuously thereafter.
Creating your custom bundle
Magnolia provides a cloud-specific option in the Magnolia Maven Archetype to bootstrap a new project.
Until version 1.3 of the magnolia-cloud-project-archetype
has been released, use the snapshot catalog: -DarchetypeCatalog=https://nexus.magnolia-cms.com/content/repositories/magnolia.public.snapshots
You receive your subscription-code and access keys during the Magnolia Cloud onboarding process.
Usage
mvn org.apache.maven.plugins:maven-archetype-plugin:2.4:generate -DarchetypeCatalog=https://nexus.magnolia-cms.com/content/groups/public/ ... 6: https://nexus.magnolia-cms.com/content/repositories/magnolia.public.snapshots -> info.magnolia.maven.archetypes:magnolia-cloud-project-archetype (Automates the creation of a Magnolia Cloud project: parent pom and webapp) Choose a number or apply filter (format: [groupId:]artifactId, case sensitive contains): : 6 Define value for property 'groupId': : com.mycompany.project Define value for property 'artifactId': : web-project-xyz Define value for property 'version': 1.0-SNAPSHOT: : Define value for property 'package': com.mycompany.project: : Define value for property 'cloud-subscription-code': : mycompany-project Define value for property 'magnolia-bundle-version': : 6.2.1 Define value for property 'project-name': web-project-xyz: : Confirm properties configuration: groupId: com.mycompany.project artifactId: web-project-xyz version: 1.0-SNAPSHOT package: com.mycompany.project cloud-subscription-code: mycompany-project magnolia-bundle-version: 6.2.1 project-name: web-project-xyz Y: : Y ... [INFO] project created from Archetype in dir: /Users/user/dev/web-project-xyz [INFO] ------------------------------------------------------------------------ [INFO] BUILD SUCCESS [INFO] ------------------------------------------------------------------------ [INFO] Total time: 02:18 min [INFO] Finished at: 2020-04-23T13:12:46+02:00 [INFO] ------------------------------------------------------------------------
Further instructions and best practice information are provided in your project's README.md
.
The Magnolia Maven Archetype generates a best-practice project skeleton. For example:
my-mgnl-cloud-webapp/ ├── pom.xml └── src └── main └── webapp └── WEB-INF └── config └── dev │ └── README.md │ └── magnolia.properties └── shared └── README.md └── magnolia.properties
Note that upon creation:
- Two default profiles are generated:
dev
andshared
. These profiles have their ownmagnolia.properties
files. - During packaging, the
dev
profile is excluded. Theshared
profile is included and deployed to Magnolia Cloud. - You can add local developer credentials to the
dev
profile to be used instead of the typical Magnolia superuser/superuser, which is disabled in the cloud. - In the
shared
profile, you can create specific.properties
files for each cloud environment. This can be used, for example, to test the integration of a third-party tool in the UAT environment without affecting your Live environment.
If you created a custom bundle before Magnolia 6.2.1 with .properties
file changes, please check your customizations carefully and adhere to the structure shown above.
Continuous integration and deployment of custom bundles
You must use the Magnolia Cloud Maven Plugin for the continuous integration and deployment (CI/CD) of custom bundles to Magnolia Cloud. The plugin validates and uploads your custom cloud bundle and deploys it to Magnolia's pipelines.
Make sure you use the latest version of the Magnolia Cloud Maven Plugin when deploying a new bundle to Magnolia Cloud: v1.0-RC6 (available soon)
More information can be found in the readme here: https://git.magnolia-cms.com/projects/OD/repos/magnolia-cloud-maven-plugin/browse/README.md
Validation of the custom bundle
The plugin performs validation checks against the built artifact (webapp) to ensure compatibility with the Magnolia Cloud infrastructure:
- Basic checks for required configuration in the
web.xml
andmagnolia.properties
files. - Inspection of required and blacklisted modules/jars.
Deployment of the WAR file
The plugin uploads the built artifact to the entry point for Magnolia Cloud's deployment pipelines. It also collects meta-information about the artifact for debugging purposes.
Magnolia Cloud Simulator
We recommend you test your custom bundle in a simulated cloud environment before deploying it.
To do so, we offer a docker-compose based setup: Magnolia Cloud Simulator.