Created
December 8, 2017 13:08
-
-
Save jklingsporn/47edca75f7d05bee848e428c717f2413 to your computer and use it in GitHub Desktop.
Expose public IP to JMX on EC2 instance
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -e | |
now=$(date +"%Y-%m-%d_%H-%M-%S") | |
tag="./target/app-$now.zip" | |
mvn clean install | |
echo "web: ./run.sh" > target/Procfile | |
echo "JMX_IP=\$(curl http://169.254.169.254/latest/meta-data/public-ipv4)" > target/run.sh | |
echo "exec java \$JAVA_OPTS -Djava.rmi.server.hostname=\$JMX_IP -jar app.jar \$JAVA_ARGS" >> target/run.sh | |
chmod +x target/run.sh | |
zip -j ${tag} target/Procfile target/run.sh target/app.jar |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment