The following article describes how you can create and publish a custom UM plugin that is to be integrated into a cloud-hosted UM at AWS.
1. Create plugin using Kickstarter
Follow Install Kickstarter to prepare your local machine to create and develop Kickstarter-based UM projects.
Then, choose a Java-style package name for your new plugin --– e.g. de.acme.projectx
. (See also ACME Corporation)
...
Codeblock | ||
---|---|---|
| ||
umkickstarter MY-PLUGIN-DIR -n de.acme.projectx |
Follow Kickstarter.md to develop your new plugin locally.
2. Provide meaningful artifact names
Edit build.gradle
and change the default project name and group id to something meaningful. These settings will make up the name of the artifact that you will publish later on.
Codeblock | ||
---|---|---|
| ||
pinuts.projectName = 'RestServices'
pinuts.groupId = 'de.acme.projectx' |
3. Prepare publishing the plugin
If Pinuts is hosting your UM installation at AWS, there already is an S3 bucket ready to be used as a maven repository. Ask us for the respective credentials: support@pinuts.de Pinuts Support
You will receive an S3 bucket name and AWS access key. We will also provide you with AWS console credentials to enable you to view all the logfiles available.
Insert the following into your build.gradle
file right after pinuts.version = ...
and fill-in BUCKET_NAME
with the name you just received:
Codeblock | ||
---|---|---|
| ||
... // pinuts.projectName = 'RestServices' // pinuts.groupId = 'de.acme.projectx' // pinuts.version = getVersionFromPluginDescriptor('the_plugin/plugin.desc.json') publishing { publications { cmsbsPlugin(MavenPublication) { groupId = pinuts.groupId artifactId = pinuts.projectName version = "${pinuts.env}-SNAPSHOT" artifact getCmsbsPluginDistFile() } } repositories { maven { name "s3bucket" url "s3://BUCKET_NAME/snapshots" credentials(AwsCredentials) { accessKey awsCredentials.AWSAccessKeyId secretKey awsCredentials.AWSSecretKey } } } } |
...
After that you can build and publish your plugin like this:
Codeblock |
---|
gradle publish -Penv=test # -> de.acme.projectx:RestServices:develtest-SNAPSHOT gradle publish -Penv=staging # -> de.acme.projectx:RestServices:staging-SNAPSHOT gradle publish -Penv=prod # -> de.acme.projectx:RestServices:prod-SNAPSHOT |
4. Have Pinuts integrate your plugin
After your new plugin has been published to the respective S3 bucket, contact support@pinuts.de Pinuts Support to have us integrate the new plugin into your UM cloud deployment.
...
We will also give you an HTTP endpoint to trigger a deployment to devel test, staging or prod.
5. Trigger deployment
You will be able to trigger a deployment of your published plugin into the cloud-hosted UM by sending an HTTP request to our GitLab like this:
...
We will provide you with the appropriate values for TOKEN
and PROJECT_ID
. REF_NAME
is the name of the destination environment and should always be devel
test
, staging
or prod
.
6. Login to AWS console to watch the logs
Whenever your UM instance won’t start up properly, you will not be able to open Tools / Logs from the backoffice GUI to see what went wrong.
Go to https://eu-central-1.console.aws.amazon.com/cloudwatch/home?region=eu-central-1#logsV2:log-groups and sign in with the credentials you received (see section 3 above).