Skip to content

Commit

Permalink
proxy support for maven project
Browse files Browse the repository at this point in the history
  • Loading branch information
siewer committed Sep 20, 2024
1 parent aa9c6e4 commit 6802c4c
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions backend/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,27 @@ fi

sleep 30

# Configure Maven proxy settings if PROXY_HOST and PROXY_PORT are set
if [ -n "$PROXY_HOST" ] && [ -n "$PROXY_PORT" ]; then
echo "Proxy settings detected. Configuring Maven proxy..."
mkdir -p /root/.m2
cat <<EOF > /root/.m2/settings.xml
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0
http://maven.apache.org/xsd/settings-1.0.0.xsd">
<proxies>
<proxy>
<active>true</active>
<protocol>http</protocol>
<host>${PROXY_HOST}</host>
<port>${PROXY_PORT}</port>
</proxy>
</proxies>
</settings>
EOF
fi

# Check if SSL environment variable is set to true
if [ "$(echo $SSL | tr '[:upper:]' '[:lower:]')" = "true" ]; then
echo "SSL is enabled. Checking for certificates and passwords..."
Expand Down

0 comments on commit 6802c4c

Please sign in to comment.