Skip to content
This repository has been archived by the owner on Dec 21, 2019. It is now read-only.

Commit

Permalink
feat build: Add ArchLinux PKGBUILD
Browse files Browse the repository at this point in the history
  • Loading branch information
tazjin committed May 8, 2017
1 parent 1e3ecad commit d15dfef
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 0 deletions.
38 changes: 38 additions & 0 deletions PKGBUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# Maintainer: Vincent Ambo <[email protected]>
pkgname=kontemplate-git
pkgver=master_1e3ecad
pkgrel=1
pkgdesc="Simple Kubernetes resource templating"
arch=('x86_64')
url="https://github.com/tazjin/kontemplate"
license=('MIT')
makedepends=('go')
optdepends=('pass: Template secrets into resources')
source=('kontemplate-git::git+https://github.com/tazjin/kontemplate.git')
md5sums=('SKIP')

pkgver() {
cd "$srcdir/$pkgname"
echo -n "master_$(git rev-parse --short HEAD)"
}

prepare() {
cd "$srcdir/$pkgname"
echo "Fetching Go dependencies..."
go get -v ./...
}

build() {
cd "$srcdir/$pkgname"
local GIT_HASH="$(git rev-parse --short HEAD)"

go build -tags netgo \
-ldflags "-X main.gitHash=${GIT_HASH} -w -s" \
-o 'kontemplate'
}

package() {
cd "$srcdir/$pkgname"

install -D -m 0755 'kontemplate' "${pkgdir}/usr/bin/kontemplate"
}
1 change: 1 addition & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import (
)

const version string = "1.0"

// This variable will be initialised by the Go linker during the builder
var gitHash string

Expand Down

0 comments on commit d15dfef

Please sign in to comment.