From f98b1a5b40c01f54e407d1aaa1a5945c6beeb6c5 Mon Sep 17 00:00:00 2001 From: Tracey Bogue Date: Thu, 21 Oct 2021 06:46:03 -0500 Subject: [PATCH] Add Debian packaging for helm and chartmuseum These packages require the following files in a local mirror: * chartmuseum-0.12.0.tar.gz * chartmuseum-v0.12.0-amd64 * helm-v3.2.1-linux-amd64.tar.gz Story: 2009101 Task: 43715 Signed-off-by: Tracey Bogue Change-Id: I85c854f1fb62efa993a030fe06105bb2c0751165 --- debian_pkg_dirs | 2 ++ .../chartmuseum/debian/deb_folder/changelog | 5 +++ .../debian/deb_folder/chartmuseum.install | 1 + .../deb_folder/chartmuseum.lintian-overrides | 1 + .../chartmuseum/debian/deb_folder/control | 14 +++++++++ .../chartmuseum/debian/deb_folder/copyright | 31 +++++++++++++++++++ .../missing-sources/chartmuseum-v0.12.0-amd64 | 0 .../chartmuseum/debian/deb_folder/rules | 20 ++++++++++++ .../debian/deb_folder/source/format | 1 + kubernetes/chartmuseum/debian/dl_hook | 17 ++++++++++ kubernetes/chartmuseum/debian/meta_data.yaml | 7 +++++ kubernetes/helm/debian/deb_folder/changelog | 5 +++ kubernetes/helm/debian/deb_folder/control | 14 +++++++++ kubernetes/helm/debian/deb_folder/copyright | 31 +++++++++++++++++++ .../helm/debian/deb_folder/helm.install | 4 +++ .../debian/deb_folder/helm.lintian-overrides | 2 ++ kubernetes/helm/debian/deb_folder/rules | 25 +++++++++++++++ .../helm/debian/deb_folder/source/format | 1 + kubernetes/helm/debian/dl_hook | 18 +++++++++++ kubernetes/helm/debian/meta_data.yaml | 7 +++++ 20 files changed, 206 insertions(+) create mode 100644 kubernetes/chartmuseum/debian/deb_folder/changelog create mode 100644 kubernetes/chartmuseum/debian/deb_folder/chartmuseum.install create mode 100644 kubernetes/chartmuseum/debian/deb_folder/chartmuseum.lintian-overrides create mode 100644 kubernetes/chartmuseum/debian/deb_folder/control create mode 100644 kubernetes/chartmuseum/debian/deb_folder/copyright create mode 100644 kubernetes/chartmuseum/debian/deb_folder/missing-sources/chartmuseum-v0.12.0-amd64 create mode 100755 kubernetes/chartmuseum/debian/deb_folder/rules create mode 100644 kubernetes/chartmuseum/debian/deb_folder/source/format create mode 100755 kubernetes/chartmuseum/debian/dl_hook create mode 100644 kubernetes/chartmuseum/debian/meta_data.yaml create mode 100644 kubernetes/helm/debian/deb_folder/changelog create mode 100644 kubernetes/helm/debian/deb_folder/control create mode 100644 kubernetes/helm/debian/deb_folder/copyright create mode 100644 kubernetes/helm/debian/deb_folder/helm.install create mode 100644 kubernetes/helm/debian/deb_folder/helm.lintian-overrides create mode 100755 kubernetes/helm/debian/deb_folder/rules create mode 100644 kubernetes/helm/debian/deb_folder/source/format create mode 100755 kubernetes/helm/debian/dl_hook create mode 100644 kubernetes/helm/debian/meta_data.yaml diff --git a/debian_pkg_dirs b/debian_pkg_dirs index 6eb09d419..2350a9dfa 100644 --- a/debian_pkg_dirs +++ b/debian_pkg_dirs @@ -6,4 +6,6 @@ config/puppet-modules/puppet-rabbitmq-8.5.0 config/puppet-modules/puppet-staging filesystem/drbd/drbd-tools filesystem/parted +kubernetes/chartmuseum +kubernetes/helm storage-drivers/trident-installer diff --git a/kubernetes/chartmuseum/debian/deb_folder/changelog b/kubernetes/chartmuseum/debian/deb_folder/changelog new file mode 100644 index 000000000..6227df1cf --- /dev/null +++ b/kubernetes/chartmuseum/debian/deb_folder/changelog @@ -0,0 +1,5 @@ +chartmuseum (0.12.0-1) unstable; urgency=medium + + * Initial release + + -- Tracey Bogue Tue, 19 Oct 2021 13:14:42 +0000 diff --git a/kubernetes/chartmuseum/debian/deb_folder/chartmuseum.install b/kubernetes/chartmuseum/debian/deb_folder/chartmuseum.install new file mode 100644 index 000000000..313ce29cb --- /dev/null +++ b/kubernetes/chartmuseum/debian/deb_folder/chartmuseum.install @@ -0,0 +1 @@ +usr/bin/chartmuseum diff --git a/kubernetes/chartmuseum/debian/deb_folder/chartmuseum.lintian-overrides b/kubernetes/chartmuseum/debian/deb_folder/chartmuseum.lintian-overrides new file mode 100644 index 000000000..f50ad2064 --- /dev/null +++ b/kubernetes/chartmuseum/debian/deb_folder/chartmuseum.lintian-overrides @@ -0,0 +1 @@ +statically-linked-binary diff --git a/kubernetes/chartmuseum/debian/deb_folder/control b/kubernetes/chartmuseum/debian/deb_folder/control new file mode 100644 index 000000000..cad64e076 --- /dev/null +++ b/kubernetes/chartmuseum/debian/deb_folder/control @@ -0,0 +1,14 @@ +Source: chartmuseum +Section: admin +Priority: optional +Maintainer: StarlingX Developers +Build-Depends: debhelper-compat (= 13) +Standards-Version: 4.5.1 +Homepage: https://www.starlingx.io + +Package: chartmuseum +Architecture: any +Depends: ${misc:Depends} +Description: StarlingX Helm Chartmuseum + Chartmuseum is a Helm chart repository with support for Amazon S3 + and Google Cloud Storage. diff --git a/kubernetes/chartmuseum/debian/deb_folder/copyright b/kubernetes/chartmuseum/debian/deb_folder/copyright new file mode 100644 index 000000000..c1c64e681 --- /dev/null +++ b/kubernetes/chartmuseum/debian/deb_folder/copyright @@ -0,0 +1,31 @@ +Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ + +Upstream-Name: chartmuseum +Upstream-Contact: https://slack.k8s.io/ +Source: https://github.com/helm/chartmuseum/ +Files: * +Copyright: (C) Copyright 2020 The Helm Authors All Rights Reserved +License: Apache-2 + +Upstream-Name: chartmuseum +Upstream-Contact: StarlingX Developers +Source: https://opendev.org/starlingx/integ/src/branch/master/kubernetes/chartmuseum +Files: debian/* +Copyright: (c) 2021 Wind River Systems, Inc. +License: Apache-2 + +License: Apache-2 + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + . + http://www.apache.org/licenses/LICENSE-2.0 + . + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + . + On Debian-based systems the full text of the Apache version 2.0 license + can be found in `/usr/share/common-licenses/Apache-2.0'. diff --git a/kubernetes/chartmuseum/debian/deb_folder/missing-sources/chartmuseum-v0.12.0-amd64 b/kubernetes/chartmuseum/debian/deb_folder/missing-sources/chartmuseum-v0.12.0-amd64 new file mode 100644 index 000000000..e69de29bb diff --git a/kubernetes/chartmuseum/debian/deb_folder/rules b/kubernetes/chartmuseum/debian/deb_folder/rules new file mode 100755 index 000000000..028582fd2 --- /dev/null +++ b/kubernetes/chartmuseum/debian/deb_folder/rules @@ -0,0 +1,20 @@ +#!/usr/bin/make -f +# export DH_VERBOSE = 1 + +export CHARTMUSEUM_VERSION = 0.12.0 +export ROOT = debian/tmp +export BINDIR = $(ROOT)/usr/bin + +%: + dh $@ + +override_dh_auto_build: + tar xfz chartmuseum-$(CHARTMUSEUM_VERSION).tar.gz + +override_dh_auto_clean: + +override_dh_auto_install: + install -d -m 755 $(BINDIR) + install -p -D -m 755 chartmuseum-v$(CHARTMUSEUM_VERSION)-amd64 $(BINDIR)/chartmuseum + +override_dh_auto_test: diff --git a/kubernetes/chartmuseum/debian/deb_folder/source/format b/kubernetes/chartmuseum/debian/deb_folder/source/format new file mode 100644 index 000000000..163aaf8d8 --- /dev/null +++ b/kubernetes/chartmuseum/debian/deb_folder/source/format @@ -0,0 +1 @@ +3.0 (quilt) diff --git a/kubernetes/chartmuseum/debian/dl_hook b/kubernetes/chartmuseum/debian/dl_hook new file mode 100755 index 000000000..1146f9c75 --- /dev/null +++ b/kubernetes/chartmuseum/debian/dl_hook @@ -0,0 +1,17 @@ +#!/bin/bash +set -x + +PKG_BUILD_NAME=$1 +PKG_BUILD_ROOT=$(realpath `pwd`/${PKG_BUILD_NAME}) + +mkdir ${PKG_BUILD_ROOT} +pushd ${PKG_BUILD_ROOT} + +# Local mirror workaround until CGCS_BASE mirror is supported. +STX_MIRROR=$(realpath "/import/mirrors/starlingx") + +# Download and extract helm source package. +CM_SOURCE=$(realpath ${STX_MIRROR}/downloads/chartmuseum-0.12.0.tar.gz) +CM_EXEC=$(realpath ${STX_MIRROR}/downloads/chartmuseum-v0.12.0-amd64) +cp ${CM_SOURCE} ${PKG_BUILD_ROOT} +cp ${CM_EXEC} ${PKG_BUILD_ROOT} diff --git a/kubernetes/chartmuseum/debian/meta_data.yaml b/kubernetes/chartmuseum/debian/meta_data.yaml new file mode 100644 index 000000000..064a78814 --- /dev/null +++ b/kubernetes/chartmuseum/debian/meta_data.yaml @@ -0,0 +1,7 @@ +--- +debname: chartmuseum +debver: 0.12.0-1 +dl_hook: dl_hook +revision: + dist: $STX_DIST + PKG_GITREVCOUNT: true diff --git a/kubernetes/helm/debian/deb_folder/changelog b/kubernetes/helm/debian/deb_folder/changelog new file mode 100644 index 000000000..8b0102f1d --- /dev/null +++ b/kubernetes/helm/debian/deb_folder/changelog @@ -0,0 +1,5 @@ +helm (3.2.1-1) unstable; urgency=medium + + * Initial release + + -- Tracey Bogue Tue, 19 Oct 2021 07:46:42 +0000 diff --git a/kubernetes/helm/debian/deb_folder/control b/kubernetes/helm/debian/deb_folder/control new file mode 100644 index 000000000..54b596a88 --- /dev/null +++ b/kubernetes/helm/debian/deb_folder/control @@ -0,0 +1,14 @@ +Source: helm +Section: admin +Priority: optional +Maintainer: StarlingX Developers +Build-Depends: debhelper-compat (= 13) +Standards-Version: 4.5.1 +Homepage: https://www.starlingx.io + +Package: helm +Architecture: any +Depends: ${shlibs:Depends}, ${misc:Depends} +Description: Helm Kubernetes Package Manager + Helm is a tool for managing charts, which are packages of pre-configured + Kubernetes resources. diff --git a/kubernetes/helm/debian/deb_folder/copyright b/kubernetes/helm/debian/deb_folder/copyright new file mode 100644 index 000000000..a9c4f86b3 --- /dev/null +++ b/kubernetes/helm/debian/deb_folder/copyright @@ -0,0 +1,31 @@ +Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ + +Upstream-Name: helm +Upstream-Contact: cncf-helm@lists.cncf.io +Source: https://github.com/helm +Files: * +Copyright: (C) Copyright 2016 The Kubernetes Authors All Rights Reserved +License: Apache-2 + +Upstream-Name: helm +Upstream-Contact: StarlingX Developers +Source: https://opendev.org/starlingx/integ/src/branch/master/kubernetes/helm +Files: debian/* +Copyright: (c) 2021 Wind River Systems, Inc. +License: Apache-2 + +License: Apache-2 + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + . + http://www.apache.org/licenses/LICENSE-2.0 + . + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + . + On Debian-based systems the full text of the Apache version 2.0 license + can be found in `/usr/share/common-licenses/Apache-2.0'. diff --git a/kubernetes/helm/debian/deb_folder/helm.install b/kubernetes/helm/debian/deb_folder/helm.install new file mode 100644 index 000000000..862f7638f --- /dev/null +++ b/kubernetes/helm/debian/deb_folder/helm.install @@ -0,0 +1,4 @@ +etc/sudoers.d/helm +usr/sbin/helm +usr/sbin/helm-upload +usr/sbin/helmv2-cli diff --git a/kubernetes/helm/debian/deb_folder/helm.lintian-overrides b/kubernetes/helm/debian/deb_folder/helm.lintian-overrides new file mode 100644 index 000000000..12bd2d543 --- /dev/null +++ b/kubernetes/helm/debian/deb_folder/helm.lintian-overrides @@ -0,0 +1,2 @@ +description-starts-with-package-name +statically-linked-binary diff --git a/kubernetes/helm/debian/deb_folder/rules b/kubernetes/helm/debian/deb_folder/rules new file mode 100755 index 000000000..6dec58ad1 --- /dev/null +++ b/kubernetes/helm/debian/deb_folder/rules @@ -0,0 +1,25 @@ +#!/usr/bin/make -f +# export DH_VERBOSE = 1 + +export ROOT = debian/tmp +export SBINDIR = $(ROOT)/usr/sbin +export SUDOERDIR = $(ROOT)/etc/sudoers.d + +export HELM_VERSION = 3.2.1 +export HELM_EXECUTABLE = linux-amd64/helm +export HELM_PKG = helm-v$(HELM_VERSION)-linux-amd64.tar.gz + +%: + dh $@ + +override_dh_auto_build: + # Extract the third party helm package downloaded in dl_hook. + tar xfz $(HELM_PKG) + +override_dh_auto_install: + install -d -m 755 $(SBINDIR) + install -p -D -m 755 $(HELM_EXECUTABLE) $(SBINDIR) + install -p -D -m 755 helm-upload $(SBINDIR) + install -p -D -m 755 helmv2-cli.sh $(SBINDIR)/helmv2-cli + install -d -m 755 $(SUDOERDIR) + install -p -D -m 440 helm.sudo $(SUDOERDIR)/helm diff --git a/kubernetes/helm/debian/deb_folder/source/format b/kubernetes/helm/debian/deb_folder/source/format new file mode 100644 index 000000000..163aaf8d8 --- /dev/null +++ b/kubernetes/helm/debian/deb_folder/source/format @@ -0,0 +1 @@ +3.0 (quilt) diff --git a/kubernetes/helm/debian/dl_hook b/kubernetes/helm/debian/dl_hook new file mode 100755 index 000000000..455a64075 --- /dev/null +++ b/kubernetes/helm/debian/dl_hook @@ -0,0 +1,18 @@ +#!/bin/bash +set -x + +PKG_BUILD_NAME=$1 +PKG_BUILD_ROOT=$(realpath `pwd`/${PKG_BUILD_NAME}) +STX_BASE=$(realpath ${MY_REPO}/stx) +SRC=$(realpath ${STX_BASE}/integ/kubernetes/helm/centos/files) + +mkdir ${PKG_BUILD_ROOT} +pushd ${PKG_BUILD_ROOT} +cp -pr ${SRC}/* ${PKG_BUILD_ROOT}/ + +# Local mirror workaround until CGCS_BASE mirror is supported. +STX_MIRROR=$(realpath "/import/mirrors/starlingx") + +# Download and extract helm source package. +HELM_SOURCE=$(realpath ${STX_MIRROR}/downloads/helm-v3.2.1-linux-amd64.tar.gz) +cp ${HELM_SOURCE} ${PKG_BUILD_ROOT} diff --git a/kubernetes/helm/debian/meta_data.yaml b/kubernetes/helm/debian/meta_data.yaml new file mode 100644 index 000000000..477278a8e --- /dev/null +++ b/kubernetes/helm/debian/meta_data.yaml @@ -0,0 +1,7 @@ +--- +debname: helm +debver: 3.2.1-1 +dl_hook: dl_hook +revision: + dist: $STX_DIST + PKG_GITREVCOUNT: true