GithubHelp home page GithubHelp logo

xebialabs-community / xld-rancher-plugin Goto Github PK

View Code? Open in Web Editor NEW
0.0 24.0 1.0 901 KB

Creates and upgrades Rancher stacks

License: MIT License

FreeMarker 18.62% Python 81.38%
rancher xld xldeploy xl-deploy

xld-rancher-plugin's Introduction

XL Deploy Rancher plugin

Build Status License: MIT Github All Releases Codacy Badge Maintainability

Preface

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

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

Overview

This XL Deploy plugin creates and upgrades Rancher stacks.

Requirements

  • XL Deploy 6.0+

Installation

  • Copy the latest JAR file from the releases page into the XL_DEPLOY_SERVER/plugins directory.
  • Restart the XL Deploy server.

Usage

Configure the CLI interface

Set up a rancher.RancherCliClient object with Rancher server URL, access key, and secret key. This object can be located under an overthere.Host object.

Screenshot of RancherCliClient

Configure the REST interface

As an alternative to the CLI, you can define a rancher.RancherRestClient object in the Infrastructure tree. It can be located under the root node or any folder. Set the host (DNS or IP), port, access key, and secret key.

Screenshot of RancherRestClient

Configure the Rancher Compose Archive

To configure a rancher.CliComposeArchive or rancher.RestComposeArchive object for deployment:

  • Create a docker-compose.yml file and a rancher-compose.yml file.

  • Zip them into a single archive to be used as the artifact.

  • Specify the project id or name.

  • Specify the stack name.

  • Enter the names of the services that should be upgraded under a MODIFY or NOOP deployment.

  • Set the force-upgrade and confirm-upgrade booleans for CLI upgrades.

  • Set the uniqueMatchOnly flag to true for REST deployments if the deployment should abort on multiple matches for the project and/or stack names.

Screenshot of CLI Compose Archive

Screenshot of REST Compose Archive

Deploying

Deploy the rancher.ComposeArtifact to the rancher.RancherCliClient or to the rancher.RancherRestClient in order to create, update, upgrade, or delete the corresponding object on Rancher.

Mapping of XL Deploy actions to Rancher actions

CLI

  • CREATE -- implemented to create a stack

  • MODIFY/NOOP -- implemented to upgrade the listed services

  • DESTROY -- implemented to remove a stack

REST

  • CREATE -- implemented to create a stack

  • MODIFY/NOOP -- implemented to upgrade the listed services

  • DESTROY

xld-rancher-plugin's People

Contributors

droberts2013 avatar ndebuhr avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Forkers

zvercodebender

xld-rancher-plugin's Issues

Upgrade Not working

Good Day,

I am getting the following issue while trying to upgrade

Uploading artifact [/tmp/ot-20180625T120919422.1/compose-22.zip]
Copying /tmp/ot-20180625T120919422.1/compose-22.zip to /tmp/ot-20180625T120919422/working.directory.tmp/xld.517/compose-22.zip on host Infrastructure/xqabdo01.africa.nedcor.net
Uploading artifact [/tmp/ot-20180625T120919422.2/compose-19.zip]
Copying /tmp/ot-20180625T120919422.2/compose-19.zip to /tmp/ot-20180625T120919422/working.directory.tmp/xld.5708/compose-19.zip on host Infrastructure/xqabdo01.africa.nedcor.net
Creating path /tmp/ot-20180625T120919422/working.directory.tmp/rancher/cli on host Infrastructure/xqabdo01.africa.nedcor.net
Processing freemarker template rancher/cli/upgrade.sh.ftl to /tmp/ot-20180625T120919422/working.directory.tmp/rancher/cli/upgrade.sh
Step failed
FreeMarker template error:
The following has evaluated to null or missing:
==> rancherUpradeOptions [in template "rancher/cli/upgrade.sh.ftl" at line 22, column 9]
----
Tip: If the failing expression is known to be legally refer to something that's sometimes null or missing, either specify a default value like myOptionalVar!myDefault, or use <#if myOptionalVar??>when-present<#else>when-missing</#if>. (These only cover the last step of the expression; to cover the whole expression, use parenthesis: (myOptionalVar.foo)!myDefault, (myOptionalVar.foo)??
----
----
FTL stack trace ("~" means nesting-related):
- Failed at: @rancherUpradeOptions [in template "rancher/cli/upgrade.sh.ftl" at line 22, column 7]
----
Java stack trace (for programmers):
----
freemarker.core.InvalidReferenceException: [... Exception message was already printed; see it above ...]
at freemarker.core.InvalidReferenceException.getInstance(InvalidReferenceException.java:131)
at freemarker.core.UnifiedCall.accept(UnifiedCall.java:111)
at freemarker.core.Environment.visit(Environment.java:324)
at freemarker.core.MixedContent.accept(MixedContent.java:54)
at freemarker.core.Environment.visitByHiddingParent(Environment.java:345)
at freemarker.core.Environment.visitAndTransform(Environment.java:425)
at freemarker.core.UnifiedCall.accept(UnifiedCall.java:107)
at freemarker.core.Environment.visit(Environment.java:324)
at freemarker.core.MixedContent.accept(MixedContent.java:54)
at freemarker.core.Environment.visitByHiddingParent(Environment.java:345)
at freemarker.core.IteratorBlock$IterationContext.executeNestedBlockInner(IteratorBlock.java:268)
at freemarker.core.IteratorBlock$IterationContext.executeNestedBlock(IteratorBlock.java:220)
at freemarker.core.IteratorBlock$IterationContext.accept(IteratorBlock.java:194)
at freemarker.core.Environment.visitIteratorBlock(Environment.java:572)
at freemarker.core.IteratorBlock.acceptWithResult(IteratorBlock.java:78)
at freemarker.core.IteratorBlock.accept(IteratorBlock.java:64)
at freemarker.core.Environment.visitByHiddingParent(Environment.java:345)
at freemarker.core.IfBlock.accept(IfBlock.java:48)
at freemarker.core.Environment.visit(Environment.java:324)
at freemarker.core.MixedContent.accept(MixedContent.java:54)
at freemarker.core.Environment.visit(Environment.java:324)
at freemarker.core.Environment.process(Environment.java:302)
at freemarker.template.Template.process(Template.java:325)
at com.xebialabs.deployit.plugin.steps.FreemarkerSupport.processWithFreemarker(FreemarkerSupport.scala:26)
at com.xebialabs.deployit.plugin.steps.FreemarkerSupport.processWithFreemarker$(FreemarkerSupport.scala:23)
at com.xebialabs.deployit.plugin.steps.OsScriptStep.processWithFreemarker(OsScriptStep.scala:18)
at com.xebialabs.deployit.plugin.steps.FreemarkerSupport.renderFreemarkerTo(FreemarkerSupport.scala:39)
at com.xebialabs.deployit.plugin.steps.FreemarkerSupport.renderFreemarkerTo$(FreemarkerSupport.scala:35)
at com.xebialabs.deployit.plugin.steps.OsScriptStep.renderFreemarkerTo(OsScriptStep.scala:18)
at com.xebialabs.deployit.plugin.steps.OsScriptStep.processAndUploadResource(OsScriptStep.scala:75)
at com.xebialabs.deployit.plugin.steps.OsScriptStep.processScript(OsScriptStep.scala:61)
at com.xebialabs.deployit.plugin.steps.OsScriptStep.executeOnTargetHost(OsScriptStep.scala:54)
at com.xebialabs.deployit.plugin.steps.TargetHostSupport.execute(TargetHostSupport.scala:47)
at com.xebialabs.deployit.plugin.steps.TargetHostSupport.execute$(TargetHostSupport.scala:44)
at com.xebialabs.deployit.plugin.steps.OsScriptStep.execute(OsScriptStep.scala:18)
at com.xebialabs.deployit.engine.tasker.StepExecutingActor.$anonfun$executeStep$2(StepExecutingActor.scala:134)
at com.xebialabs.deployit.engine.tasker.MdcUtils$.withMdc(MdcUtils.scala:16)
at com.xebialabs.deployit.engine.tasker.StepExecutingActor.$anonfun$executeStep$1(StepExecutingActor.scala:124)
at scala.concurrent.Future$.$anonfun$apply$1(Future.scala:653)
at scala.util.Success.$anonfun$map$1(Try.scala:251)
at scala.util.Success.map(Try.scala:209)
at scala.concurrent.Future.$anonfun$map$1(Future.scala:287)
at scala.concurrent.impl.Promise.liftedTree1$1(Promise.scala:29)
at scala.concurrent.impl.Promise.$anonfun$transform$1(Promise.scala:29)
at scala.concurrent.impl.CallbackRunnable.run(Promise.scala:60)
at akka.dispatch.BatchingExecutor$AbstractBatch.processBatch(BatchingExecutor.scala:55)
at akka.dispatch.BatchingExecutor$BlockableBatch.$anonfun$run$1(BatchingExecutor.scala:91)
at scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.java:12)
at scala.concurrent.BlockContext$.withBlockContext(BlockContext.scala:81)
at akka.dispatch.BatchingExecutor$BlockableBatch.run(BatchingExecutor.scala:91)
at akka.dispatch.TaskInvocation.run(AbstractDispatcher.scala:40)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)

Below is the Fix

<#if deployed.serviceNames?has_content>
  <#list deployed.serviceNames as serviceName>
    <@compress single_line=true>
      ${deployed.container.cliPath}
      <@cmn.rancherConfigOptions />
      <@cmn.rancherWaitOptions />
      up -d
      <@cmn.rancherUpgradeOptions />
      --stack ${deployed.name} ${serviceName}
    </@compress>
  </#list>
<#else>

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.