diegoxa/drone-voyage

By diegoxa

Updated about 1 year ago

DroneCI plugin to update image on k8s deployment manifest files on remote GitHub repos (ArgoCD)

Image
Integration & delivery
0

949

diegoxa/drone-voyage repository overview

This Drone CI plugin enables you to seamlessly update your Kubernetes deployment manifest files by committing changes to the image attribute field on your remote GitHub repository. Ideal if you use ArgoCD for managing deployments.

Github: https://github.com/diegoxa/drone-voyage

Usage

The following settings changes this plugin's behavior.

  • github_repo (required) Github repository containing the k8s manifest files.
  • github_ssh_key (required) Github private key.
  • image (required) Docker image name, i.e.: diegoxa/drone-voyager:v1.0
  • deployment_files (required) One or many comma separated files
  • container_name (optional) The container name under deployment to apply the image change. Ideal when you have multiple containers in a manifest file but you only need to update a specific container.
  • commit_author (required) Author to be used on the commit.
  • commit_email (required) Email to be used on the commit.
  • log_level (optional) Log level. [info,debug]

Below is an example .drone.yml that uses this plugin.

kind: pipeline
name: default

steps:
- name: run diegoxa/drone-voyage plugin
  image: diegoxa/drone-voyage
  pull: if-not-exists
  settings:
    github_repo: [email protected]:user/repo.git
    github_ssh_key:
      from_secret: deployment_ssh_key
    image: diegoxa/drone-voyage:v1-rc.2
    deployment_files: k8s/prod/deployment.yaml,k8s/prod/migration.yaml
    commit_author: Voyage
    commit_email: [email protected]
    log_level: info

Building

Build the plugin binary:

scripts/build.sh

Build the plugin image:

docker build -t diegoxa/drone-voyage -f docker/Dockerfile .

Testing

Execute the plugin from your current working directory:

docker run --rm \
  -e [email protected]:moon/light.git \
  -e PLUGIN_GITHUB_SSH_KEY=$GIT_SSH_KEY 
  -e PLUGIN_IMAGE=my-docker/moon-light:v0.1 \
  -e PLUGIN_DEPLOYMENT_FILES=k8s/prod/deployment.yaml,k8s/prod/migration.yaml \
  -e PLUGIN_COMMIT_AUTHOR=John Doe \
  -e [email protected] \
  -e PLUGIN_LOG_LEVEL=info \
  -w /drone/src \
  diegoxa/drone-voyage

Tag summary

Content type

Image

Digest

sha256:5805c0c05

Size

13.2 MB

Last updated

about 1 year ago

docker pull diegoxa/drone-voyage