Code Monkey home page Code Monkey logo

drone-portainer's Introduction

drone-portainer

Drone portainer plugin to update a portainer stack with a docker compose file.

Build Status

Usage

This image can be used as a drone plugin to deploy a compose file to portainer. For example:

---
kind: pipeline
type: docker
name: default

- name: deploy
  image: robkaandorp/drone-portainer
  settings:
    portainer_url: http://<ip or hostname>:9000
    portainer_username:
      from_secret: portainer_username
    portainer_password:
      from_secret: portainer_password
    endpoint: primary # The endpoint name in portainer, most of the time this is 'primary' or 'local'.
    registry: <name of private registry>
    image: example/example-image
    image_tag: ${DRONE_COMMIT_BRANCH}-${DRONE_BUILD_NUMBER}
    stack_name: example-stack
    standalone: false
    compose_environment:
      from_secret: compose_environment

The compose file should be named docker-compose.yml and be placed in the root of the workspace. The stack wil be created when it does not exist and updated if it does exist. Example of compose file:

version: "3.5"

services:

  example-service:
    image: $imageName
    restart: always
    ports:
      - 8080:8080

The $imageName and $stackName environment is already set and need not be supplied through compose_environment.

The plugin will pull the image before applying the compose file. If it needs to be pulled from a private registry, the registry and authentication should be configured in portainer. The limitation is you can only supply one image in the settings. The compose file can specify more images, but the others will not be pulled automatically by portainer (at the time of this writing).

The compose_environment can be used to supply environment settings to the stack. This is optional. It should be in the form of a json object:

    compose_environment:
      key1: value1
      key2: value2

When setting the compose_environment from a secret, use json notation in the secret:

{
    "key1": "value1",
    "key2": "value2"
}

If you are using portainer without swarm, set the standalone option to true. By default, drone is using the swarm version.

drone-portainer's People

Contributors

robkaandorp avatar hendrikroth avatar dependabot[bot] avatar

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.