简体   繁体   中英

Deploy to JBoss from Docker Jenkins Container

I have a docker Jenkins container running on RHEL host machine that pulls out code from TFS and builds a war using Ant scripts. After the build is complete we want to push the war to a JBoss running on our RHEL host. What is the best way to do this?

We have the Jenkins home mounted to a directory on the host system and I able to manually deploy the war from this directory onto the JBoss server using the jboss-cli deploy script.

When I am inside my Jenkins container running the build can I use the file system on the host to run the jboss-cli script?

No. You can not run scripts on the host from within a container.

One solution may be to share a volume between both Jenkins and JBoss containers. This way Jenkins can deploy the war to this directory and JBoss will be able to access it. But you cannot use the Jenkins container to run a script on the host.

If you do need to execute a script, you could link the containers (ie. add them to the same docker network). You could build the JBoss container with SSH on it, and your Jenkins job could include a step to run a command on the JBoss container via SSH .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM