Coder Social home page Coder Social logo

lockr-block's Introduction

lockr-block

Apply application update locks by matching a URL response to a regular expression.

https://www.balena.io/docs/learn/deploy/release-strategy/update-locking/

Usage/Examples

To use this image, add a service in your docker-compose.yml file as shown below.

services:
  ...
  lockr:
    # where <arch> is one of aarch64, armv7hf or amd64
    image: bh.cr/balenalabs/lockr-<arch>

To pin to a specific version of this block use:

services:
  ...
  lockr:
    # where <version> is the release semver or release commit ID
    image: bh.cr/balenalabs/lockr-<arch>/<version>

Here's an example to check if a jenkins server is busy by querying the API:

services:
  lockr:
    image: bh.cr/balenalabs/lockr-amd64
    environment:
      ENDPOINT: "https://jenkins.product-os.io/computer/api/xml?xpath=//busyExecutors"
      LOCK_REGEXP: "/<busyExecutors>0</busyExecutors>/"
      CREDENTIALS: "admin:password"
      INTERVAL: "30s"

Here's an example to check if a jenkins node is busy by querying the API:

services:
  lockr:
    image: bh.cr/balenalabs/lockr-amd64
    environment:
      ENDPOINT: "https://jenkins.product-os.io/computer/foobar/api/xml?xpath=//idle"
      LOCK_REGEXP: "/<idle>false</idle>/"
      CREDENTIALS: "admin:password"
      INTERVAL: "30s"

Customization

Environment Variables

To run this project, you will need the following environment variables in your container:

  • ENDPOINT: Provide a URL to query with GET, the response will be processed as text.
  • CREDENTIALS: If the above endpoint requires basic auth, provide it in the format user:pass.
  • LOCK_REGEXP: Regular expression in the format /foobar/ that will apply locks when matched.
  • INTERVAL: Interval between each fetch and match execution. Default is 60s.

Contributing

Please open an issue or submit a pull request with any features, fixes, or changes.

References

lockr-block's People

Contributors

balena-ci avatar klutchell avatar nucleardreamer avatar page- avatar

Stargazers

 avatar

Watchers

 avatar

lockr-block's Issues

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.