Skip to content

Instantly share code, notes, and snippets.

@Inkimar
Created June 26, 2020 15:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Inkimar/f9d5e090c0d19a444b0a68ff7fc2a7bd to your computer and use it in GitHub Desktop.
Save Inkimar/f9d5e090c0d19a444b0a68ff7fc2a7bd to your computer and use it in GitHub Desktop.
wildfly, deploy with wildfly, jboss-cli , nrm
Resource:
https://planet.jboss.org/post/deploy_to_wildfly_using_jboss_cli_tech_tip_11
bin/jboss-cli.sh --connect --command="deploy target/javaee7-1.0-SNAPSHOT.war --force"
My Effort:
I want to run the above command like this (docker excec )
docker exec betanaturalist sh -c 'exec bin/jboss-cli.sh --connect '
@Inkimar
Copy link
Author

Inkimar commented Jun 26, 2020

docker exec betanaturalist sh -c "exec bin/jboss-cli.sh --connect ls deployment"

@Inkimar
Copy link
Author

Inkimar commented Jun 26, 2020

this one works:

docker exec betanaturalist sh -c "exec bin/jboss-cli.sh --connect deployment-info"

@Inkimar
Copy link
Author

Inkimar commented Jun 26, 2020

this one does not work

docker exec betanaturalist sh -c "exec bin/jboss-cli.sh --connect undeploy naturalist.war"

this one does not work
docker exec betanaturalist sh -c "exec bin/jboss-cli.sh --connect deploy /tmp/naturalist.war --force"

OpenJDK 64-Bit Server VM warning: Ignoring option MaxPermSize; support was removed in 8.0
'/tmp/naturalist.war' is assumed to be a command(s) but the commands to execute have been specified by another argument: [deploy] 

@Inkimar
Copy link
Author

Inkimar commented Jun 26, 2020

this one does not work

docker exec betanaturalist sh -c "exec bin/jboss-cli.sh --connect --command 'ls deployment'"

OpenJDK 64-Bit Server VM warning: Ignoring option MaxPermSize; support was removed in 8.0
'ls deployment' is assumed to be a command(s) but the commands to execute have been specified by another argument: [--command]

@Inkimar
Copy link
Author

Inkimar commented Jun 26, 2020

THIS ONE WORKS

docker exec betanaturalist sh -c "exec bin/jboss-cli.sh --connect --command='ls deployment'"

@Inkimar
Copy link
Author

Inkimar commented Jun 26, 2020

deploy jar

login-naturalist:
docker exec -it betanaturalist bash

naturalist-copy:
docker cp ../artifact/naturalist.war betanaturalist:/tmp

naturalist-check-deployments:
docker exec betanaturalist sh -c "exec bin/jboss-cli.sh --connect --command='ls deployment'"

naturalist-undeploy:
docker exec betanaturalist sh -c "exec bin/jboss-cli.sh --connect --command='undeploy naturalist.war'"

naturalist-deploy:
docker exec betanaturalist sh -c "exec bin/jboss-cli.sh --connect --command='deploy /tmp/naturalist.war'"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment