Score:0

How to Deploy a war files in docker container by using jenkins free style job?

ua flag

I have a Redhat8 server, on that server I install docker. I take the centos8 image and create a container. In that container I install tomcat. manually I deployed wars in that container until now all is working well.

Now I want to setup a free-style job for this container in Jenkins. I try to create but after deployment iam not able to exit from container.

Followed Steps to create Job:

  1. In the first step I pull code from git

  2. In the Second step I Build the code by using the Maven command (mvn clean install)

  3. After using Remote command i entered in to host server

  4. In Host server followed steps:

    SUDO_ASKPASS="./pass.sh" sudo -A su -

    By using scp i copied files from jenkins server to target folder

    docker cp target cont1:/home/ (copied files into container)

    docker exec -it cont1 /bin/bash

    war files deployed into webapps folder and started the server

    exit (exit from the container)

    exit (exit from root host server)

    exit (exit from the Jenkins user)

the above all commands are working fine but iam not able to exit from container and host server.

Please anyone help regarding this?

I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.