2 months ago
Im testing if I can redeploy my service via CLI,
I am currently deploying my SpringBoot Backend with a dockerfile, which I need for building my application. The normal redeployment from the Website works fine, but if I execute:
railway down --service -y
railway redeploy --service -y
The deployment fails with the error:
./backend/mvnw clean install -DskipTests -f ./backend/pom.xml
The JAVA_HOME environment variable is not defined correctly,
this environment variable is needed to run this program.
My Dockerfile contains:
FROM eclipse-temurin:25-jdk
So my JAVA_HOME variable should be set, especially since a redeployment over the webinterface works.
2 Replies
Status changed to Awaiting Railway Response Railway • 2 months ago
2 months ago
Hello, so the issue is that railway down deletes the most recent successful deployment, and railway redeploy works by redeploying that most recent deployment without uploading new code. so when you run railway down first there's nothing left for redeploy to work with. just drop the railway down command and run railway redeploy --service -y directly, that should fix it
see docs : https://docs.railway.com/cli/down ; https://docs.railway.com/cli/redeploy
I hope this help you :)
domehane
Hello, so the issue is that railway down deletes the most recent successful deployment, and railway redeploy works by redeploying that most recent deployment without uploading new code. so when you run railway down first there's nothing left for redeploy to work with. just drop the railway down command and run railway redeploy --service <your-service> -y directly, that should fix it see docs : <https://docs.railway.com/cli/down> ; <https://docs.railway.com/cli/redeploy> I hope this help you :)
2 months ago
Thanks, the doc makes it seem like it would work with the last deployment than I will try something else!
Status changed to Solved ccabello01 • 2 months ago