k8s-lbry: Refactors package script to use github releases.

This commit is contained in:
Ryan McGuire 2019-06-16 20:47:39 -04:00
parent 0e736ced8a
commit 9ec852a3cd
3 changed files with 54 additions and 30 deletions

View file

@ -1,4 +1,3 @@
index.yaml
*.tgz
values-dev.yaml
values-staging.yaml

View file

@ -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"

View file

@ -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"
)
}