Skip to content

Gradle plugin to deploy applications to Kubernetes and DC/OS Marathon

License

Notifications You must be signed in to change notification settings

qaware/gradle-cloud-deployer

Repository files navigation

Gradle-Cloud-Deployer

Gradle-Cloud-Deployer

Build Status Codacy Badge codebeat badge codecov Dependency Status Apache License 2

The Gradle-Cloud-Deployer is a gradle plugin which deploys your applications directly into your cloud.

This plugin is available at the Gradle Plugins Portal.

Check out the quick start!

Supported cloud orchestrators

The supported cloud orchestrators and concepts are ...

Marathon

Supported Concepts

  • App
  • Group

Kubernetes

Supported Concepts

  • Deployment
  • Service
  • ReplicationController
  • Pod

Quick start

This quick start demonstrates the usage of the Gradle-Cloud-Deployer plugin.

1. Apply the plugin

Build script snippet for use in all Gradle versions:

buildscript {
  repositories {
    maven {
      url "https://plugins.gradle.org/m2/"
    }
  }
  dependencies {
    classpath "gradle.plugin.de.qaware.cloud.deployer:deployer:0.9.2"
  }
}

apply plugin: "de.qaware.cloud.deployer"

Build script snippet for new, incubating, plugin mechanism introduced in Gradle 2.1:

plugins {
  id "de.qaware.cloud.deployer" version "0.9.2"
}

To control if you applied the plugin correctly type:

gradlew tasks

You should see the Deployment tasks section in your task list:

Deployment tasks
----------------
delete - Deletes the specified environment (e.g. --environmentId=test).
deleteAll - Deletes all environments.
deploy - Deploys the specified environment (e.g. --environmentId=test).
deployAll - Deploys all environments.

2. Configure the plugin

This build script snippet demonstrates how to configure the plugin to deploy to a Marathon and a Kubernetes cloud:

deployer {
    marathon {
        id = "marathon-zwitscher"
        baseUrl = "http://your-address.com"
        strategy = "REPLACE"
        auth {
            token = defaultToken(file("token.txt"))
        }
        files = [file("marathon-zwitscher-config.json")]
    }
    kubernetes {
        id = "kubernetes-zwitscher"
        baseUrl = "https://your-address.com"
        namespace = "test"
        strategy = "UPDATE"
        auth {
            username = "admin"
            password = "s3cr3t"
        }
        ssl {
            trustAll = true
        }
        files = [file("kubernetes-zwitscher-config.json")]
    }
}

You can define multiple environments. The example creates an marathon-zwitscher and kubernetes-zwitscher environment. Thereby it's possible to mix different cloud orchestrators. Additionally the plugin allows authentication (e.g. via token or username and password) and ssl connections (e.g. via a self-signed certificate).

Examples for a kubernetes config file and a marathon config file can be found in QAware's Cloud Native Zwitscher Showcase.

See the documentation for more details on configuration.

3. Execute a task

After configuring the plugin you can use the different tasks to

  • deploy all environments
gradlew deployAll
  • deploy a single environment
gradlew deploy --environmentId=test
  • delete all environments
gradlew deleteAll
  • delete a single environment
gradlew delete --environmentId=test

See the documentation for more details on the tasks.

Documentation

The wiki contains the documentation for plugin configuration and usage.

Development

For details on building and developing the Gradle-Cloud-Deployer plugin, please see the wiki.

Contributing

Is there anything missing? Do you have ideas for new features or improvements?

All you have to do is to fork this repository, improve the code and issue a pull request.

Maintainer

Simon Jahreiß (@sjahreis)

Sponsor

QAware GmbH

License

This software is provided under the Apache License, Version 2.0 license. See the LICENSE file for details.