Giter Site home page Giter Site logo

freshleafmedia / satis-build-worker Goto Github PK

View Code? Open in Web Editor NEW
0.0 2.0 0.0 3 KB

A Satis instance that builds packages from a queue

Home Page: https://www.freshleafmedia.co.uk/blog/satis-queue-worker

Dockerfile 9.46% Shell 90.54%
satis docker package package-builder packagist kubernetes queue queue-workers k8s

satis-build-worker's Introduction

Satis Package Build Worker

A Satis instance that will build packages from a queue.

How It Works

  • The queue is simply a directory
  • Every file in the queue is a job
  • The file contains the repository URL of the package to be built

Example

The following example will read all job files inside the host directory /host/queue and build them, outputting the packages to /host/builtPackages. It will read any config from the /host/satis.json file.

docker run -it --rm \
  --user $(id -u):$(id -g) \
  --volume /host/queue:/packageQueue \
  --volume /host/builtPackages:/build \
  --volume /host/satis.json:/satis.json \
  freshleafmedia/satis-build-worker

If you also want to take advantage of Composers caching (you do) then you can also add --volume /host/composer:/composer

Adding to the queue

  • Each file in the queue must contain only the URL of the package to be built, eg [email protected]:vendor/package.git or [email protected]:vendor/package.git.
  • The filename can be set to anything you like, it isn't used.
  • The jobs are processed in the order they are added

Kubernetes Deployment

apiVersion: apps/v1
kind: Deployment
metadata:
  name: Satis
spec:
  selector:
    matchLabels:
      app: Satis
  replicas: 2
  template:
    metadata:
      labels:
        app: Satis
    spec:
      containers:
      - name: satis
        image: "freshleafmedia/satis-build-worker:latest"
        imagePullPolicy: "Always"
        volumeMounts:
        - name: volume
          mountPath: /builds
          subPath: web/public
        - name: volume
          mountPath: /packageQueue
          subPath: packageQueue
        - name: volume
          mountPath: /composer
          subPath: composer
        - name: satis-config
          mountPath: /satis.json
          subPath: satis.json
        - name: ssh
          mountPath: /root/.ssh/id_rsa
          subPath: id_rsa
          readOnly: true
        - name: ssh
          mountPath: /root/.ssh/id_rsa.pub
          subPath: id_rsa.pub
          readOnly: true
      volumes:
      - name: volume
        persistentVolumeClaim:
          claimName: pvc
      - name: satis-config
        configMap:
          name: satis
          optional: false
      - name: ssh
        secret:
          secretName: ssh
          optional: false
          defaultMode: 0600

Private Packages

This is primarily designed to work with private packages as such SSH auth is supported simply by mounting an SSH key to the usual directory: --volume: /host/.ssh/id_rsa.pub:id_rsa.pub:ro --volume: /host/.ssh/id_rsa:id_rsa:ro

satis-build-worker's People

Contributors

freshleafmedia avatar

Watchers

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