Add debian package for stx-rook-ceph

Add debian packaging infrastructure for stx-rook-ceph to build
a debian package.

Test Plan:
PASS: Built package
PASS: Built iso
PASS: Installed controller

Story: 2009101
Task: 44119

Signed-off-by: Ramon Gazoni Lacerda <Ramon.GazoniLacerda@windriver.com>
Change-Id: Ib66a19e16205c84aae3c6610f86523632b123b01
This commit is contained in:
Ramon Gazoni Lacerda 2021-12-06 19:25:26 -03:00 committed by Ramon Gazoni Lacerda
parent 521f4d8f2f
commit ea5e4d315e
7 changed files with 153 additions and 0 deletions

View File

@ -0,0 +1,5 @@
stx-rook-ceph (1.0-1) unstable; urgency=medium
* Initial release.
-- Ramon Gazoni Lacerda <Ramon.GazoniLacerda@windriver.com> Tue, 30 Nov 2021 16:21:57 -0300

View File

@ -0,0 +1,19 @@
Source: stx-rook-ceph
Section: admin
Priority: optional
Maintainer: StarlingX Developers <starlingx-discuss@lists.starlingx.io>
Build-Depends: debhelper-compat (= 13),
helm,
openstack-helm-infra,
chartmuseum,
python3-k8sapp-rook,
python3-k8sapp-rook-wheels,
procps
Standards-Version: 4.1.2
Homepage: https://www.starlingx.io
Package: stx-rook-ceph
Architecture: any
Depends: ${shlibs:Depends}, ${misc:Depends}
Description: StarlingX K8S application: Rook Ceph
The StarlingX K8S application for Rook Ceph

View File

@ -0,0 +1,43 @@
Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
Upstream-Name: stx-rook-ceph
Source: https://opendev.org/starlingx/rook-ceph/
Files: *
Copyright:
(c) 2013-2021 Wind River Systems, Inc
(c) Others (See individual files for more details)
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
.
https://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'.
# If you want to use GPL v2 or later for the /debian/* files use
# the following clauses, or change it to suit. Delete these two lines
Files: debian/*
Copyright: 2021 Wind River Systems, Inc
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
.
https://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'.

View File

@ -0,0 +1,74 @@
#!/usr/bin/make -f
export DH_VERBOSE = 1
export ROOT = debian/tmp
export APP_FOLDER = $(ROOT)/usr/local/share/applications/helm
export INITRD_DIR = $(ROOT)/etc/rc.d/init.d
export DEB_VERSION = $(shell dpkg-parsechangelog | egrep '^Version:' | cut -f 2 -d ' ')
export MAJOR = $(shell echo $(DEB_VERSION) | cut -f 1 -d '.')
export MINOR_PATCH = $(shell echo $(DEB_VERSION) | cut -f 2 -d '.')
export APP_NAME = rook-ceph-apps
export APP_VERSION = $(MAJOR).$(MINOR_PATCH)
export APP_TARBALL = $(APP_NAME)-$(APP_VERSION).tgz
export HELM_REPO = stx-platform
export STAGING = staging
%:
dh $@
override_dh_auto_build:
# Host a server for the helm charts.
chartmuseum --debug --port=8879 --context-path='/charts' --storage="local" --storage-local-rootdir="./helm-charts" &
sleep 2
helm repo add local http://localhost:8879/charts
# Make the charts. These produce a tgz file
cd helm-charts && \
make rook-operator && \
make rook-ceph && \
make rook-ceph-provisioner
# Terminate the helm chart server.
pkill chartmuseum
# Setup staging
mkdir -p $(STAGING)
cp files/metadata.yaml $(STAGING)
cp manifests/manifest.yaml $(STAGING)
mkdir -p $(STAGING)/charts
cp helm-charts/*.tgz $(STAGING)/charts
cd $(STAGING)
# Populate metadata
sed -i 's/@APP_NAME@/$(APP_NAME)/g' $(STAGING)/metadata.yaml
sed -i 's/@APP_VERSION@/$(APP_VERSION)/g' $(STAGING)/metadata.yaml
sed -i 's/@HELM_REPO@/$(HELM_REPO)/g' $(STAGING)/metadata.yaml
# Copy the plugins: installed in the buildroot
mkdir -p $(STAGING)/plugins
cp /plugins/$(APP_NAME)/*.whl $(STAGING)/plugins
# Package it up
find . -type f ! -name '*.md5' -print0 | xargs -0 md5sum > checksum.md5
tar -zcf $(APP_TARBALL) -C $(STAGING)/ .
# Cleanup staging
rm -fr $(STAGING)
override_dh_auto_install:
# Install the app tar file
install -d -m 755 $(APP_FOLDER)
install -d -m 755 $(INITRD_DIR)
install -p -D -m 755 $(APP_TARBALL) $(APP_FOLDER)
install -m 750 files/rook-mon-exit.sh $(INITRD_DIR)/rook-mon-exit
# Prevents dh_fixperms from changing the permissions defined in this file
override_dh_fixperms:
dh_fixperms --exclude etc/rc.d/init.d/rook-mon-exit
override_dh_usrlocal:
echo "do nothing"

View File

@ -0,0 +1 @@
3.0 (quilt)

View File

@ -0,0 +1,2 @@
usr/local/share/applications/helm/*
etc/rc.d/init.d/rook-mon-exit

View File

@ -0,0 +1,9 @@
---
debname: stx-rook-ceph
debver: 1.0-1
src_path: stx-rook-ceph
src_files:
- files
revision:
dist: $STX_DIST
PKG_GITREVCOUNT: true