Skip to content
This repository has been archived by the owner on Jul 27, 2023. It is now read-only.

Commit

Permalink
Updates to release v2 indexes (#138)
Browse files Browse the repository at this point in the history
Signed-off-by Neeraj Laad <[email protected]>
  • Loading branch information
neeraj-laad authored Aug 5, 2019
1 parent 26677ad commit 7a5f6a6
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 21 deletions.
41 changes: 21 additions & 20 deletions ci/package.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,19 +32,19 @@ do
then
echo -e "\nProcessing repo: $repo_name"

index_file=$assets_dir/$repo_name-index.yaml
index_file_v2=$assets_dir/$repo_name-index-v2.yaml
index_file_v1=$assets_dir/$repo_name-index-v1.yaml
index_file_v2=$assets_dir/$repo_name-index.yaml
index_file_test=$assets_dir/$repo_name-index-test.yaml

echo "apiVersion: v1" > $index_file
echo "projects:" >> $index_file

echo "apiVersion: v1" > $index_file_test
echo "projects:" >> $index_file_test
echo "apiVersion: v1" > $index_file_v1
echo "projects:" >> $index_file_v1

echo "apiVersion: v2" > $index_file_v2
echo "stacks:" >> $index_file_v2

echo "apiVersion: v2" > $index_file_test
echo "stacks:" >> $index_file_test

# iterate over each stack
for stack in $repo_dir/*/stack.yaml
do
Expand Down Expand Up @@ -84,23 +84,22 @@ do
echo -e "\n- SKIPPING stack: $repo_name/$stack_id"
fi

echo " $stack_id:" >> $index_file
echo " - updated: $(date -u +'%Y-%m-%dT%H:%M:%S%z')" >> $index_file
sed 's/^/ /' $stack >> $index_file
[ -n "$(tail -c1 $index_file)" ] && echo >> $index_file
echo " urls:" >> $index_file

echo " $stack_id:" >> $index_file_test
echo " - updated: $(date -u +'%Y-%m-%dT%H:%M:%S%z')" >> $index_file_test
sed 's/^/ /' $stack >> $index_file_test
[ -n "$(tail -c1 $index_file_test)" ] && echo >> $index_file_test
echo " urls:" >> $index_file_test
echo " $stack_id:" >> $index_file_v1
echo " - updated: $(date -u +'%Y-%m-%dT%H:%M:%S%z')" >> $index_file_v1
sed 's/^/ /' $stack >> $index_file_v1
[ -n "$(tail -c1 $index_file_v1)" ] && echo >> $index_file_v1
echo " urls:" >> $index_file_v1

echo " - id: $stack_id" >> $index_file_v2
sed 's/^/ /' $stack >> $index_file_v2
[ -n "$(tail -c1 $index_file_v2)" ] && echo >> $index_file_v2
echo " templates:" >> $index_file_v2

echo " - id: $stack_id" >> $index_file_test
sed 's/^/ /' $stack >> $index_file_test
[ -n "$(tail -c1 $index_file_test)" ] && echo >> $index_file_test
echo " templates:" >> $index_file_test

for template_dir in $stack_dir/templates/*/
do
if [ -d $template_dir ]
Expand All @@ -118,10 +117,12 @@ do
echo " - id: $template_id" >> $index_file_v2
echo " url: $release_url/$stack_id-v$stack_version/$template_archive" >> $index_file_v2

echo " - id: $template_id" >> $index_file_test
echo " url: $release_url/$stack_id-v$stack_version/$template_archive" >> $index_file_test

if [ $i -eq 0 ]
then
echo " - $release_url/$stack_id-v$stack_version/$template_archive" >> $index_file
echo " - file://$assets_dir/$template_archive" >> $index_file_test
echo " - $release_url/$stack_id-v$stack_version/$template_archive" >> $index_file_v1
((i+=1))
fi
fi
Expand Down
2 changes: 1 addition & 1 deletion ci/release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ mkdir -p $release_dir
# iterate over each asset
for asset in $assets_dir/*
do
if [[ $asset != *-test.yaml ]] && [[ $asset != *-v2.yaml ]]
if [[ $asset != *-test.yaml ]] && [[ $asset != *-v1.yaml ]]
then
echo "RELEASING: $asset"
mv $asset $release_dir
Expand Down

0 comments on commit 7a5f6a6

Please sign in to comment.