feat(assist-server): moved the build.sh script to the root

This commit is contained in:
Alexander 2025-04-04 15:44:19 +02:00
parent f70cce7e23
commit b55e44d450
3 changed files with 11 additions and 13 deletions

View file

@ -61,7 +61,7 @@ jobs:
ENVIRONMENT: staging ENVIRONMENT: staging
run: | run: |
skip_security_checks=${{ github.event.inputs.skip_security_checks }} skip_security_checks=${{ github.event.inputs.skip_security_checks }}
cd ee/assist-server cd assist-server
PUSH_IMAGE=0 bash -x ./build.sh ee PUSH_IMAGE=0 bash -x ./build.sh ee
[[ "x$skip_security_checks" == "xtrue" ]] || { [[ "x$skip_security_checks" == "xtrue" ]] || {
curl -L https://github.com/aquasecurity/trivy/releases/download/v0.56.2/trivy_0.56.2_Linux-64bit.tar.gz | tar -xzf - -C ./ curl -L https://github.com/aquasecurity/trivy/releases/download/v0.56.2/trivy_0.56.2_Linux-64bit.tar.gz | tar -xzf - -C ./
@ -103,7 +103,7 @@ jobs:
- name: Deploy to kubernetes - name: Deploy to kubernetes
run: | run: |
pwd pwd
cd ../scripts/helmcharts/ cd scripts/helmcharts/
# Update changed image tag # Update changed image tag
sed -i "/assist-server/{n;n;n;s/.*/ tag: ${IMAGE_TAG}/}" /tmp/image_override.yaml sed -i "/assist-server/{n;n;n;s/.*/ tag: ${IMAGE_TAG}/}" /tmp/image_override.yaml

View file

@ -2,6 +2,7 @@
# Usage: IMAGE_TAG=latest DOCKER_REPO=myDockerHubID bash build.sh <ee> # Usage: IMAGE_TAG=latest DOCKER_REPO=myDockerHubID bash build.sh <ee>
ARCH=${ARCH:-amd64}
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}
check_prereq() { check_prereq() {
@ -12,12 +13,9 @@ check_prereq() {
} }
source ../scripts/lib/_docker.sh source ../scripts/lib/_docker.sh
[[ $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}')"
[[ $ee == "true" ]] && { image_tag="${image_tag}-ee"
image_tag="${image_tag}-ee"
}
} }
update_helm_release() { update_helm_release() {
chart=$1 chart=$1
@ -32,20 +30,18 @@ update_helm_release() {
} }
function build_api() { function build_api() {
destination="_assist-server" destination="_assist-server_ee"
[[ $1 == "ee" ]] && {
destination="_assist-server_ee"
}
[[ -d ../${destination} ]] && { [[ -d ../${destination} ]] && {
echo "Removing previous build cache" echo "Removing previous build cache"
rm -rf ../${destination} rm -rf ../${destination}
} }
cp -R ../ee/assist-server ../${destination} cp -R ../assist-server ../${destination}
cd ../${destination} cd ../${destination} || exit 1
cp -rf ../ee/assist-server/* ./
docker build -f ./Dockerfile --build-arg GIT_SHA=$git_sha -t ${DOCKER_REPO:-'local'}/assist-server:${image_tag} . docker build -f ./Dockerfile --build-arg GIT_SHA=$git_sha -t ${DOCKER_REPO:-'local'}/assist-server:${image_tag} .
cd ../assist cd ../assist-server || exit 1
rm -rf ../${destination} rm -rf ../${destination}
[[ $PUSH_IMAGE -eq 1 ]] && { [[ $PUSH_IMAGE -eq 1 ]] && {
docker push ${DOCKER_REPO:-'local'}/assist-server:${image_tag} docker push ${DOCKER_REPO:-'local'}/assist-server:${image_tag}

View file

@ -50,6 +50,7 @@ io.attachApp(app);
io.engine.on("headers", (headers) => { io.engine.on("headers", (headers) => {
headers["x-host-id"] = process.env.HOSTNAME || "unknown"; headers["x-host-id"] = process.env.HOSTNAME || "unknown";
}); });
setSocketIOServer(io); setSocketIOServer(io);
const HOST = process.env.LISTEN_HOST || '0.0.0.0'; const HOST = process.env.LISTEN_HOST || '0.0.0.0';
@ -61,6 +62,7 @@ app.listen(PORT, (token) => {
console.log(`Failed to listen on port ${PORT}`); console.log(`Failed to listen on port ${PORT}`);
} }
}); });
startCacheRefresher(io); startCacheRefresher(io);
process.on('uncaughtException', err => { process.on('uncaughtException', err => {