Wildlfy y jboss tienen una consola con la cuál se puede hacer scripting, sin más el siguiente script lo ocupé para generar un nuevo servidor por cada ambiente que era necesario crear desde jenkins
Ver el siguiente gist:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
set serverGroupName=${env.WILDFLY_SERVER_GROUP_NAME} | |
set portOffset=${env.WILDFLY_PORT_OFFSET} | |
set host=${env.WILDFLY_HOST} | |
set maxHeapSize=${env.WILDFLY_MAX_HEAP_SIZE} | |
set permgenSize=${env.WILDFLY_PERMGEN_SIZE} | |
set jvmOptions=${env.WILDFLY_JVM_OPTIONS} | |
batch | |
/server-group=$serverGroupName:add(socket-binding-port-offset=$portOffset,profile=profile,socket-binding-group=profile-sockets) | |
/host=$host/server-config=ci6-server-one:add(group=$serverGroupName, auto-start=true) | |
/host=$host/server-config=ci6-server-one/jvm=ci6-jvm:add(max-heap-size=$maxHeapSize,permgen-size=$permgenSize,jvm-options=$jvmOptions) | |
/server-group=$serverGroupName:start-servers | |
run-batch |
Solo falta agregar unas variables de ambiente y correr el job con la opción "build with parameters"
No hay comentarios.:
Publicar un comentario