Plugins deployments

In order to deploy and release a dashboard plugin you need to follow these steps:‌

  • Having the plugin repo in Bitbucket.

  • Go to plugin repo.

  • Click on Settings.

  • Under "Pipelines" section click on Settings.

  • Enable the switch button "Enable Pipelines".

  • Back to Settings under "Pipelines" section again click on Deployments.

  • Configure with the following environments (You need to remove the default ones and create new)

Configuration

First go to Repository settings and navigate to Repository variables, and add the following variables:

ame

Value

S3_REGION

eu-west-1

S3_ACCESS_KEY

1Password -> Dashboard credentials & keys -> Plugins-Deploy

S3_SECRET_ACCESS_KEY

1Password -> Dashboard credentials & keys -> Plugins-Deploy

Then navigate to Deployments and fix them with the following:

‌Dev deployment

Environment name: Global-Dev‌

Environment variables:

Required:

Name

Value

S3_BUCKET_NAME

dashboard-plugins-global-dev

Optional: *recommended*

Name

Value

Stage deployment

Environment name: Global-Stage

Environment variables:

Required:

Name

Value

S3_BUCKET_NAME

dashboard-plugins-global-stage

Optional: *recommended*

Prod deployment

Environment name: Global-Prod

Environment variables:

Required:

Name

Value

S3_BUCKET_NAME

dashboard-plugins-global-prod

Optional: *recommended*

Name

Value

After setting up the all the Deployments, your Deployments should look something like this:‌

How does it work 🤔?

After fixing all the configuration, the Bitbucket Pipelines will give you the ability to build and publish your plugin to:

  • Dev global plugins bucket

  • Stage global plugins bucket

  • Prod global plugins bucket

These build are manually triggered, and there is no an automatic build or publish

Go to your plugin repo page in Bitbucket and click on "Branches" in the left sidebar‌

By listing all the branches you can see that there is three dots "..." on the right side of each branch you have‌

By clicking on the dots you'll get some options and should be able to see "Run pipeline for a branch" at the bottom of the menu‌

By clicking on that you will get a popup modal telling you to choose which pipeline you want run to build your code

You notice the two inputs inside the modal:

  • VERISON_OVERRIDE

  • LOCALES_SOURCE_VERSION

We will get back to them and explain what they are for later in the documentation.

When you run a deployment from a branch, Bitbucket Pipelines will automatically clone your branch with the last commit you pushed to a custom docker container and run custom steps as configured in the bitbucket-pipelines-template.yml file which are:‌

  • Install all the dependencies.

  • Run all the tests.

  • Build your plugin with a production flag.

  • Validate the manifest.json file.

  • Publish the plugin to the configured bucked in the the triggered deployment.

How can i watch the deployment steps?

One you run a deployment from branches, Bitbucket will automatically navigate you to the Pipelines page so you can monitor the deployment.

You can find the Pipelines page by going to your plugin repo page in Bitbucket and click on "Pipelines" in the left sidebar‌

Here you can see all the deployments that has been made, the failed ones, the successful ones and the running ones as well‌

By clicking on on of the pipelines, you can see what's going on with the build/deploy and see all the steps running with the log‌

On the left side you can see which step is currently running‌

And on the right side you can see the step log.‌

If everything went fine you should see that your plugin has been uploaded to the configured bucket in S3.‌

FAQ

What is Dev/Stage/Prod global buckets?

These are AWS s3 buckets are hosted with Dashboard account, an contains all the versions for all the available plugins

These buckets are used as a storage for Dashboard-Core to fetch the source code with all the static files to run the plugin in client

How Dashboard will get my published version?

Once you publish to one of the global buckets

  • dashboard-plugins-global-dev

  • dashboard-plugins-global-stage

  • dashboard-plugins-global-prod

It's up to Team Dashboard to release the version and utilise it in Dashboard with Dashboard-Admin app

Team Dashboard has the ability to release the plugin to all regions separately.

What is the optional inputs when running a pipeline?

  • VERSION_OVERRIDE

  • LOCALES_SOURCE_VERSION

These are optional variables, will be passed to the upload script if they have any values.

VERSION_OVERRIDE: custom version to be used, to which path the plugin will be uploaded to.

Example:

If you enter "custom-batch-13" then the plugin files will be uploaded into:

// base url
https://GLOBAL_BUCKET/com-naviga-test/custom-batch-13

// manifest file
https://GLOBAL_BUCKET/com-naviga-test/custom-batch-13/manifest.json 

Instead of using the actual plugin version

LOCALES_SOURCE_VERSION: custom version to copy all the available locale files from, and include em with the publishing version.

Example:

If you we have a version of a plugin "1.1.0" that has locale files that has been translated by Team Dashboard, and you are publishing a new version "1.2.0"

By entering "1.1.0" as a value, plugin upload script will tries to download all the available locale files from the entered version, and include them in the new one that that script is currently building "1.2.0"

Last updated