Skip to content

Latest commit

 

History

History
142 lines (101 loc) · 3.79 KB

README.e.md

File metadata and controls

142 lines (101 loc) · 3.79 KB
License LicenseFile LicenseColor
MIT
../LICENSE
yellow

{{.Name}}

{{template "badge/travis" .}} {{template "badge/goreport" .}} {{template "badge/godoc" .}} {{template "license/shields" .}}

{{pkgdoc}}

Using a json files to declare rules, it then performs necessary operations to invoke rpmbuild and build the package.

This tool is part of the go-github-release workflow

See the demo.

{{toc 5}}

Install

{{template "gh/releases" .}}

Glide

{{template "glide/install" .}}

linux rpm/deb repository

{{template "linux/bintray_repo" .}}

linux rpm/deb standalone package

{{template "linux/gh_pkg" .}}

Usage

Requirements

A centos/fedora/redhat system, vagrant, travis, docker, whatever.

Workflow overview

To create a binary package you need to

  • build your application binaries
  • invoke go-bin-rpm to generate the package
  • create rpm repositories on travis hosted on gh-pages using this script

Json file

For a real world example including service, shortcuts, env, see this

For a casual example to provide a simple binary, see this

JSON tokens

Several tokens are provided to consume into the JSON file.

name description example
!version! The version number provided in the command line, or in the JSON file. 1.0.2
!arch! The architecture short name provided in the command line or in the JSON file. amd64
!name! The name of the project provided in the JSON file. hello

CLI

{{exec "go-bin-rpm" "-help" | color "sh"}}

{{exec "go-bin-rpm" "generate-spec" "-help" | color "sh"}}

{{exec "go-bin-rpm" "generate" "-help" | color "sh"}}

{{exec "go-bin-rpm" "test" "-help" | color "sh"}}

Recipes

Installing generated package

TLDR

# install
sudo rpm -ivh pkg.rpm
# upgrade
sudo rpm -Uvh pkg.rpm
# remove
sudo rpm -evv nx pkg.rpm

Vagrant recipe

Please check the demo app here

Travis recipe

  • get a github repo
  • get a travis account
  • connect your github account to travis and register your repo
  • install travis client gem install --user travis
  • run travis encrypt --add -r YOUR_USERNAME/dummy GH_TOKEN=xxxx
  • run travis setup releases
  • personalize the .travis.yml

{{yaml ".travis.yml" | preline " " | color "yml"}}

useful rpm commands

# check dependencies before install
rpm -qpR pkg.rpm
# show info of a package before install
rpm -qip pkg.rpm
# install with no dependencies
rpm -ivh --nodeps pkg.rpm
# show info of installed package
rpm -qi pkg
# check installed package
rpm -q pkg
# list files of installed package
rpm -ql pkg

Readings of interest

Release the project

gump patch -d # check
gump patch # bump

History

CHANGELOG