summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Cocora2018-12-04 23:30:28 +0000
committerStefan Cocora2018-12-04 23:30:28 +0000
commitf3dc0a412896532dfdf2d62749ec259363cfffca (patch)
tree63fe7360b01f74b2b848ac932ef3340013814e99
downloadaur-f3dc0a412896532dfdf2d62749ec259363cfffca.tar.gz
[feature] Release of the src built version of kubeless v1.0.0
-rw-r--r--.SRCINFO21
-rw-r--r--.editorconfig29
-rw-r--r--.gitignore8
-rw-r--r--PKGBUILD98
4 files changed, 156 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 00000000000..ee054f7423d
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,21 @@
+pkgbase = kubeless
+ pkgdesc = A Kubernetes-native serverless framework that lets you deploy small bits of code without having to worry about the underlying infrastructure plumbing.
+ pkgver = 1.0.0
+ pkgrel = 1
+ url = https://github.com/kubeless/kubeless
+ arch = x86_64
+ license = Apache
+ makedepends = go
+ makedepends = git
+ makedepends = wget
+ depends = filesystem
+ depends = glibc
+ depends = linux-api-headers
+ depends = tzdata
+ source = kubeless::git+https://github.com/kubeless/kubeless.git
+ source = LICENSE::https://raw.githubusercontent.com/kubeless/kubeless/master/LICENSE
+ sha256sums = SKIP
+ sha256sums = SKIP
+
+pkgname = kubeless
+
diff --git a/.editorconfig b/.editorconfig
new file mode 100644
index 00000000000..328e15f595f
--- /dev/null
+++ b/.editorconfig
@@ -0,0 +1,29 @@
+# EditorConfig is awesome: http://EditorConfig.org
+# EditorConfig properties: https://github.com/editorconfig/editorconfig/wiki/EditorConfig-Properties
+
+# top-most EditorConfig file
+root = true
+
+# Unix-style newlines with a newline ending every file
+# should be equivalent to
+# vim:ts=2:sw=2:et
+
+[*]
+charset = utf-8
+end_of_line = lf
+insert_final_newline = true
+trim_trailing_whitespace = true
+indent_style = space
+indent_size = 2
+tab_width = 2
+spaces_around_operators = true
+spaces_around_brackets = true
+
+[Makefile]
+indent_style = tab
+indent_size = 2
+
+# https://github.com/wilmoore/go-userdir/blob/master/.editorconfig
+# https://github.com/gogits/gogs/blob/master/.editorconfig
+[*.go]
+indent_style = tab
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 00000000000..c84732a9e76
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,8 @@
+# emacs lock files
+.#*
+tmp/
+src
+pkg
+kubeless
+!kubeless/
+*pkg.tar.xz
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 00000000000..980916cb51f
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,98 @@
+# Maintainer: Stefan Cocora <stefan dot cocora at gmail dot com>
+# Contributor:
+
+_pkgauthor=kubeless
+_upstream_pkgname=kubeless
+pkgname=kubeless
+pkgver=1.0.0
+pkgrel=1
+pkgdesc="A Kubernetes-native serverless framework that lets you deploy small bits of code without having to worry about the underlying infrastructure plumbing."
+arch=('x86_64')
+groups=()
+depends=(
+ "filesystem"
+ "glibc"
+ "iana-etc"
+ "linux-api-headers"
+ "tzdata"
+)
+makedepends=(
+ "go"
+ "git"
+ "wget"
+)
+_builddepends_bins_path="/tmp/build/bin"
+provides=()
+conflicts=()
+replaces=()
+backup=()
+options=()
+install=
+license=("Apache")
+_manifest_non_rbac="${_upstream_pkgname}-non-rbac.yaml"
+_manifest_openshift="${_upstream_pkgname}-openshift.yaml"
+_manifest_rbac="${_upstream_pkgname}.yaml"
+url="https://github.com/${_pkgauthor}/${_upstream_pkgname}"
+# https://github.com/kubeless/kubeless/archive/v1.0.0.tar.gz
+source=("${pkgname}::git+https://github.com/${_pkgauthor}/${_upstream_pkgname}.git"
+ "LICENSE::https://raw.githubusercontent.com/${_pkgauthor}/${_upstream_pkgname}/master/LICENSE")
+sha256sums=(
+ "SKIP"
+ "SKIP"
+)
+
+
+prepare() {
+ # https://github.com/kubeless/kubeless/blob/master/Makefile#L104-L113
+ # have to copy/paste this section because the upstream maintainers are using sudo during this section of the Makefile
+ mkdir -p "${pkgdir}/usr/local/bin"
+ mkdir -p ${_builddepends_bins_path}
+ echo "=== fetching kubecfg"
+ wget -q -O "${_builddepends_bins_path}/kubecfg" https://github.com/ksonnet/kubecfg/releases/download/v0.9.0/kubecfg-$(go env GOOS)-$(go env GOARCH); \
+ chmod +x "${_builddepends_bins_path}/kubecfg";
+ echo "=== fetching kubectl"
+ KUBECTL_VERSION=$(wget -qO- https://storage.googleapis.com/kubernetes-release/release/stable.txt); \
+ wget -q -O "${_builddepends_bins_path}/kubectl" https://storage.googleapis.com/kubernetes-release/release/$KUBECTL_VERSION/bin/$(go env GOOS)/$(go env GOARCH)/kubectl; \
+ chmod +x "${_builddepends_bins_path}/kubectl";
+
+ mkdir -p "${srcdir}/gopath/{bin,src,pkg}"
+ mkdir -p "${srcdir}/gopath/src/github.com/${_pkgauthor}"
+ cp -r "${srcdir}/${pkgname}" "${srcdir}/gopath/src/github.com/${_pkgauthor}/${pkgname}"
+ # build from release tag rather than from the master HEAD
+ cd "${srcdir}/gopath/src/github.com/${_pkgauthor}/${pkgname}" && git checkout "v${pkgver}"
+}
+
+build() {
+ export GOPATH="${srcdir}/gopath"
+ export PATH="${_builddepends_bins_path}:${PATH}"
+ cd "${srcdir}/gopath/src/github.com/${_pkgauthor}/${pkgname}"
+ # https://github.com/kubeless/kubeless/blob/master/.circleci/config.yml#L77-L105
+ go get -u golang.org/x/lint/golint
+ make bootstrap
+ # make VERSION=${CONTROLLER_TAG} binary
+ make VERSION="${pkgver}" binary
+ make test
+ make validation
+ make all-yaml
+ mkdir build-manifests
+ MANIFESTS="kubeless kubeless-non-rbac kubeless-openshift"; \
+ IFS=' ' read -r -a manifests <<< "$MANIFESTS"; \
+ for f in "${manifests[@]}"; do \
+ sed -i.bak 's/:latest/'":${CONTROLLER_TAG}"'/g' ${f}.yaml; \
+ cp ${f}.yaml build-manifests/; \
+ done
+}
+
+
+package() {
+ install -Dm755 "${srcdir}/gopath/bin/${pkgname}" "${pkgdir}/usr/bin/${pkgname}"
+
+ mkdir -p "${pkgdir}/usr/share/licenses/${_upstream_pkgname}"
+ cp "${srcdir}/LICENSE" "${pkgdir}/usr/share/licenses/${_upstream_pkgname}"
+
+ mkdir -p "${pkgdir}/usr/share/${_upstream_pkgname}/manifests"
+ cp "${srcdir}/gopath/src/github.com/${pkgname}/${_pkgauthor}/build-manifests/${_manifest_non_rbac}" "${pkgdir}/usr/share/${_upstream_pkgname}/manifests/"
+ cp "${srcdir}/gopath/src/github.com/${pkgname}/${_pkgauthor}/build-manifests/${_manifest_openshift}" "${pkgdir}/usr/share/${_upstream_pkgname}/manifests/"
+ cp "${srcdir}/gopath/src/github.com/${pkgname}/${_pkgauthor}/build-manifests/${_manifest_rbac}" "${pkgdir}/usr/share/${_upstream_pkgname}/manifests/"
+ chmod 644 "${pkgdir}/usr/share/${_upstream_pkgname}/manifests/"*.yaml
+}