refactor(pr-env): build script
Signed-off-by: rjshrjndrn <rjshrjndrn@gmail.com>
This commit is contained in:
parent
56e5267b12
commit
121db64ab5
1 changed files with 19 additions and 8 deletions
27
.github/workflows/pr-env.yaml
vendored
27
.github/workflows/pr-env.yaml
vendored
|
|
@ -200,15 +200,15 @@ jobs:
|
|||
export KUBECONFIG=/tmp/kubeconfig.yaml
|
||||
|
||||
# Creating folder app association for different app:folder combo
|
||||
# echo "${folder_to_app[app_name]}"
|
||||
declare -A folder_to_app
|
||||
map["api"]="chalice"
|
||||
map["sourcemap-reader"]="sourcemaps-reader"
|
||||
folder_to_app["api"]="chalice"
|
||||
|
||||
case $app_name in
|
||||
all)
|
||||
echo Building all components
|
||||
cd scripts/helmcharts
|
||||
bash -x build_deploy.sh $env
|
||||
backend
|
||||
chalice
|
||||
default
|
||||
;;
|
||||
backend*)
|
||||
echo "Building backend build"
|
||||
|
|
@ -222,8 +222,8 @@ jobs:
|
|||
components+=("$folder_name")
|
||||
done
|
||||
else
|
||||
# "${app_name#*:}" :: Strip backend: and output app1,app2,app3 to read -ra
|
||||
IFS=',' read -ra components <<< "${app_name#*:}"
|
||||
# "${app_name#*:}" :: Strip backend: and output app1,app2,app3 to read -ra
|
||||
IFS=',' read -ra components <<< "${app_name#*:}"
|
||||
fi
|
||||
for component in "${components[@]}"; do
|
||||
if [ $(docker manifest inspect ${DOCKER_REPO}/$component:${IMAGE_TAG} > /dev/null) ]; then
|
||||
|
|
@ -235,9 +235,20 @@ jobs:
|
|||
kubectl set image -n app deployment/$component-openreplay $component=${DOCKER_REPO}/$component:${IMAGE_TAG}
|
||||
done
|
||||
;;
|
||||
chalice)
|
||||
component=$app_name
|
||||
cd api || (Nothing to build: $app_name; exit 100)
|
||||
if [ $(docker manifest inspect ${DOCKER_REPO}/$component:${IMAGE_TAG} > /dev/null) ]; then
|
||||
echo Image present upstream. Skipping build: $component
|
||||
else
|
||||
echo "Building backend:$component"
|
||||
PUSH_IMAGE=1 bash -x ./build.sh $env $component
|
||||
fi
|
||||
kubectl set image -n app deployment/$app_name-openreplay $app_name=${DOCKER_REPO}/$app_name:${IMAGE_TAG}
|
||||
;;
|
||||
*)
|
||||
set -x
|
||||
cd $app_name || (Nothing to build: $app_name; exit 100)
|
||||
component=$app_name
|
||||
if [ $(docker manifest inspect ${DOCKER_REPO}/$component:${IMAGE_TAG} > /dev/null) ]; then
|
||||
echo Image present upstream. Skipping build: $component
|
||||
else
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue