chore(build): Custom docker build env

This commit is contained in:
rjshrjndrn 2024-03-12 16:13:59 +01:00
parent 8c9ed6a941
commit 068f29fc35
9 changed files with 125 additions and 118 deletions

View file

@ -15,6 +15,8 @@ exit_err() {
fi fi
} }
source ../scripts/lib/_docker.sh
environment=$1 environment=$1
git_sha=$(git rev-parse --short HEAD) git_sha=$(git rev-parse --short HEAD)
image_tag=${IMAGE_TAG:-git_sha} image_tag=${IMAGE_TAG:-git_sha}

View file

@ -10,6 +10,7 @@
git_sha=$(git rev-parse --short HEAD) git_sha=$(git rev-parse --short HEAD)
image_tag=${IMAGE_TAG:-git_sha} image_tag=${IMAGE_TAG:-git_sha}
envarg="default-foss" envarg="default-foss"
source ../scripts/lib/_docker.sh
check_prereq() { check_prereq() {
which docker || { which docker || {
echo "Docker not installed, please install docker." echo "Docker not installed, please install docker."
@ -17,7 +18,6 @@ check_prereq() {
} }
} }
[[ $1 == ee ]] && ee=true [[ $1 == ee ]] && ee=true
[[ $PATCH -eq 1 ]] && { [[ $PATCH -eq 1 ]] && {
image_tag="$(grep -ER ^.ppVersion ../scripts/helmcharts/openreplay/charts/$chart | xargs | awk '{print $2}' | awk -F. -v OFS=. '{$NF += 1 ; print}')" image_tag="$(grep -ER ^.ppVersion ../scripts/helmcharts/openreplay/charts/$chart | xargs | awk '{print $2}' | awk -F. -v OFS=. '{$NF += 1 ; print}')"
@ -37,7 +37,7 @@ update_helm_release() {
git commit -m "chore(helm): Updating $chart image release" git commit -m "chore(helm): Updating $chart image release"
} }
function build_alerts(){ function build_alerts() {
destination="_alerts" destination="_alerts"
[[ $1 == "ee" ]] && { [[ $1 == "ee" ]] && {
destination="_alerts_ee" destination="_alerts_ee"

View file

@ -9,6 +9,7 @@
git_sha1=${IMAGE_TAG:-$(git rev-parse HEAD)} git_sha1=${IMAGE_TAG:-$(git rev-parse HEAD)}
envarg="default-foss" envarg="default-foss"
source ../scripts/lib/_docker.sh
check_prereq() { check_prereq() {
which docker || { which docker || {
echo "Docker not installed, please install docker." echo "Docker not installed, please install docker."
@ -17,7 +18,7 @@ check_prereq() {
[[ exit -eq 1 ]] && exit 1 [[ exit -eq 1 ]] && exit 1
} }
function build_crons(){ function build_crons() {
destination="_crons_ee" destination="_crons_ee"
cp -R ../api ../${destination} cp -R ../api ../${destination}
cd ../${destination} cd ../${destination}
@ -46,7 +47,6 @@ check_prereq
[[ $1 == "ee" ]] && { [[ $1 == "ee" ]] && {
build_crons $1 build_crons $1
} || { } || {
echo -e "Crons is only for ee. Rerun the script using \n bash $0 ee" echo -e "Crons is only for ee. Rerun the script using \n bash $0 ee"
exit 100 exit 100
} }

View file

@ -15,6 +15,7 @@ exit_err() {
fi fi
} }
source ../scripts/lib/_docker.sh
app="assist-stats" # Set the app variable to "chalice" app="assist-stats" # Set the app variable to "chalice"
environment=$1 environment=$1
@ -49,7 +50,7 @@ update_helm_release() {
git commit -m "chore(helm): Updating $chart image release" git commit -m "chore(helm): Updating $chart image release"
} }
function build_api(){ function build_api() {
destination="_assist_stats" destination="_assist_stats"
[[ $1 == "ee" ]] && { [[ $1 == "ee" ]] && {
destination="_assist_stats_ee" destination="_assist_stats_ee"

View file

@ -14,6 +14,7 @@ check_prereq() {
exit 1 exit 1
} }
} }
source ../scripts/lib/_docker.sh
[[ $1 == ee ]] && ee=true [[ $1 == ee ]] && ee=true
[[ $PATCH -eq 1 ]] && { [[ $PATCH -eq 1 ]] && {
@ -34,7 +35,7 @@ update_helm_release() {
git commit -m "chore(helm): Updating $chart image release" git commit -m "chore(helm): Updating $chart image release"
} }
function build_api(){ function build_api() {
destination="_assist" destination="_assist"
[[ $1 == "ee" ]] && { [[ $1 == "ee" ]] && {
destination="_assist_ee" destination="_assist_ee"

View file

@ -92,4 +92,4 @@ function build_api() {
} }
check_prereq check_prereq
build_api $1 $2 build_api i1 i2

View file

@ -15,6 +15,7 @@ exit_err() {
fi fi
} }
source ../scripts/lib/_docker.sh
app="assist-stats" # Set the app variable to "chalice" app="assist-stats" # Set the app variable to "chalice"
environment=$1 environment=$1
@ -49,7 +50,7 @@ update_helm_release() {
git commit -m "chore(helm): Updating $chart image release" git commit -m "chore(helm): Updating $chart image release"
} }
function build_api(){ function build_api() {
destination="_assist_stats" destination="_assist_stats"
[[ $1 == "ee" ]] && { [[ $1 == "ee" ]] && {
destination="_assist_stats_ee" destination="_assist_stats_ee"

View file

@ -14,6 +14,7 @@ check_prereq() {
exit 1 exit 1
} }
} }
source ../scripts/lib/_docker.sh
[[ $1 == ee ]] && ee=true [[ $1 == ee ]] && ee=true
@ -35,7 +36,7 @@ update_helm_release() {
git commit -m "chore(helm): Updating $chart image release" git commit -m "chore(helm): Updating $chart image release"
} }
function build_api(){ function build_api() {
destination="_peers" destination="_peers"
[[ $1 == "ee" ]] && { [[ $1 == "ee" ]] && {
destination="_peers_ee" destination="_peers_ee"

View file

@ -13,6 +13,7 @@ image_name="sourcemapreader"
git_sha=$(git rev-parse --short HEAD) git_sha=$(git rev-parse --short HEAD)
image_tag=${IMAGE_TAG:-git_sha} image_tag=${IMAGE_TAG:-git_sha}
envarg="default-foss" envarg="default-foss"
source ../scripts/lib/_docker.sh
check_prereq() { check_prereq() {
which docker || { which docker || {
@ -41,7 +42,7 @@ update_helm_release() {
git commit -m "chore(helm): Updating $chart image release" git commit -m "chore(helm): Updating $chart image release"
} }
function build_api(){ function build_api() {
destination="_smr" destination="_smr"
[[ $1 == "ee" ]] && { [[ $1 == "ee" ]] && {
destination="_smr_ee" destination="_smr_ee"