moving all charts under charts/ dir (#112)

* moving all charts under charts/ dir

Signed-off-by: Jeff Billimek <jeff@billimek.com>

* add date and name to license file

* add contributing file

* rewrite readme

* pull request template

Signed-off-by: Jeff Billimek <jeffrey_k_billimek@homedepot.com>

* fixing badge icon
This commit is contained in:
Jeff Billimek 2020-01-10 14:58:11 -05:00 committed by GitHub
parent 479dcdcb4c
commit 14023d3024
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
212 changed files with 81 additions and 318 deletions

View File

@ -1,80 +0,0 @@
version: 2
jobs:
lint-charts:
docker:
- image: gcr.io/kubernetes-charts-ci/test-image:v3.3.2
steps:
- checkout
- run:
name: "Pull Submodules"
command: |
git submodule init
git submodule update --remote
- run:
name: lint
command: |
git remote add upstream https://github.com/billimek/billimek-charts
git fetch upstream master
ct lint --config .circleci/ct.yaml
install-charts:
machine: true
steps:
- checkout
- run:
name: "Pull Submodules"
command: |
git submodule init
git submodule update --remote
- run:
no_output_timeout: 12m
command: .circleci/install_charts.sh
lint-scripts:
docker:
- image: koalaman/shellcheck-alpine
steps:
- checkout
- run:
name: lint
command: shellcheck -x .circleci/*.sh
release-charts:
machine: true
steps:
- checkout
- run:
name: "Pull Submodules"
command: |
git submodule init
git submodule update --remote
- add_ssh_keys:
fingerprints:
- "07:2a:c4:7a:48:3b:e5:cd:0c:80:bb:0d:be:f1:25:32"
- run:
command: |
echo "export GIT_REPOSITORY_URL=$CIRCLE_REPOSITORY_URL" >> $BASH_ENV
echo "export GIT_USERNAME=$CIRCLE_PROJECT_USERNAME" >> $BASH_ENV
echo "export GIT_REPOSITORY_NAME=$CIRCLE_PROJECT_REPONAME" >> $BASH_ENV
.circleci/install_tools.sh
.circleci/release.sh
workflows:
version: 2
lint-and-install:
jobs:
- lint-scripts
- lint-charts:
filters:
branches:
ignore: master
tags:
ignore: /.*/
- install-charts:
requires:
- lint-charts
release:
jobs:
- release-charts:
filters:
tags:
ignore: /.*/
branches:
only: master

View File

@ -1,4 +0,0 @@
helm-extra-args: --timeout 600
chart-dirs:
- .
- kube-plex/charts

View File

@ -1,92 +0,0 @@
#!/usr/bin/env bash
set -o errexit
set -o nounset
set -o pipefail
readonly CT_VERSION=v2.3.3
readonly KIND_VERSION=0.2.1
readonly CLUSTER_NAME=chart-testing
readonly K8S_VERSION=v1.14.0
run_ct_container() {
echo 'Running ct container...'
docker run --rm --interactive --detach --network host --name ct \
--volume "$(pwd)/.circleci/ct.yaml:/etc/ct/ct.yaml" \
--volume "$(pwd):/workdir" \
--workdir /workdir \
"quay.io/helmpack/chart-testing:$CT_VERSION" \
cat
echo
}
cleanup() {
echo 'Removing ct container...'
docker kill ct > /dev/null 2>&1
echo 'Done!'
}
docker_exec() {
docker exec --interactive ct "$@"
}
create_kind_cluster() {
echo 'Installing kind...'
curl -sSLo kind "https://github.com/kubernetes-sigs/kind/releases/download/$KIND_VERSION/kind-linux-amd64"
chmod +x kind
sudo mv kind /usr/local/bin/kind
kind create cluster --name "$CLUSTER_NAME" --config .circleci/kind-config.yaml --image "kindest/node:$K8S_VERSION" --wait 60s
docker_exec mkdir -p /root/.kube
echo 'Copying kubeconfig to container...'
local kubeconfig
kubeconfig="$(kind get kubeconfig-path --name "$CLUSTER_NAME")"
docker cp "$kubeconfig" ct:/root/.kube/config
docker_exec kubectl cluster-info
echo
docker_exec kubectl get nodes
echo
}
install_local_path_provisioner() {
docker_exec kubectl delete storageclass standard
docker_exec kubectl apply -f https://raw.githubusercontent.com/helm/chart-testing/master/examples/kind/test/local-path-provisioner.yaml
}
install_tiller() {
echo 'Installing Tiller...'
docker_exec kubectl --namespace kube-system create sa tiller
docker_exec kubectl create clusterrolebinding tiller-cluster-rule --clusterrole=cluster-admin --serviceaccount=kube-system:tiller
docker_exec helm init --service-account tiller --upgrade --wait
echo
}
install_charts() {
docker_exec ct install
echo
}
main() {
run_ct_container
trap cleanup EXIT
changed=$(docker_exec ct list-changed)
if [[ -z "$changed" ]]; then
echo 'No chart changes detected.'
return
fi
echo 'Chart changes detected.'
create_kind_cluster
install_local_path_provisioner
install_tiller
install_charts
}
main

View File

@ -1,21 +0,0 @@
#!/usr/bin/env bash
set -o errexit
readonly HELM_VERSION=2.13.1
readonly CHART_RELEASER_VERSION=0.1.4
echo "Installing Helm..."
curl -LO "https://kubernetes-helm.storage.googleapis.com/helm-v$HELM_VERSION-linux-amd64.tar.gz"
sudo mkdir -p "/usr/local/helm-v$HELM_VERSION"
sudo tar -xzf "helm-v$HELM_VERSION-linux-amd64.tar.gz" -C "/usr/local/helm-v$HELM_VERSION"
sudo ln -s "/usr/local/helm-v$HELM_VERSION/linux-amd64/helm" /usr/local/bin/helm
rm -f "helm-v$HELM_VERSION-linux-amd64.tar.gz"
helm init --client-only
echo "Installing chart-releaser..."
curl -LO "https://github.com/helm/chart-releaser/releases/download/v${CHART_RELEASER_VERSION}/chart-releaser_${CHART_RELEASER_VERSION}_Linux_x86_64.tar.gz"
sudo mkdir -p "/usr/local/chart-releaser-v$CHART_RELEASER_VERSION"
sudo tar -xzf "chart-releaser_${CHART_RELEASER_VERSION}_Linux_x86_64.tar.gz" -C "/usr/local/chart-releaser-v$CHART_RELEASER_VERSION"
sudo ln -s "/usr/local/chart-releaser-v$CHART_RELEASER_VERSION/chart-releaser" /usr/local/bin/chart-releaser
rm -f "chart-releaser_${CHART_RELEASER_VERSION}_Linux_x86_64.tar.gz"

View File

@ -1,6 +0,0 @@
kind: Cluster
apiVersion: kind.sigs.k8s.io/v1alpha3
nodes:
- role: control-plane
- role: worker
- role: worker

View File

@ -1,110 +0,0 @@
#!/usr/bin/env bash
set -o errexit
set -o nounset
set -o pipefail
: "${CH_TOKEN:?Environment variable CH_TOKEN must be set}"
: "${GIT_REPOSITORY_URL:?Environment variable GIT_REPO_URL must be set}"
: "${GIT_USERNAME:?Environment variable GIT_USERNAME must be set}"
: "${GIT_EMAIL:?Environment variable GIT_EMAIL must be set}"
: "${GIT_REPOSITORY_NAME:?Environment variable GIT_REPOSITORY_NAME must be set}"
readonly REPO_ROOT="${REPO_ROOT:-$(git rev-parse --show-toplevel)}"
main() {
pushd "$REPO_ROOT" > /dev/null
echo "Fetching tags..."
git fetch --tags
local latest_tag
latest_tag=$(find_latest_tag)
local latest_tag_rev
latest_tag_rev=$(git rev-parse --verify "$latest_tag")
echo "$latest_tag_rev $latest_tag (latest tag)"
local head_rev
head_rev=$(git rev-parse --verify HEAD)
echo "$head_rev HEAD"
if [[ "$latest_tag_rev" == "$head_rev" ]]; then
echo "No code changes. Nothing to release."
exit
fi
rm -rf .deploy
mkdir -p .deploy
echo "Identifying changed charts since tag '$latest_tag'..."
local packaged=false
git diff --find-renames --name-only "$latest_tag_rev" -- [a-zA-Z0-9]* | cut -d '/' -f 1 | uniq > /tmp/modified_dirs.txt
while read -r dir; do
if find "$dir" -type f -iname "Chart.yaml" | grep -E -q 'Chart.yaml'; then
echo "Packaging chart '$dir'..."
package_chart "$dir"
packaged=true
fi
done < /tmp/modified_dirs.txt
rm /tmp/modified_dirs.txt
if [ "$packaged" = true ]; then
release_charts
sleep 5
update_index
else
echo "Nothing to do. No chart changes detected."
fi
popd > /dev/null
}
find_latest_tag() {
if ! git describe --tags --abbrev=0 2> /dev/null; then
git rev-list --max-parents=0 --first-parent HEAD
fi
}
package_chart() {
local chart="$1"
helm dependency build "$chart"
helm package "$chart" --destination .deploy
}
release_charts() {
chart-releaser upload -o "$GIT_USERNAME" -r "$GIT_REPOSITORY_NAME" -p .deploy
}
update_index() {
chart-releaser index -o "$GIT_USERNAME" -r "$GIT_REPOSITORY_NAME" -p .deploy/index.yaml
git config user.email "$GIT_EMAIL"
git config user.name "$GIT_USERNAME"
for file in */*.md; do
if [[ -e $file ]]; then
mkdir -p ".deploy/docs/$(dirname "$file")"
cp --force "$file" ".deploy/docs/$(dirname "$file")"
fi
done
git checkout gh-pages
cp --force .deploy/index.yaml index.yaml
if [[ -e ".deploy/docs" ]]; then
# mkdir -p charts
cp --force --recursive .deploy/docs/* .
fi
git checkout master -- README.md
if ! git diff --quiet; then
git add .
git commit --message="[ci skip] Update index.yaml" --signoff
git push "$GIT_REPOSITORY_URL" gh-pages
fi
}
main

View File

@ -0,0 +1,8 @@
#### Special notes for your reviewer:
#### Checklist
[Place an '[x]' (no spaces) in all applicable fields. Please remove unrelated fields.]
- [ ] [DCO](https://github.com/helm/charts/blob/master/CONTRIBUTING.md#sign-your-work) signed
- [ ] Chart Version bumped
- [ ] Variables are documented in the README.md
- [ ] Title of the PR starts with chart name (e.g. `[radarr]`)

53
CONTRIBUTING.md Normal file
View File

@ -0,0 +1,53 @@
# Contributing Guidelines
Contributions are welcome via GitHub pull requests. This document outlines the process to help get your contribution accepted.
## Sign off Your Work
The Developer Certificate of Origin (DCO) is a lightweight way for contributors to certify that they wrote or otherwise have the right to submit the code they are contributing to the project. Here is the full text of the [DCO](http://developercertificate.org/). Contributors must sign-off that they adhere to these requirements by adding a `Signed-off-by` line to commit messages.
```
This is my commit message
Signed-off-by: Random J Developer <random@developer.example.org>
```
See `git help commit`:
```
-s, --signoff
Add Signed-off-by line by the committer at the end of the commit log
message. The meaning of a signoff depends on the project, but it typically
certifies that committer has the rights to submit this work under the same
license and agrees to a Developer Certificate of Origin (see
http://developercertificate.org/ for more information).
```
## How to Contribute
1. Fork this repository, develop, and test your changes
1. Remember to sign off your commits as described above
1. Submit a pull request
***NOTE***: In order to make testing and merging of PRs easier, please submit changes to multiple charts in separate PRs.
### Technical Requirements
* Must follow [Charts best practices](https://helm.sh/docs/topics/chart_best_practices/)
* Must pass CI jobs for linting and installing changed charts with the [chart-testing](https://github.com/helm/chart-testing) tool
* Any change to a chart requires a version bump following [semver](https://semver.org/) principles. See [Immutability(#immutability) and [Versioning](#versioning) below
Once changes have been merged, the release job will automatically run to package and release changed charts.
### Immutability
Chart releases must be immutable. Any change to a chart warrants a chart version bump even if it is only changed to the documentation.
### Versioning
The chart `version` should follow [semver](https://semver.org/).
Charts should start at `1.0.0`. Any breaking (backwards incompatible) changes to a chart should:
1. Bump the MAJOR version
2. In the README, under a section called "Upgrading", describe the manual steps necessary to upgrade to the new (specified) MAJOR version

View File

@ -186,7 +186,7 @@
same "printed page" as the copyright notice for easier
identification within third-party archives.
Copyright [yyyy] [name of copyright owner]
Copyright 2020 Jeff Billimek
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.

View File

@ -1,10 +1,25 @@
[![CircleCI](https://circleci.com/gh/billimek/billimek-charts.svg?style=svg)](https://circleci.com/gh/billimek/billimek-charts)
# Collection of helm charts
## Installation
[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)
[![](https://github.com/billimek/billimek-charts/workflows/Release%20Charts/badge.svg?branch=master)](https://github.com/billimek/billimek-charts/actions)
## Usage
[Helm](https://helm.sh) must be installed to use the charts.
Please refer to Helm's [documentation](https://helm.sh/docs/) to get started.
Once Helm is set up properly, add the repo as follows:
```console
helm repo add billimek https://billimek.com/billimek-charts/
helm search billimek
```
You can then run `helm search repo billimek` to see the charts.
## Contributing
See [CONTRIBUTING.md](./CONTRIBUTING.md)
## License
[Apache 2.0 License](./LICENSE)

Some files were not shown because too many files have changed in this diff Show More