Cockpit CMS Addon for Drone CI Deploys
php
Go to file
2019-06-13 12:39:22 +02:00
Controller config now in settings 2019-03-06 12:26:09 +01:00
views fixed list with error status 2019-05-22 10:59:51 +02:00
admin.php extended view 2019-03-08 10:59:56 +01:00
bootstrap.php Merge branch 'master' of ssh://gitbase.de:2222/cms/CockpitCMS-Drone 2019-06-13 12:39:22 +02:00
icon.svg mod icon.svg 2019-03-08 12:17:15 +01:00
LICENSE fixed LICENSE 2019-03-05 15:29:37 +01:00
README.md extended view 2019-03-08 10:59:56 +01:00

Cockpit CMS Drone Deploys Addon

This addons is a modified version of the addon CockpitCMS-Netlify.

It provides an integration with Drone CI promote feature to trigger a pipeline run. You can use it to deploy a website based on data in Cockpit CMS and built with a static site generator.

Installation

  1. Confirm that you have Cockpit CMS (Next branch) installed and working.
  2. Download and extract to 'your-cockpit-docroot/addons' (e.g. cockpitcms/addons/Drone, the addon folder name must be Drone)
  3. Drone icon will apear, if configuration is completed.

Configuration

  1. Ensure that from your Drone account you have an access token and permissions to promote a build for the project and branch, you want to use.
  2. Go to "Settings - Drone Deploys" and add a your drone configuration like below as following
URL: your drone server url, pe. https://YOUR.DRONE.SERVER
Token: your drone access token
Owner: the owner of the git repository
Project: the git project
Branch: the branch in your git repository for the deployment
Target: the target condition used in your drone pipeline
Build: the build number used as base for deployment, leave empty and the addon will use the latest successfull build based on a push event

Permissions

There are just two permissions:

  • manage.view - provides access to the Drone deploy list
  • manage.extended_view - provides access to drone logs
  • manage.deploy - provides access to trigger a new deploy
  • manage.settings - provides access to configure the addon

Drone CI pipeline example

  • .drone.yml in your git repository
kind: pipeline
name: default

steps:
  - name: deploy website
    image: alpine
    commands:
      # your deploy commands here
      - echo Hello World
    when:
      event: [ promote ]
      target: [ website ]
  • settings in your Cockpit - Settings - Drone Deploys for an example project myorganization/myproject
URL: https://YOUR.DRONE.SERVER
Token: XXXXXXXXXXXX
Owner: myorganization
Project: myproject
Branch: master
Target: website
Build: empty

Usage

Having the configuration defined accessing the Drone deploys page (/drone/deploys) a list of latest (limited to 50) deploys is displayed:

To trigger a new deploy just hit the Deploy button an confirm the action.

Copyright 2019 Sebastian Frank under the MIT license.