diff --git a/centos_build_layer.cfg b/centos_build_layer.cfg new file mode 100644 index 0000000..c581999 --- /dev/null +++ b/centos_build_layer.cfg @@ -0,0 +1 @@ +flock diff --git a/centos_pkg_dirs b/centos_pkg_dirs new file mode 100644 index 0000000..3b5e943 --- /dev/null +++ b/centos_pkg_dirs @@ -0,0 +1,2 @@ +portieris-helm +stx-portieris-helm \ No newline at end of file diff --git a/centos_pkg_dirs_containers b/centos_pkg_dirs_containers new file mode 100644 index 0000000..3b5e943 --- /dev/null +++ b/centos_pkg_dirs_containers @@ -0,0 +1,2 @@ +portieris-helm +stx-portieris-helm \ No newline at end of file diff --git a/centos_tarball-dl.lst b/centos_tarball-dl.lst new file mode 100644 index 0000000..2b66cb5 --- /dev/null +++ b/centos_tarball-dl.lst @@ -0,0 +1 @@ +portieris-0.6.0.tgz#portieris#https://github.com/IBM/portieris/archive/0.6.0.tar.gz#http## diff --git a/portieris-helm/centos/build_srpm.data b/portieris-helm/centos/build_srpm.data new file mode 100644 index 0000000..79f2cf1 --- /dev/null +++ b/portieris-helm/centos/build_srpm.data @@ -0,0 +1,8 @@ +TAR_NAME=portieris +VERSION=0.6.0 +TAR="$TAR_NAME-$VERSION.tgz" + +COPY_LIST="${CGCS_BASE}/downloads/$TAR $PKG_BASE/files/* " + +TIS_PATCH_VER=1 + diff --git a/portieris-helm/centos/portieris-helm.spec b/portieris-helm/centos/portieris-helm.spec new file mode 100644 index 0000000..78a5c86 --- /dev/null +++ b/portieris-helm/centos/portieris-helm.spec @@ -0,0 +1,91 @@ +# Application tunables (maps to metadata) +%global app_name stx-portieris +%global helm_repo starlingx +#%global helm_folder /usr/lib/helm +#%global armada_folder /usr/lib/armada +#%global app_folder /usr/local/share/applications/helm + +# Install location +%global app_folder /usr/local/share/applications/helm + +# Build variables +%global helm_folder /usr/lib/helm + +Summary: StarlingX portieris Helm charts +Name: portieris-helm +Version: 0.6.0 +Release: %{tis_patch_ver}%{?_tis_dist} +License: Apache-2.0 +Group: base +Packager: Wind River +URL: unknown + +Source0: portieris-%{version}.tgz +Source1: repositories.yaml +Source2: index.yaml +Source3: caCert.pem +Source4: caCert.srl +Source5: serverCert.pem +Source6: serverKey.pem + +BuildArch: noarch + +BuildRequires: helm + +%description +StarlingX portieris charts + +%prep +%setup -n portieris + +%build +# initialize helm +# helm init --client-only does not work if there is no networking +# The following commands do essentially the same as: helm init +%define helm_home %{getenv:HOME}/.helm +mkdir %{helm_home} +mkdir %{helm_home}/repository +mkdir %{helm_home}/repository/cache +mkdir %{helm_home}/repository/local +mkdir %{helm_home}/plugins +mkdir %{helm_home}/starters +mkdir %{helm_home}/cache +mkdir %{helm_home}/cache/archive + +# Stage a repository file that only has a local repo +cp %{SOURCE1} %{helm_home}/repository/repositories.yaml + +# Stage a local repo index that can be updated by the build +cp %{SOURCE2} %{helm_home}/repository/local/index.yaml + +# Host a server for the charts +helm serve --repo-path . & +helm repo rm local +helm repo add local http://localhost:8879/charts + +# Create a chart tarball compliant with sysinv kube-app.py +%define app_staging %{_builddir}/staging +%define app_tarball portieris-%{version}.tgz + +# Make the charts. These produce a tgz file +make helm.package +cd %{_builddir}/portieris +tar -xvf %{app_tarball} +mkdir $PWD/portieris/certs +cp %{SOURCE3} $PWD/portieris/certs +cp %{SOURCE4} $PWD/portieris/certs +cp %{SOURCE5} $PWD/portieris/certs +cp %{SOURCE6} $PWD/portieris/certs +tar -zcf %{app_tarball} portieris +cd - + +# Terminate helm server (the last backgrounded task) +kill %1 + +%install +install -d -m 755 ${RPM_BUILD_ROOT}%{helm_folder} +install -p -D -m 755 %{_builddir}/portieris/%{app_tarball} ${RPM_BUILD_ROOT}%{helm_folder} + +%files +%defattr(-,root,root,-) +%{helm_folder}/* diff --git a/portieris-helm/files/caCert.pem b/portieris-helm/files/caCert.pem new file mode 100644 index 0000000..a2e13ec --- /dev/null +++ b/portieris-helm/files/caCert.pem @@ -0,0 +1,19 @@ +-----BEGIN CERTIFICATE----- +MIIDAzCCAeugAwIBAgIJAPM3ehKOEO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ieris-helm/files/caCert.srl new file mode 100644 index 0000000..e27662b --- /dev/null +++ b/portieris-helm/files/caCert.srl @@ -0,0 +1 @@ +9EB4619C5A555553 diff --git a/portieris-helm/files/index.yaml b/portieris-helm/files/index.yaml new file mode 100644 index 0000000..36db709 --- /dev/null +++ b/portieris-helm/files/index.yaml @@ -0,0 +1,3 @@ +apiVersion: v1 +entries: {} +generated: 2019-01-07T12:33:46.098166523-06:00 diff --git a/portieris-helm/files/metadata.yaml b/portieris-helm/files/metadata.yaml new file mode 100644 index 0000000..e69de29 diff --git a/portieris-helm/files/repositories.yaml b/portieris-helm/files/repositories.yaml new file mode 100644 index 0000000..e613b63 --- /dev/null +++ b/portieris-helm/files/repositories.yaml @@ -0,0 +1,12 @@ +apiVersion: v1 +generated: 2019-01-02T15:19:36.215111369-06:00 +repositories: +- caFile: "" + cache: /builddir/.helm/repository/cache/local-index.yaml + certFile: "" + keyFile: "" + name: local + password: "" + url: http://127.0.0.1:8879/charts + username: "" + diff --git a/portieris-helm/files/serverCert.pem b/portieris-helm/files/serverCert.pem new file mode 100644 index 0000000..97d2ee5 --- /dev/null +++ b/portieris-helm/files/serverCert.pem @@ -0,0 +1,18 @@ +-----BEGIN CERTIFICATE----- +MIIC+TCCAeGgAwIBAgIJAJ60YZxaVVVTMA0GCSqGSIb3DQEBCwUAMBcxFTATBgNV +BAMMDHBvcnRpZXJpc19jYTAgFw0yMDA0MzAwMTE4MDBaGA8yMjk0MDIxMzAxMTgw +MFowJDEiMCAGA1UEAwwZcG9ydGllcmlzLmt1YmUtc3lzdGVtLnN2YzCCASIwDQYJ +KoZIhvcNAQEBBQADggEPADCCAQoCggEBAOAYd9q1crnDfYI0/zO06dtaN7inMf2v +CN+uI9q7w7VJBGVLs+18E70s1iGM+XK/OSEKnyAGhlKduJxRcOymHOybiPVKHXgb +hQI0vWNKVEMdPg4dCZf5A3LbLVFFPy65j/zCN644xH0IewW6ZivQxDPEqdB0nqZH +KkmVtJSOdjzMM/7gQqkWiVPlZQWw+qoV4v4rAR/9lE9Z7qI6QUw4eWotzjL/YxfJ +vHIG5KKWaN0CPVwiSkqem8gyQde/XWgvOgnRIgQt//wv1puKU8Ea9lvjwnuyeI49 +qBbPpfQ76sadmvE4y4dPyVxhT4jR1WHW+Vaa+8aZwlwM6T/aqk10BMUCAwEAAaM5 +MDcwCQYDVR0TBAIwADALBgNVHQ8EBAMCBeAwHQYDVR0lBBYwFAYIKwYBBQUHAwIG +CCsGAQUFBwMBMA0GCSqGSIb3DQEBCwUAA4IBAQBfuznLGkzdfAWOrDO71RyMOWCV +JR5pMUuN5B3Kdv8+MFsINsjG6lIuV6TY82079BTEFqVoCaQjpIT+VJMAmkCRs2os +fekR3At7cXomJ4r4YykzIWsDIAzHRT2msDFdx/ZrAZc+iGgiGVYTmDD3Z2yD6JYM +MVcDOxV31AeQp4Y9ypHAbpt7qBkHyA4k/D+6mkEzKmbghZAZWVJA5SFI6hGZqIar +L3FV/0rbyCFV39DRD/l8xKRI3eFM7EnykbbGnb3hlNTPv6aixQEtFvnzyZROtNDk +zZGoZRUaBRspgOS8SDPqoi9mz9MZAhBBbQv/E9RiBsIKmDf9sVxEkrSwmnnA +-----END CERTIFICATE----- diff --git a/portieris-helm/files/serverKey.pem b/portieris-helm/files/serverKey.pem new file mode 100644 index 0000000..6cbad87 --- /dev/null +++ b/portieris-helm/files/serverKey.pem @@ -0,0 +1,27 @@ +-----BEGIN RSA PRIVATE KEY----- +MIIEowIBAAKCAQEA4Bh32rVyucN9gjT/M7Tp21o3uKcx/a8I364j2rvDtUkEZUuz +7XwTvSzWIYz5cr85IQqfIAaGUp24nFFw7KYc7JuI9UodeBuFAjS9Y0pUQx0+Dh0J +l/kDctstUUU/LrmP/MI3rjjEfQh7BbpmK9DEM8Sp0HSepkcqSZW0lI52PMwz/uBC +qRaJU+VlBbD6qhXi/isBH/2UT1nuojpBTDh5ai3OMv9jF8m8cgbkopZo3QI9XCJK +Sp6byDJB179daC86CdEiBC3//C/Wm4pTw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UwNDxQhsCwzfC +OcU7hfZsHAFiTRF6Ms9XLrIFD1VHlwMBr6pqyE45Mo497SIEboJ8uqg/DJ81cyjJ +4K8bXQKBgB+bNhkscllp0wbkB554sY8M2UatPkmZ8iic7zpw+q+enxPDwXiCQADl +EruzbZxHClimju+lnpdamY0Ox6hPyv1H9uENL275kO8zXRljVOqSayRUH1XHwnW5 +0mxxe0uFxosui/6mogq3wOsLwVsHj39vWqKE7/frwfb/PZHuvHCe +-----END RSA PRIVATE KEY----- diff --git a/portieris-helm/portieris/README b/portieris-helm/portieris/README new file mode 100644 index 0000000..4ad6110 --- /dev/null +++ b/portieris-helm/portieris/README @@ -0,0 +1,5 @@ +This directory contains all StarlingX charts that need to be built for this +application. Some charts are common across applications. These common charts +reside in the stx-config/kubernetes/helm-charts directory. To include these in +this application update the build_srpm.data file and use the COPY_LIST_TO_TAR +mechanism to populate these commom charts. diff --git a/stx-portieris-helm/centos/build_srpm.data b/stx-portieris-helm/centos/build_srpm.data new file mode 100644 index 0000000..7e85bcc --- /dev/null +++ b/stx-portieris-helm/centos/build_srpm.data @@ -0,0 +1,3 @@ +SRC_DIR="stx-portieris-helm" + +TIS_PATCH_VER=0 diff --git a/stx-portieris-helm/centos/stx-portieris-helm.spec b/stx-portieris-helm/centos/stx-portieris-helm.spec new file mode 100644 index 0000000..3a89dce --- /dev/null +++ b/stx-portieris-helm/centos/stx-portieris-helm.spec @@ -0,0 +1,99 @@ +# Application tunables (maps to metadata) +%global app_name stx-portieris +%global helm_repo starlingx +%global helm_folder /usr/lib/helm +%global armada_folder /usr/lib/armada +%global app_folder /usr/local/share/applications/helm +%global toolkit_version 0.1.0 +%global helmchart_version 0.1.0 + + +Summary: StarlingX Portieris Armada Helm Charts +Name: stx-portieris-helm +Version: 1.0 +Release: %{tis_patch_ver}%{?_tis_dist} +License: Apache-2.0 +Group: base +Packager: Wind River +URL: unknown + +Source0: %{name}-%{version}.tar.gz + +BuildArch: noarch + +BuildRequires: helm +BuildRequires: portieris-helm +Requires: portieris-helm + +%description +StarlingX Portieris Armada Helm Charts + +%prep +%setup + +%build +# initialize helm and build the toolkit +# helm init --client-only does not work if there is no networking +# The following commands do essentially the same as: helm init +%define helm_home %{getenv:HOME}/.helm +mkdir %{helm_home} +mkdir %{helm_home}/repository +mkdir %{helm_home}/repository/cache +mkdir %{helm_home}/repository/local +mkdir %{helm_home}/plugins +mkdir %{helm_home}/starters +mkdir %{helm_home}/cache +mkdir %{helm_home}/cache/archive + +# Stage a repository file that only has a local repo +cp files/repositories.yaml %{helm_home}/repository/repositories.yaml + +# Stage a local repo index that can be updated by the build +cp files/index.yaml %{helm_home}/repository/local/index.yaml + +# Host a server for the charts +helm serve --repo-path . & +helm repo rm local +helm repo add local http://localhost:8879/charts + +# terminate helm server (the last backgrounded task) +kill %1 + +# Create a chart tarball compliant with sysinv kube-app.py +%define app_staging %{_builddir}/staging +%define app_tarball %{app_name}-%{version}-%{tis_patch_ver}.tgz + +# Setup staging +mkdir -p %{app_staging} +cp files/metadata.yaml %{app_staging} +cp manifests/*.yaml %{app_staging} +mkdir -p %{app_staging}/charts +#cp helm-charts/*.tgz %{app_staging}/charts +cp %{helm_folder}/portieris*.tgz %{app_staging}/charts +cd %{app_staging} + +# Populate metadata +sed -i 's/@APP_NAME@/%{app_name}/g' %{app_staging}/metadata.yaml +sed -i 's/@APP_VERSION@/%{version}-%{tis_patch_ver}/g' %{app_staging}/metadata.yaml +sed -i 's/@HELM_REPO@/%{helm_repo}/g' %{app_staging}/metadata.yaml + +# package it up +find . -type f ! -name '*.md5' -print0 | xargs -0 md5sum > checksum.md5 +tar -zcf %{_builddir}/%{app_tarball} -C %{app_staging}/ . + +# Cleanup staging +rm -fr %{app_staging} + +%install +install -d -m 755 %{buildroot}/%{app_folder} +install -p -D -m 755 %{_builddir}/%{app_tarball} %{buildroot}/%{app_folder} +install -d -m 755 %{buildroot}/%{helm_folder} +install -p -D -m 755 %{helm_folder}/portieris*.tgz %{buildroot}/%{helm_folder} +install -d -m 755 %{buildroot}/%{armada_folder} +install -p -D -m 755 manifests/*.yaml %{buildroot}/%{armada_folder} + +%files +%defattr(-,root,root,-) +%{helm_folder}/* +%{armada_folder}/* +%{app_folder}/* diff --git a/stx-portieris-helm/stx-portieris-helm/README b/stx-portieris-helm/stx-portieris-helm/README new file mode 100644 index 0000000..b773ef4 --- /dev/null +++ b/stx-portieris-helm/stx-portieris-helm/README @@ -0,0 +1,5 @@ +This directory contains all StarlingX charts that need to be built for this +application. Some charts are common across applications. These common charts +reside in the stx-config/kubernetes/helm-charts directory. To include these in +this application update the build_srpm.data file and use the COPY_LIST_TO_TAR +mechanism to populate these common charts. diff --git a/stx-portieris-helm/stx-portieris-helm/files/index.yaml b/stx-portieris-helm/stx-portieris-helm/files/index.yaml new file mode 100644 index 0000000..36db709 --- /dev/null +++ b/stx-portieris-helm/stx-portieris-helm/files/index.yaml @@ -0,0 +1,3 @@ +apiVersion: v1 +entries: {} +generated: 2019-01-07T12:33:46.098166523-06:00 diff --git a/stx-portieris-helm/stx-portieris-helm/files/metadata.yaml b/stx-portieris-helm/stx-portieris-helm/files/metadata.yaml new file mode 100644 index 0000000..d2c6295 --- /dev/null +++ b/stx-portieris-helm/stx-portieris-helm/files/metadata.yaml @@ -0,0 +1,5 @@ +maintain_user_overrides: true + +app_name: @APP_NAME@ +app_version: @APP_VERSION@ +helm_repo: @HELM_REPO@ diff --git a/stx-portieris-helm/stx-portieris-helm/files/repositories.yaml b/stx-portieris-helm/stx-portieris-helm/files/repositories.yaml new file mode 100644 index 0000000..e613b63 --- /dev/null +++ b/stx-portieris-helm/stx-portieris-helm/files/repositories.yaml @@ -0,0 +1,12 @@ +apiVersion: v1 +generated: 2019-01-02T15:19:36.215111369-06:00 +repositories: +- caFile: "" + cache: /builddir/.helm/repository/cache/local-index.yaml + certFile: "" + keyFile: "" + name: local + password: "" + url: http://127.0.0.1:8879/charts + username: "" + diff --git a/stx-portieris-helm/stx-portieris-helm/manifests/manifest.yaml b/stx-portieris-helm/stx-portieris-helm/manifests/manifest.yaml new file mode 100644 index 0000000..b3e8379 --- /dev/null +++ b/stx-portieris-helm/stx-portieris-helm/manifests/manifest.yaml @@ -0,0 +1,52 @@ +--- +schema: armada/Chart/v1 +metadata: + schema: metadata/Document/v1 + name: portieris +data: + chart_name: portieris + release: portieris + namespace: default + wait: + timeout: 300 + labels: + app: portieris + install: + no_hooks: false + upgrade: + no_hooks: false + source: + type: tar + location: http://172.17.0.1/helm_charts/starlingx/portieris-0.6.0.tgz + subpath: portieris + reference: master + dependencies: [] + values: + namespace: default + images: + tags: + portieris: docker.io/ibmcom/portieris:0.6.0 + image: + host: docker.io/ibmcom + image: portieris + tags: 0.6.0 + IBMContainerService: false +--- +schema: armada/ChartGroup/v1 +metadata: + schema: metadata/Document/v1 + name: portieris +data: + description: "StarlingX Portieris" + sequenced: true + chart_group: + - portieris +--- +schema: armada/Manifest/v1 +metadata: + schema: metadata/Document/v1 + name: portieris-manifest +data: + release_prefix: 'stx' + chart_groups: + - portieris