PromucFlow_constructor/app/server/build.sh
Abhijeet 7e339d419d
test: Enable server tests for the PRs with base PG branch (#33429)
## Description
1. PR to enable server tests on PRs with `pg` as the base branch. 
2. Replace the DB URI from `APPSMITH_MONGODB_URI` to `APPSMITH_DB_URL` 

## Automation

/ok-to-test tags="@tag.Sanity, @tag.GenerateCRUD, @tag.Fork"

### 🔍 Cypress test results
<!-- This is an auto-generated comment: Cypress test results  -->
> [!TIP]
> 🟢 🟢 🟢 All cypress tests have passed! 🎉 🎉 🎉
> Workflow run:
<https://github.com/appsmithorg/appsmith/actions/runs/9174148396>
> Commit: 762b4255f654946a1a47a196df5a1afae5be09f2
> Cypress dashboard url: <a
href="https://internal.appsmith.com/app/cypress-dashboard/rundetails-65890b3c81d7400d08fa9ee5?branch=master&workflowId=9174148396&attempt=1"
target="_blank">Click here!</a>

<!-- end of auto-generated comment: Cypress test results  -->












## Communication
Should the DevRel and Marketing teams inform users about this change?
- [ ] Yes
- [x] No

---------

Co-authored-by: Shrikant Sharat Kandula <shrikant@appsmith.com>
2024-05-22 15:55:20 +05:30

61 lines
1.4 KiB
Bash
Executable File

#!/bin/bash
set -o errexit
min_java_major_version=17
maven_version_output="$(mvn --version)"
echo "$maven_version_output"
if [[ "$maven_version_output" != *"Java version: $min_java_major_version."* ]]; then
echo $'\n'"Maven is not using Java $min_java_major_version. Please install Java $min_java_major_version and set it as the default Java version." >&2
exit 1
fi
# Remove previous dist directory
rm -rf dist/
is_tests_enabled=true
for i in "$@"; do
if [[ $i == "-DskipTests" ]]; then
is_tests_enabled=false
break
fi
done
if $is_tests_enabled; then
# If tests will be run, let's pull some required images that often fail to be pulled from inside Maven's test run.
docker image pull testcontainers/ryuk:0.3.0
fi
if [[ -f .env ]]; then
echo "Found a .env file, loading environment variables from that file."
set -o allexport
source .env
fi
if [[ -f tx/transform.py ]]; then
python3 tx/transform.py
fi
node scripts/check-field-constants.mjs
# Build the code. $@ accepts all the parameters from the input command line and uses it in the maven build command
mvn clean package "$@"
if [[ $? -eq 0 ]]; then
echo "mvn Successful"
else
echo "mvn Failed"
exit 1
fi
# Create the dist directory
mkdir -p dist/plugins
# Copy the server jar
cp -v ./appsmith-server/target/server-*.jar dist/
# Copy all the plugins
rsync -av --exclude "original-*.jar" ./appsmith-plugins/*/target/*.jar dist/plugins/