Skip to content
This repository has been archived by the owner on Oct 22, 2021. It is now read-only.

Commit

Permalink
Switch docs and packaging to Helm v3
Browse files Browse the repository at this point in the history
  • Loading branch information
Mario Manno committed Feb 26, 2020
1 parent d8d4a91 commit a093f4a
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 44 deletions.
10 changes: 4 additions & 6 deletions bin/build-helm
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,15 @@ output_dir=${GIT_ROOT}/helm
# helm does not accept ^v and considers any version with dash to be a
# pre-release
version=$(echo "$ARTIFACT_VERSION" | sed 's/^v//; s/-/+/')
filename="${output_dir}/${ARTIFACT_NAME}-${version}.tgz"

[ -d "${output_dir}" ] && rm -r "${output_dir}"
cp -r "${GIT_ROOT}/deploy/helm" "${output_dir}"

perl -pi -e "s|repository: .*|repository: ${DOCKER_IMAGE_REPOSITORY}|g" "${output_dir}/quarks-job/values.yaml"
perl -pi -e "s|org: .*|org: ${DOCKER_IMAGE_ORG}|g" "${output_dir}/quarks-job/values.yaml"
perl -pi -e "s|tag: .*|tag: ${DOCKER_IMAGE_TAG}|g" "${output_dir}/quarks-job/values.yaml"
perl -pi -e "s|version: .*|version: ${version}|g" "${output_dir}/quarks-job/Chart.yaml"
perl -pi -e "s|appVersion: .*|appVersion: ${version}|g" "${output_dir}/quarks-job/Chart.yaml"

tar -C "${output_dir}" -czvf "${filename}" quarks-job

echo "The helm chart is now available from ${filename}"
helm package helm/quarks-job \
--app-version "$version" \
--version "$version" \
--destination "$output_dir"
1 change: 0 additions & 1 deletion bin/include/versioning
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,4 @@ GIT_SHA=$(echo "${GIT_DESCRIBE}" | awk -F - '{ print $3 }' )
GIT_TAG=$(echo "${GIT_DESCRIBE}" | awk -F - '{ print $1 }')
[ -z "$(git status --porcelain -uno | grep -v -E '^ M (integration|e2e|docs)')" ] || GIT_TAG="${GIT_TAG}-dirty"

ARTIFACT_NAME=$(basename "$(git config --get remote.origin.url)" .git)
ARTIFACT_VERSION="${GIT_TAG}-${GIT_COMMITS}.${GIT_SHA}"
42 changes: 7 additions & 35 deletions deploy/helm/quarks-job/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,46 +4,22 @@

This helm chart deploys the quarks-job operator.

## Installing the latest stable chart
## Installing the Latest Stable Chart

To install the latest stable helm chart, with `quarks-job` as the release name into the namespace `quarks`:

```bash
$ helm install --namespace quarks --name quarks-job https://s3.amazonaws.com/cf-operators/helm-charts/quarks-job-v0.0.1%2B47.g24492ea.tgz
$ helm install quarks-job https://s3.amazonaws.com/cf-operators/helm-charts/quarks-job-v0.0.1%2B47.g24492ea.tgz --namespace quarks
```

## Installing the chart from develop branch
## Installing the Chart From the Developmenet Branch

To install the helm chart directly from the [quarks-job repository](https://github.com/cloudfoundry-incubator/quarks-job) (any branch), the following parameters in the `values.yaml` need to be set in advance:
Run `bin/build-image` to create a new docker image, export `DOCKER_IMAGE_TAG` to override the tag.

To install the helm chart directly from the [quarks-job repository](https://github.com/cloudfoundry-incubator/quarks-job) (any branch), run `bin/build-helm` first.

| Parameter | Description | Default |
| ------------------------------------------------- | -------------------------------------------------------------------- | ---------------------------------------------- |
| `image.repository` | docker hub repository for the quarks-job image | `quarks-job` |
| `image.org` | docker hub organization for the quarks-job image | `cfcontainerization` |
| `image.tag` | docker image tag | `foobar` |
## Uninstalling the Chart


### For a local development with minikube, you can generate the image first and then use the `$ARTIFACT_VERSION` environment variable into the `image.tag`:
```bash
$ eval `minikube docker-env`
$ . bin/include/versioning
$ echo "Tag for docker image is $ARTIFACT_VERSION"
$ bin/build-image
```

Either set the `image.tag` in the `values.yaml`, or pass it to `helm install`:

```bash
$ helm install deploy/helm/quarks-job/ --namespace quarks --name quarks-job --set image.tag=$ARTIFACT_VERSION
```


## Uninstalling the chart

To delete the helm chart:

```bash
To delete the helm chart:

```bash
Expand All @@ -68,11 +44,7 @@ $ helm delete quarks-job --purge

By default, the helm chart will install RBAC ClusterRole and ClusterRoleBinding based on the chart release name, it will also grant the ClusterRole to an specific service account, which have the same name of the chart release.

The RBAC resources are enable by default. To disable:

```bash
$ helm install --namespace quarks --name quarks-job https://s3.amazonaws.com/cf-operators/helm-charts/quarks-job-v0.2.2%2B47.g24492ea.tgz --set global.rbacEnable=false
```
The RBAC resources are enable by default. To disable use `--set global.rbacEnable=false`.

## Custom Resources

Expand Down
4 changes: 2 additions & 2 deletions docs/publishing.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Publishing

We're publishing docker images and helm charts over travis. The travis will run these two jobs on master branch.
We're publishing docker images and helm charts over Travis. The travis will run these two jobs on master branch.

The travis needs following credentials variables to define variables in Repository Settings:
The Travis job needs the following credentials defined in "Repository Settings":

```bash
DOCKER_IMAGE_ORG="DOCKER IMAGE ORGANIZATION"
Expand Down

0 comments on commit a093f4a

Please sign in to comment.