githubreleases

pdk
Download release tarballs or artifacts from github releases

DO! DevOps

dodevops

11,368 downloads

2,896 latest version

5.0 quality score

Version information

  • 4.0.0 (latest)
  • 3.1.0
  • 3.0.1
  • 3.0.0
  • 2.0.1
  • 0.1.2
  • 0.1.1
  • 0.1.0
released Jan 31st 2020
This version is compatible with:
  • Puppet Enterprise 2021.2.x, 2021.1.x, 2021.0.x, 2019.8.x, 2019.7.x, 2019.5.x, 2019.4.x, 2019.3.x, 2019.2.x, 2019.1.x, 2019.0.x, 2018.1.x, 2017.3.x
  • Puppet >= 5.0.0
  • CentOS
    ,
    RedHat
    ,
    Debian
    ,
    Ubuntu
    ,
    windows

Start using this module

Documentation

dodevops/githubreleases — version 4.0.0 Jan 31st 2020

dodevops/githubreleases

Build status

Table of Contents

  1. Description
  2. Usage - Configuration options and additional functionality
  3. Reference - An under-the-hood peek at what the module is doing and how
    1. Class githubreleases
    2. Type githubreleases::download

Description

This puppet module downloads tar-, zipballs or assets from Github releases.

Assets can be filtered by Content type and/or file name.

Usage

To download a release from Github, use the defined type githubreleases_download like this:

githubreleases_download {
  '/tmp/release.latest.head.tar.gz':
    author     => 'company',
    repository => 'example'
}

This will download the latest (HEAD) version of the project "company/example" as a tarball an place it in /tmp/release.latest.head.tar.gz.

If the repository uses the Github release feature, the tarball of the latest (non-pre-release) release will be downloaded.

If the repository uses assets to offer binary files with each release, these can also be downloaded:

githubreleases_download {
  '/tmp/release.0.0.2.asset.debian':
    author            => 'company',
    repository        => 'example',
    release           => '0.0.2',
    asset             => true,
    asset_contenttype => 'application\/x-deb'
}

This will download a debian package of release 0.0.2 of the repository.

File names can be filtered as well:

githubreleases_download {
  '/tmp/release.0.0.2.asset.exe':
    author            => 'company',
    repository        => 'example',
    release           => '0.0.2',
    asset             => true,
    asset_filepattern => 'example.*\.exe'
}

This will download the first file matching the given filepattern.

All patterns are Regular Expressions.

This module also supports hiera. Just include the githubreleases-class and use the type like this:

githubreleases_download:
  '/tmp/release.latest.head.fromhiera.tar.gz':
    author: 'company'
    repository: 'example'

Defaults for multiple resources can be set by configuring the githubreleases-class.

Using authentication

Github rate-limits access to its API. If you use this module in a test and massively download files using it, you better create a Github user and set the authentication parameters so that you will get a better rate.