Skip to content

Commit

Permalink
Allow fork to add images to the imagelist file
Browse files Browse the repository at this point in the history
  • Loading branch information
nwmac committed Jun 8, 2020
1 parent 7af08f2 commit b935ca4
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 4 deletions.
1 change: 1 addition & 0 deletions custom-src/deploy/kubernetes/imagelist.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
stratos-kube-terminal:_VERSION_
1 change: 0 additions & 1 deletion deploy/common-build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,6 @@ function cleanup {
echo "-- Cleaning up ${STRATOS_PATH}"
rm -rf ${STRATOS_PATH}/dist
rm -rf ${STRATOS_PATH}/node_modules
rm -rf ${STRATOS_PATH}/bower_components
echo
echo "-- Cleaning up ${STRATOS_PATH}/deploy/containers/nginx/dist"
rm -rf ${STRATOS_PATH}/deploy/containers/nginx/dist
Expand Down
6 changes: 3 additions & 3 deletions deploy/kubernetes/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,9 @@ popd > /dev/null 2>&1
echo "Base path: ${STRATOS_PATH}"

# cleanup output, intermediate artifacts
cleanup
if [ "${CHART_ONLY}" == "false" ]; then
cleanup
fi

# Clean any old patched docker files left if previously errored
# rm -rf ${STRATOS_PATH}/deploy/Dockerfile.*.patched
Expand Down Expand Up @@ -218,8 +220,6 @@ if [ "${CHART_ONLY}" == "false" ]; then
fi
fi

custom_image_build

log "-- Building Helm Chart"

# Don't change the chart in the repo, copy it and modify it locally
Expand Down
20 changes: 20 additions & 0 deletions deploy/kubernetes/imagelist-gen.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,22 @@ __DIRNAME="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
printf "${BOLD}${CYAN}Generating ${YELLOW}imagelist.txt${RESET}\n"
echo ""

STRATOS_FOLDER="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && cd ../../ && pwd )"

# Add any customizations
function addCustomizations() {

if [ -f "${STRATOS_FOLDER}/custom-src/deploy/kubernetes/imagelist.txt" ];then
echo "Including custom imagelist contents"
cat "${STRATOS_FOLDER}/custom-src/deploy/kubernetes/imagelist.txt" >> ./imagelist.txt

# Update version number
VERSION=$(grep -Po 'consoleVersion: \K(.*)' ./values.yaml)
echo "Image Version: ${VERSION}"
sed -i 's/_VERSION_/'"${VERSION}"'/g' imagelist.txt
fi
}


CHART_FOLDER=${1}

Expand All @@ -37,6 +53,10 @@ ls -alR
echo ""

helm template -f ${__DIRNAME}/imagelist.values.yaml ${CHART_FOLDER} | grep "image:" | grep --extended --only-matching '([^"/[:space:]]+/)?[^"/[:space:]]+/[^:[:space:]]+:[a-zA-Z0-9\._-]+' | sort | uniq | awk -F'/' '{print $2}' > imagelist.txt

# Add any customizations
addCustomizations

popd > /dev/null

printf "${CYAN}"
Expand Down

0 comments on commit b935ca4

Please sign in to comment.