GithubHelp home page GithubHelp logo

s00500 / example-config-service Goto Github PK

View Code? Open in Web Editor NEW

This project forked from woodpecker-ci/example-config-service

0.0 0.0 0.0 162 KB

Example for a basic configuration service

Shell 2.64% Go 97.36%

example-config-service's Introduction

Woodpecker CI Configuration Service example

This repository provides a very simplistic example of how to set up an external configuration service for Woodpecker CI The external service gets a HTTP POST request with information about the repo, current build, and the configs that would normally be used. It can then decide to acknowledge the current configs (By returning HTTP 204), or overriding the configurations and returning new ones in the response

Use cases for this system are:

  • Centralized configuration for multiple repositories at once
  • Preprocessing steps in the pipeline like templating, macros or conversion from different pipeline formats to woodpeckers format

This service is written in go, to run it first copy the config example: cp .env.example .env Download the public key from your woodpecker instance from http(s)://your-woodpecker-server/api/signature/public-key and save it to file. Set WOODPECKER_CONFIG_SERVICE_PUBLIC_KEY_FILE to the path to that file and add a filtering regex. The repositories that have a name match the filtering regex will receive the config from central-pipeline-config.yaml, while all other repositories will continue using their original configuration.

Then run using go run ..

Make sure to configure your woodpecker instance with the correct endpoint and configure the same secret. See Woodpeckers documentation here

eg:

# Server
# ...
WOODPECKER_CONFIG_SERVICE_ENDPOINT=http://<service>:8000/ciconfig
WOODPECKER_CONFIG_SERVICE_PUBLIC_KEY_FILE=public-key.pem

example-config-service's People

Contributors

anbraten avatar s00500 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.