Skip to content

xebialabs-community/xld-cassandra-plugin

Repository files navigation

Cassandra integration for XL Deploy

Build Status License MIT Codacy Badge standard-readme compliant Github All Releases Code Climate

Preface

This document describes the functionality provided by the XL Deploy Cassandra plugin.

See the XL Deploy reference manual for background information on XL Deploy and release automation concepts.

Overview

The xld-cassandra-plugin is an XL Deploy plugin that enables executing scripts against a Cassandra instance.

Installation

Building the Plugin

You can use the gradle wrapper to build the plugin. Use the following command to build using Gradle:

./gradlew clean assemble

The built plugin, along with other files from the build, can then be found in the build folder.

Adding the Plugin to XL Deploy

For the latest instructions on installing XL Deploy plugins, consult the associated documentation on docs.xebialabs.com.

Usage

The configuration items for this plugin:

  1. Cassandra cql Scripts (type cql.CqlScripts)
  2. Cassandra Client (type cql.CassandraClient)
  3. Executed Cassandra cql Scripts (type cql.ExecutedCqlScripts)

To run Cassandra scripts during a deployment, you must have the cql.CqlScripts configuration item in the deployment package and the cql.CassandraClient defined on the overthere host (infrastructure). Use the docs.xebialabs.com site for more information on deployments and the XL Deploy Unified Deployment Model (UDM).

The cql.CqlScripts configuration item (CI) identifies a ZIP file that contains CQL scripts that are to be executed on the cassandra database.

  • The scripts must be located at the root of the ZIP file.

  • CQL scripts can be installation scripts or rollback scripts.

  • Installation scripts are used to execute changes on the database, such as creation of a table or inserting data.

    • ex. 1-create_table.cql
  • Each installation script should be associated with a rollback script that undoes the actions performed by its companion installation script. A rollback script must have the same name as the installation script with which it is associated, and must have the moniker -rollback attached to it.

    • ex. 1-create_table-rollback.cql
  • Executing an installation script, followed by the accompanying rollback script, should leave the database in an unchanged state.

  • XL Deploy tracks which installation scripts were executed successfully and only executes their associated rollback scripts.

If using a separate host to execute scripts on the cassandra database you can use separate credentials to run the scripts than you need to connect to the separate host.

Contributing

Please review the contributing guidelines for xebialabs-community at http://xebialabs-community.github.io/

License

This community plugin is licensed under the MIT license.

See license in LICENSE.md

References