From a30a9a29edd553d918c0d9ad120a3e450c7e5aa0 Mon Sep 17 00:00:00 2001 From: Taha Yassine Kraiem Date: Mon, 14 Nov 2022 16:10:13 +0100 Subject: [PATCH] chore(build): allow full parallel build --- backend/build.sh | 12 ++++++++---- peers/build.sh | 10 +++++++--- sourcemap-reader/build.sh | 10 +++++++--- utilities/build.sh | 10 +++++++--- 4 files changed, 29 insertions(+), 13 deletions(-) diff --git a/backend/build.sh b/backend/build.sh index 1be4fcc85..073f540df 100755 --- a/backend/build.sh +++ b/backend/build.sh @@ -31,8 +31,12 @@ function build_service() { } function build_api(){ - cp -R ../backend ../_backend - cd ../_backend + destination="_backend" + [[ $1 == "ee" ]] && { + destination="_backend_ee" + } + cp -R ../backend ../${destination} + cd ../${destination} # Copy enterprise code [[ $1 == "ee" ]] && { cp -r ../ee/backend/* ./ @@ -41,7 +45,7 @@ function build_api(){ [[ $2 != "" ]] && { build_service $2 cd ../backend - rm -rf ../_backend + rm -rf ../${destination} return } for image in $(ls cmd); @@ -50,7 +54,7 @@ function build_api(){ echo "::set-output name=image::${DOCKER_REPO:-'local'}/$image:${git_sha1}" done cd ../backend - rm -rf ../_backend + rm -rf ../${destination} echo "backend build completed" } diff --git a/peers/build.sh b/peers/build.sh index 3733a0833..e84b942ec 100644 --- a/peers/build.sh +++ b/peers/build.sh @@ -15,8 +15,12 @@ check_prereq() { } function build_api(){ - cp -R ../peers ../_peers - cd ../_peers + destination="_peers" + [[ $1 == "ee" ]] && { + destination="_peers_ee" + } + cp -R ../peers ../${destination} + cd ../${destination} cp -R ../utilities/utils . # Copy enterprise code [[ $1 == "ee" ]] && { @@ -24,7 +28,7 @@ function build_api(){ } docker build -f ./Dockerfile -t ${DOCKER_REPO:-'local'}/peers:${git_sha1} . cd ../peers - rm -rf ../_peers + rm -rf ../${destination} [[ $PUSH_IMAGE -eq 1 ]] && { docker push ${DOCKER_REPO:-'local'}/peers:${git_sha1} docker tag ${DOCKER_REPO:-'local'}/peers:${git_sha1} ${DOCKER_REPO:-'local'}/peers:latest diff --git a/sourcemap-reader/build.sh b/sourcemap-reader/build.sh index 65b6bd4f1..9767512f3 100644 --- a/sourcemap-reader/build.sh +++ b/sourcemap-reader/build.sh @@ -23,8 +23,12 @@ check_prereq() { } function build_api(){ - cp -R ../sourcemap-reader ../_smr - cd ../_smr + destination="_smr" + [[ $1 == "ee" ]] && { + destination="_smr_ee" + } + cp -R ../sourcemap-reader ../${destination} + cd ../${destination} cp -R ../utilities/utils . tag="" # Copy enterprise code @@ -35,7 +39,7 @@ function build_api(){ } docker build -f ./Dockerfile --build-arg envarg=$envarg -t ${DOCKER_REPO:-'local'}/${image_name}:${git_sha1} . cd ../sourcemap-reader - rm -rf ../_smr + rm -rf ../${destination} [[ $PUSH_IMAGE -eq 1 ]] && { docker push ${DOCKER_REPO:-'local'}/${image_name}:${git_sha1} docker tag ${DOCKER_REPO:-'local'}/${image_name}:${git_sha1} ${DOCKER_REPO:-'local'}/${image_name}:${tag}latest diff --git a/utilities/build.sh b/utilities/build.sh index b6ee774f8..98f244749 100644 --- a/utilities/build.sh +++ b/utilities/build.sh @@ -15,8 +15,12 @@ check_prereq() { } function build_api(){ - cp -R ../utilities ../_utilities - cd ../_utilities + destination="_utilities" + [[ $1 == "ee" ]] && { + destination="_utilities_ee" + } + cp -R ../utilities ../${destination} + cd ../${destination} # Copy enterprise code [[ $1 == "ee" ]] && { @@ -25,7 +29,7 @@ function build_api(){ docker build -f ./Dockerfile -t ${DOCKER_REPO:-'local'}/assist:${git_sha1} . cd ../utilities - rm -rf ../_utilities + rm -rf ../${destination} [[ $PUSH_IMAGE -eq 1 ]] && { docker push ${DOCKER_REPO:-'local'}/assist:${git_sha1} docker tag ${DOCKER_REPO:-'local'}/assist:${git_sha1} ${DOCKER_REPO:-'local'}/assist:latest