Skip to content

Commit

Permalink
Update to allow building of a released version of the stack
Browse files Browse the repository at this point in the history
Signed-off-by: Steven Groeger <groeges@uk.ibm.com>
  • Loading branch information
groeges committed Aug 19, 2020
1 parent 9ad57be commit b81498b
Show file tree
Hide file tree
Showing 3 changed files with 53 additions and 1 deletion.
44 changes: 44 additions & 0 deletions ci/ext/post_package.d/create_index.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ mkdir -p $base_dir/ci/build/index-src
# url for downloading released assets
release_url="https://github.com/$TRAVIS_REPO_SLUG/releases/download"

<<<<<<< Upstream, based on origin/master
# iterate over each repo
# iterate over each stack
for stack in $(ls $base_dir/*/stack.yaml 2>/dev/null | sort)
Expand Down Expand Up @@ -49,6 +50,49 @@ do
sed -e "s|${RELEASE_URL}/.*/|{{EXTERNAL_URL}}/|" $index_file_v2_temp > $nginx_file
rm -f $index_file_v2_temp
fi
=======
# iterate over each stack
for stack in $(ls $base_dir/*/stack.yaml 2>/dev/null | sort)
do
echo $stack
stack_dir=$(dirname $stack)

if [ -d $stack_dir ]
then
pushd $stack_dir

stack_id=$(basename $stack_dir)
stack_version=$(awk '/^version *:/ { gsub("version:","",$NF); gsub("\"","",$NF); print $NF}' $stack)
stack_version_major=`echo $stack_version | cut -d. -f1`
stack_version_minor=`echo $stack_version | cut -d. -f2`
stack_version_patch=`echo $stack_version | cut -d. -f3`

index_name=$stack_id-$stack_version-index

index_file_v2=$assets_dir/$index_name.yaml
index_file_local_v2=$assets_dir/$index_name-local.yaml
index_file_v2_temp=$assets_dir/$index_name-temp.yaml
nginx_file=$base_dir/ci/build/index-src/$index_name.yaml

if [ -f $index_file_v2 ]; then
# Copy index file as we will update later
cp $index_file_v2 $index_file_v2_temp

# Resolve external URL for local / github release
sed -e "s|${RELEASE_URL}/.*/|file://$assets_dir/|" $index_file_v2_temp > $index_file_local_v2
if [ "${BUILD_RELEASE}" == "true" ]; then
if [ ! -z $RELEASE_NAME ]; then
sed -e "s|${RELEASE_URL}/.*/|${RELEASE_URL}/${RELEASE_NAME}/|" $index_file_v2_temp > $index_file_v2
fi
fi
rm -f $base_dir/ci/build/index-src/*.yaml
sed -e "s|${RELEASE_URL}/.*/|{{EXTERNAL_URL}}/|" $index_file_v2_temp > $nginx_file
rm -f $index_file_v2_temp
fi

popd

>>>>>>> 60c8e4b Update to allow building of a released version of the stack
else
echo "SKIPPING: $repo_dir"
fi
Expand Down
4 changes: 4 additions & 0 deletions ci/ext/pre_env.d/pre_env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,11 @@ then
fi
if [ -z "${IMAGE_REGISTRY_ORG}" ]
then
<<<<<<< Upstream, based on origin/master
export IMAGE_REGISTRY_ORG="ICP4A"
=======
export IMAGE_REGISTRY_ORG="icpa"
>>>>>>> 60c8e4b Update to allow building of a released version of the stack
fi
if [ -z "${LATEST_RELEASE}" ]; then
export LATEST_RELEASE=true
Expand Down
6 changes: 5 additions & 1 deletion ci/list_artifacts.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,8 @@ do
echo "-------------------------------"
cat $index
echo "-------------------------------"
done
<<<<<<< Upstream, based on origin/master
done
=======
done
>>>>>>> 60c8e4b Update to allow building of a released version of the stack

0 comments on commit b81498b

Please sign in to comment.