Coder Social home page Coder Social logo

home-assistant-config-puller's Introduction

home-assistant-config-puller

pipeline status

Exposes the ability for GitLab CI/CD to "deploy" the latest Home Assistant configuration. Which really is pulling master at this point. The next phase is to accept the commit hash from the webhook and pull the correct deployed version

Uses the vondruska/webhook-script-runner image.

Getting Git to work without a home directory

When specifying the user to run the image as, we lose a (sane) home directory. Git expects to have a home directory which can cause weird issues. Git supports using configurations from $XDG_CONFIG_HOME. In the base image, that environment variable is set to /config.

Handling Git auth

This uses git-credential-store. git-credential-store reads the necessary from $XDG_CONFIG_HOME/git/credentials¹. Upon container startup, it will write the credential necessary to execute the pull into $XDG_CONFIG_HOME/git/credentials. Upon a webhook execution, Git will execute a pull on the repo and lookup the correct credentials in the $XDG_CONFIG_HOME/git/credentials.

Couple of words on security. No secrets should be committed into the repository (especially, TOKEN and GIT_PASSWORD). Set the environment variables ahead of time and pipe them into this image.

¹ git-credential-store search paths

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.