From 9ec852a3cddb16fccf7fb2e533b9aaaf16e34e3c Mon Sep 17 00:00:00 2001 From: Ryan McGuire Date: Sun, 16 Jun 2019 20:47:39 -0400 Subject: [PATCH] k8s-lbry: Refactors package script to use github releases. --- contrib/k8s-lbry/.gitignore | 1 - contrib/k8s-lbry/index.yaml | 44 +++++++++++++++++++++++++++++++++++++ contrib/k8s-lbry/run.sh | 39 +++++++++----------------------- 3 files changed, 54 insertions(+), 30 deletions(-) create mode 100644 contrib/k8s-lbry/index.yaml diff --git a/contrib/k8s-lbry/.gitignore b/contrib/k8s-lbry/.gitignore index e6a67b5..2ba5676 100644 --- a/contrib/k8s-lbry/.gitignore +++ b/contrib/k8s-lbry/.gitignore @@ -1,4 +1,3 @@ -index.yaml *.tgz values-dev.yaml values-staging.yaml diff --git a/contrib/k8s-lbry/index.yaml b/contrib/k8s-lbry/index.yaml new file mode 100644 index 0000000..3bfdc5a --- /dev/null +++ b/contrib/k8s-lbry/index.yaml @@ -0,0 +1,44 @@ +apiVersion: v1 +entries: + k8s-lbry: + - apiVersion: v1 + appVersion: "1.0" + created: "2019-06-16T20:45:37.131503885-04:00" + description: LBRY on Kubernetes with Helm + digest: 0e28fad6b25fcbf79ea30390a65340c50422e84408a86f6e366abdfb1c471cf0 + home: https://github.com/lbryio/lbry-docker/tree/master/contrib/k8s-lbry + maintainers: + - email: ryan@enigmacurry.com + name: EnigmaCurry + - email: leopere [at] nixc [dot] us + name: Leopere + name: k8s-lbry + urls: + - https://github.com/lbryio/lbry-docker/releases/download/k8s-lbry-0.1.5/k8s-lbry-0.1.5.tgz + version: 0.1.5 + mysql: + - appVersion: 5.7.14 + created: "2019-06-16T20:45:37.133445969-04:00" + description: Fast, reliable, scalable, and easy to use open-source relational + database system. + digest: dacef52f53a395059131064cfdc7ae39ae2d7be2580440575d1532dfaa3fd2b8 + engine: gotpl + home: https://www.mysql.com/ + icon: https://www.mysql.com/common/logos/logo-mysql-170x115.png + keywords: + - mysql + - database + - sql + maintainers: + - email: o.with@sportradar.com + name: olemarkus + - email: viglesias@google.com + name: viglesiasce + name: mysql + sources: + - https://github.com/kubernetes/charts + - https://github.com/docker-library/mysql + urls: + - charts/mysql-0.19.0.tgz + version: 0.19.0 +generated: "2019-06-16T20:45:36.911335647-04:00" diff --git a/contrib/k8s-lbry/run.sh b/contrib/k8s-lbry/run.sh index 2842e2d..77e03e3 100755 --- a/contrib/k8s-lbry/run.sh +++ b/contrib/k8s-lbry/run.sh @@ -285,35 +285,16 @@ package() { PACKAGE="k8s-lbry-$1.tgz" - ## Build Helm package repository and upload to s3 - if which s3cmd > /dev/null; then - if s3cmd info $PACKAGE_BUCKET > /dev/null; then - # Download all remote releases, to re-include in new index.yaml - exe s3cmd sync $PACKAGE_BUCKET . - - # Check if release already exists - s3_url="$PACKAGE_BUCKET/$PACKAGE" - if s3cmd info "$s3_url"; then - echo "$s3_url already exists. Aborting." - exit 1 - fi - - # Package release and rebuild repository - exe helm dependency update - exe helm package . - exe helm repo index . - - # Publish packages to s3 - exe s3cmd put --acl-public index.yaml "$PACKAGE" $PACKAGE_BUCKET - exe s3cmd put --acl-public charts/*.tgz $PACKAGE_BUCKET/charts/ - else - echo "s3cmd is not setup, run s3cmd --configure" - exit 1 - fi - else - echo "s3cmd is not installed" - exit 1 - fi + # Package release and rebuild repository + exe helm dependency update + exe helm package . + exe helm repo index --merge index.yaml . + ## Replace URLs in index to point to github releases: + sed -i 's|- k8s-lbry-\(.*\).tgz$|- https://github.com/lbryio/lbry-docker/releases/download/k8s-lbry-\1/k8s-lbry-\1.tgz|g' index.yaml + echo "Created package: $PACKAGE" + echo "Next steps: " + echo " 1) Create new github release (https://github.com/lbryio/lbry-docker/releases) and upload $PACKAGE" + echo " 2) Commit index.yaml and push to github" ) }