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.
Create a fresh plugin like this:
umkickstarter MY-PLUGIN-DIR -n acme.projectx
Follow Kickstarter.md to develop your new plugin locally.
2. Use 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.
pinuts.projectName = 'RestServices' pinuts.groupId = '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
You will receive an S3 bucket name and AWS access key.
Insert the following into your build.gradle
file right after pinuts.version = ...
and fill-in BUCKET_NAME
with the name you just received:
... // pinuts.projectName = 'RestServices' // pinuts.groupId = '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 } } } }
Put the AWS credentials you received into the environment variables AWS_ACCESS_KEY_ID
and AWS_SECRET_ACCESS_KEY
respectively.
After that you can build and publish your plugin like this:
gradle publish # -> acme.projectx:RestServices:devel-SNAPSHOT gradle publish -Penv=staging # -> acme.projectx:RestServices:staging-SNAPSHOT gradle publish -Penv=prod # -> acme.projectx:RestServices:prod-SNAPSHOT