Skip to content

Commit

Permalink
Initialisation
Browse files Browse the repository at this point in the history
  • Loading branch information
s.goubaud authored and s.goubaud committed Nov 5, 2019
1 parent 568924e commit 0f1ad2b
Show file tree
Hide file tree
Showing 4 changed files with 67 additions and 2 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.deploy
.tmp
.toindex
11 changes: 11 additions & 0 deletions .project
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>Helm Repository</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
</buildSpec>
<natures>
</natures>
</projectDescription>
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
# helmrepo
My personnal helm repo
# Gsyltc's Helm Repository

It-s my personnal helm repository for Jeedom and others
50 changes: 50 additions & 0 deletions updateRepository.sh
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 0f1ad2b

Please sign in to comment.