Search code examples
ibm-mobilefirstcontainersibm-cloud

How to change the War file for same project in a Bluemix


I am migrating my mobile first server to bluemix, but I am facing one issue:

Whenever I try to change my War file for same project,Every time i have to create the new container and upload the new image into that.

I am running the script:

initenv.properties

prepareserverdbs.properties

prepareserver.properties

startserver.properties

and In startserver.sh , I am getting the error that container with the same already exists if i am using the same container to change the War file.

Any advice on that how to update the war file for the same project?


Solution

  • The error you see is because the old container with the same name is still running. It needs to be recreated.

    The project (.war file) on MobileFirst Platform 7.1 is an artifact that goes into the container. So recreating the image is required.

    If there are changes to the project war file, you will have to replace the .war in the ./usr/projects directory (Or if you are using PROJECT_LOC variable in args/prepareserver.properties, make sure it points to the latest project directory) and then run the following:

    1. Recreate the docker image with the new .war file: prepareserver.sh
    2. Stop and then delete your running container: cf ic stop your-container-name and cf ic rm your-container-name. (Verify that old container is deleted using the command: cf ic ps -a)
    3. Start a new MobileFirst container from the updated image: startserver.sh

    Step 2 above should fix the error that you see.