enonic / app-gitpull

Application that pulls git repositories to server.
Apache License 2.0
0 stars 1 forks source link

GitPull for Enonic XP

Actions Status codecov License

This Enonic XP application pulls changes from multiple configured git repositories. It also exposes an endpoint that can be triggered to pull on demand.

Configuration

To configure this application, just place a file named com.enonic.app.gitpull.cfg inside one of your configuration directories. This file holds a set of repositories to pull from. Every set is named and the keys are described as follows:

HTTPS-Authentication

SSH-Authentication

Here's an example:

# Repo one
prod.url = https://some/git/url
prod.user = username
prod.password = password
prod.dir = ${xp.home}/config/prod
prod.timeout = 60
prod.ref = refs/heads/master

# Repo two
gitProd.url = ssh://git@github.com:agituser/agitrepo.git 
gitProd.dir = ${xp.home}/config/gitProd
gitProd.timeout = 60
gitProd.ref = develop
gitProd.keyPath = ${xp.home}/config/ssh/id_rsa
gitProd.strictHostKeyChecking = false

Using SSH-Keys

The jgit is a bit particular on the format of the key, so use the -m PEM-switch to generate keys if having trouble with private key not accepted, e.g

ssh-keygen -t ecdsa -b 256 -m PEM

Note: RSA keys with SHA1 signature that are created after Nov 2021 are not allowed by Github.

To allow ssh to a repo, add host to ~/.ssh/known_hosts, or optionally specify the strictHostKeyChecking=false option on a connection

Usage

Every time the app is triggered, all configured repos will be pulled. There are three ways to trigger the app: