Skip to content

Commit

Permalink
Linting and packaging scrips
Browse files Browse the repository at this point in the history
Linting script
Refactored directory structure
Use /docs hook to deploy gh-pages
  • Loading branch information
gAmUssA committed Dec 6, 2018
1 parent 2fa9999 commit e315acb
Show file tree
Hide file tree
Showing 10 changed files with 88 additions and 15 deletions.
5 changes: 4 additions & 1 deletion .helmignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,7 @@
*.tmproj
# Images and archives
*.png
*.tgz
*.tgz
scripts/
screenshots/
docs/index.html
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,13 @@

The [Confluent Platform Helm charts](https://github.com/confluentinc/cp-helm-charts) enable you to deploy Confluent Platform services on Kubernetes for development, test, and proof of concept environments.

## Installing Charts

```
helm repo add confluent https://confluentinc.github.io/cp-helm-charts/
helm repo update
```

## Documentation

The Confluent Helm Chart documentation is located at [docs.confluent.io](https://docs.confluent.io/current/quickstart/cp-helm-charts/docs/index.html).
Expand Down
Binary file removed cp-helm-charts-0.1.0.tgz
Binary file not shown.
Binary file added docs/cp-helm-charts-0.1.0.tgz
Binary file not shown.
2 changes: 2 additions & 0 deletions docs/index.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ Clone the Confluent Helm Chart repo

.. code:: sh
> helm repo add confluentinc https://raw.githubusercontent.com/confluentinc/cp-helm-charts/master
> helm repo add confluent https://confluentinc.github.io/cp-helm-charts/
"confluentinc" has been added to your repositories
> helm repo update
Expand Down
22 changes: 22 additions & 0 deletions docs/index.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
apiVersion: v1
entries:
cp-helm-charts:
- apiVersion: v1
appVersion: "1.0"
created: 2018-12-06T16:29:13.664059-05:00
description: A Helm chart for Confluent Open Source
digest: 54b189f949da3c64a27a6fb1b9652f66a406b5b64273322b07c75caa36243f89
name: cp-helm-charts
urls:
- cp-helm-charts-0.1.0.tgz
version: 0.1.0
- apiVersion: v1
appVersion: "1.0"
created: 2018-12-06T16:29:13.685308-05:00
description: A Helm chart for Confluent Open Source
digest: b9a653c19e2824c1ba1e3d18c3e0659a9db82a6b038f2ee870cf3e69e1016964
name: cp-helm-charts
urls:
- docs/cp-helm-charts-0.1.0.tgz
version: 0.1.0
generated: 2018-12-06T16:29:13.655983-05:00
13 changes: 0 additions & 13 deletions index.yaml

This file was deleted.

22 changes: 22 additions & 0 deletions scripts/lint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/bin/bash
error=0
RED='\033[0;31m'
RS='\033[0m' # No Color
GREEN='\033[0;32m'

echo -e "==> ${GREEN}Linting cp-helm-charts..${RS}."

for chart in `ls -1 charts`; do
echo -e "==> ${GREEN}Linting $chart...${RS}"
#output=`helm lint . --debug --strict 2> /dev/null`
output=`helm lint . --debug 2> /dev/null`
if [ $? -ne 0 ]; then
echo -e "===> ${RED} Liniting errors for chart $chart ${RS}"
echo -e "$output" | grep "\\["
exit 1
fi
echo -e "$output" | grep "\\["
done
echo -e "==> ${GREEN} No linting errors${RS}"

exit $error
30 changes: 30 additions & 0 deletions scripts/package.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#!/usr/bin/env bash
RED='\033[0;31m'
GREEN='\033[0;32m'
BLUE='\033[0;34m'
RS='\033[0m' # reset

echo -e "${RS}${BLUE} Cleaning and preparing..."
find . -iname "*.tgz" -type f | grep -v 'docs/' | xargs rm

echo -e "${RS}${BLUE} Linting and checking...${RS}"
scripts/lint.sh
RET=$?

echo -e "${RS}${BLUE} Packaging charts... ${RS}"
helm package .
RET=$?

if [[ "${RET}" == 0 ]]; then
helm repo index .

echo -e "Copying chart packages and index to docs ${RS}"
rm -f docs/*.tgz
rm -f docs/*.yaml
mv ./*.tgz docs/
mv ./index.yaml docs/

echo -e "${BLUE} Now commit and push charts and docs! ${RS}"
else
echo -e "${RED}Tests failed, charts not packaged! ${RS}"
fi

0 comments on commit e315acb

Please sign in to comment.