Plugins deployments
Last updated
Last updated
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)
First go to Repository settings and navigate to Repository variables, and add the following variables:
Then navigate to Deployments and fix them with the following:
Environment name: Global-Dev
Environment variables:
Required:
Optional: *recommended*
Environment name: Global-Stage
Environment variables:
Required:
Optional: *recommended*
Environment name: Global-Prod
Environment variables:
Required:
Optional: *recommended*
After setting up the all the Deployments, your Deployments should look something like this:
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.
The dropdown is a list of the configured deployments
The inputs are optional variables configured in the bitbucket-pipelines-template.yml
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.
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.
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
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.
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:
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"
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
Name
Value
S3_BUCKET_NAME
dashboard-plugins-global-dev
Name
Value
GLOBAL_CLOUDFRONT_PATH
Name
Value
S3_BUCKET_NAME
dashboard-plugins-global-stage
Name
Value
GLOBAL_CLOUDFRONT_PATH
Name
Value
S3_BUCKET_NAME
dashboard-plugins-global-prod
Name
Value
GLOBAL_CLOUDFRONT_PATH