From 0f1ad2b67e609584fe9b1e6c8c0d15cb171ce7e6 Mon Sep 17 00:00:00 2001 From: "s.goubaud" Date: Tue, 5 Nov 2019 11:40:51 -0500 Subject: [PATCH] Initialisation --- .gitignore | 3 +++ .project | 11 ++++++++++ README.md | 5 +++-- updateRepository.sh | 50 +++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 67 insertions(+), 2 deletions(-) create mode 100644 .gitignore create mode 100644 .project create mode 100644 updateRepository.sh diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..3db6502 --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +.deploy +.tmp +.toindex diff --git a/.project b/.project new file mode 100644 index 0000000..c669121 --- /dev/null +++ b/.project @@ -0,0 +1,11 @@ + + + Helm Repository + + + + + + + + diff --git a/README.md b/README.md index 661c7c7..a73dbda 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,3 @@ -# helmrepo -My personnal helm repo +# Gsyltc's Helm Repository + +It-s my personnal helm repository for Jeedom and others diff --git a/updateRepository.sh b/updateRepository.sh new file mode 100644 index 0000000..097dacf --- /dev/null +++ b/updateRepository.sh @@ -0,0 +1,50 @@ +#!/bin/bash + +CHARTS_DIR=$HOME/workspace/projects/jeedom/helm/charts +WORKING_DIR=$HOME/workspace/repositories/my-helm-repo + +TMP_DIR=$WORKING_DIR/.tmp +DEPLOY_DIR=$WORKING_DIR/.deploy +INDEX_DIR=$WORKING_DIR/.toindex + +# Updatye local repositorie +cd $WORKING_DIR +git pull + +mkdir -p $TMP_DIR +mkdir -p $INDEX_DIR + +for currentDirectory in `find $CHARTS_DIR -maxdepth 1 -mindepth 1 -type d` +do + echo "Current directory : $currentDirectory" + helm package $currentDirectory --destination $TMP_DIR + + cd $TMP_DIR + for currentFile in `find -type f` + do + echo "Current file : $currentFile" + if [ -f $DEPLOY_DIR/$currentFile ] ; then + echo "\033[33;1m [WARNING] $currentFile already exist\033[0;1m" + rm $currentFile + else + echo "Moving file" + mv $currentFile $WORKING_DIR/.toindex + echo "\033[35;1m [INFO] $currentFile updated\033[0;1m" + fi + done +done + +if [ "$(ls -A $INDEX_DIR)" ] ; then + echo "CR Upload" + cr upload -p $WORKING_DIR/.toindex + echo "======> Updating index.yaml" + cr index -i $WORKING_DIR/index.yaml -p $INDEX_DIR + mv $INDEX_DIR/*.tgz $DEPLOY_DIR +else + echo "Nothing to update" +fi + +git add -A . +git commit -a -m "Updating repository" +git push origin version +helm repo update