Skip to content
This repository has been archived by the owner on May 6, 2022. It is now read-only.

Commit

Permalink
Publish helm charts on push
Browse files Browse the repository at this point in the history
  • Loading branch information
carolynvs committed Apr 27, 2018
1 parent 1408617 commit b697f98
Show file tree
Hide file tree
Showing 8 changed files with 72 additions and 18 deletions.
1 change: 1 addition & 0 deletions .gitignore
@@ -1,3 +1,4 @@
/bin/charts
/minibroker
/minibroker-linux
/image/minibroker
10 changes: 4 additions & 6 deletions .travis.yml
Expand Up @@ -2,23 +2,21 @@ language: go
go_import_path: github.com/osbkit/minibroker
go:
- 1.10.x

sudo: required
services:
- docker

env:
global:
# DOCKER_USER
- secure: AOkUdtjcADBtnv5gmxpjyIjKm3SI0tYTxG1x/pVEIRDVOB4oPePbhd2JeEMDuNZiKke+MeNHXO28x4VsKCqjWzEpO47iu5DC3FQPBDW3hB5545PrgaHANrMsYIa2qpfJ9PmhneJYeHj0YaDmsPaYoNIrtkBk8dqt+qzk2wHv/70o/VMRkRgcFT8ixoCIJsgGgiiV0JUevXBEqDffqMNKoBn5hGmCT/YFCvAXTkGXMkM5ohQEp8Yjgw+UWNwrZoZPkGxG2b4HZxkXa4nWqK9sPSCltITw2tt2ALbxyJHCRkcxkTD7LeBXBexuxFWkvVBKNLeUOL/mfcxo5sutmPczHjmrMpSp/4kVo/bM0xfJaOJ3vTgxS5/0flZODJ0YnGEB7c9aOVW+YokHTpt3h998mAT0W3QW2XTR9u/HQaiJ//fTLm+Q6k7LoT4gKyQN0BDZFQ5xjIXwOl7qIHILGAcvZ9c7R80L2NRr8VqTx1RcD5DWn+rU5AuYdYFsHjgm4r5gfnp/U6UAYFKu29ILOk7vB85i0YBhKNuxJCGIs775HSw3beC+nZlkEXsk8O0xCiWbs2SqsWtw+OgLNWr8B3ZXdur/g1k4baPhTJaRotsoZmeKqcfRU5BwLghym9pjcYL5A3DR10hJRf6sqAxmmTKtNLnpJXLn0TGpn4ZECpDvmDo=
# DOCKER_PASSWORD
- secure: hmFUa0ZC3fPbbf2umW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/dHXlsFs2M0GJet8vxySyKuqRMcqUo8Fh7kr8c816Mchi96twpDJcFuQneoQh93hE32Jf7Kv6y3UgLaShcLYx3IQUYjZScJm7kX1fc8Iiw5/Xawmxl31ByR9govuRwPqVGxqNZbyoxQQHk7ck6TsKIB+YNmfUZ+ZdthKpKFcl/IBwwjchVu62d8T2wZepmL2LWBG+/Zn+oZVymhm7+c1e+Tg4o7wad32MgB4HoXooAohkmDLM6v8O1ShMxcQmnVt7eo7Q0oZRN2A0RcSnPTnOTgJ38Nb5SHzeMmu2KsYpbAV1V44GMm+yEE=
script:
- make build test-unit

deploy:
provider: script
script: docker login -u="$DOCKER_USER" -p="$DOCKER_PASSWORD" && make push
script: make release
on:
branch: master
branch: master
11 changes: 11 additions & 0 deletions Makefile
Expand Up @@ -118,4 +118,15 @@ deploy:
--recreate-pods --force charts/minibroker \
--set image="$(IMAGE):$(TAG)",imagePullPolicy="Always",deploymentStrategy="Recreate"

release: release-prep release-images release-charts

release-prep:
docker login -u="$DOCKER_USER" -p="$DOCKER_PASSWORD"

release-images: push

release-charts:
./charts/publish-charts.sh


.PHONY: build log build-linux test image clean push create-cluster deploy
12 changes: 9 additions & 3 deletions README.md
Expand Up @@ -42,9 +42,8 @@ helm upgrade --install catalog --namespace svc-cat svc-cat/catalog --wait
# Install Minibroker

```
git clone https://github.com/osbkit/minibroker.git
cd minibroker
helm install --name minibroker --namespace minibroker charts/minibroker
helm repo add minibroker https://minibroker.blob.core.windows.net/charts
helm install --name minibroker --namespace minibroker minibroker/minibroker
```

By default only Service Catalog Enabled services are included with Minibroker,
Expand Down Expand Up @@ -126,6 +125,13 @@ $ svcat unbind mysqldb
$ svcat deprovision mysqldb
```

To see Minibroker in action try out our Wordpress chart, that relies on Minibroker
to supply a database:

```
helm install --name minipress minibroker/wordpress
```

## Helm Chart Parameters
Minibroker passes parameters specified during provisioning to the underlying
Helm Chart. This lets you customize the service to specify a non-root user, or the name of
Expand Down
4 changes: 2 additions & 2 deletions charts/minibroker/Chart.yaml
@@ -1,3 +1,3 @@
name: minibroker
description: a chart for the service-broker-skeleton
version: 0.0.1
description: A minibroker for your minikube
version: 0.1.0
44 changes: 44 additions & 0 deletions charts/publish-charts.sh
@@ -0,0 +1,44 @@
#!/usr/bin/env bash

set -xeuo pipefail

helm init --client-only

#####
# set up the repo dir, and package up all charts
#####
REPO_ROOT=https://minibroker.blob.core.windows.net
AZURE_STORAGE_CONTAINER=charts
REPO_DIR=bin/charts
mkdir -p $REPO_DIR
echo "entering $REPO_DIR"
cd $REPO_DIR
# download the existing repo's index.yaml so that we can merge it later
echo "downloading existing index.yaml"
curl -sLO ${REPO_ROOT}/${AZURE_STORAGE_CONTAINER}/index.yaml
for dir in `ls ../../charts`;do
if [ ! -f ../../charts/$dir/Chart.yaml ];then
echo "skipping $dir because it lacks a Chart.yaml file"
else
echo "packaging $dir"
helm dep build ../../charts/$dir
helm package ../../charts/$dir
fi
done

#####
# index the charts, merging with the old index.yaml so charts are versioned
#####
helm repo index --url "$REPO_ROOT/$AZURE_STORAGE_CONTAINER" --merge index.yaml .

#####
# upload to Azure blob storage
#####

if [ -z "$AZURE_STORAGE_CONNECTION_STRING" ]; then
echo "AZURE_STORAGE_CONNECTION_STRING env var required to publish"
exit 1
fi

echo "uploading from $PWD"
az storage blob upload-batch --destination $AZURE_STORAGE_CONTAINER --source .
2 changes: 1 addition & 1 deletion charts/wordpress/Chart.yaml
@@ -1,5 +1,5 @@
name: wordpress
version: 0.9.0
version: 0.1.0
appVersion: 4.9.4
description: Web publishing platform for building blogs and websites.
icon: https://bitnami.com/assets/stacks/wordpress/img/wordpress-stack-220x234.png
Expand Down
6 changes: 0 additions & 6 deletions charts/wordpress/requirements.lock

This file was deleted.

0 comments on commit b697f98

Please sign in to comment.